mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-02 00:00:42 +02:00
IDE: further migration external tools
git-svn-id: trunk@42293 -
This commit is contained in:
parent
a3c0c0d439
commit
f5fa4b3ffe
@ -133,6 +133,7 @@ type
|
|||||||
procedure IncreaseChangeStamp;
|
procedure IncreaseChangeStamp;
|
||||||
procedure MarkFixed;
|
procedure MarkFixed;
|
||||||
function HasSourcePosition: boolean;
|
function HasSourcePosition: boolean;
|
||||||
|
procedure GetAttributes(List: TStrings);
|
||||||
public
|
public
|
||||||
property Index: integer read FIndex; // index in Lines (Note: Lines can have more or less lines than the raw output)
|
property Index: integer read FIndex; // index in Lines (Note: Lines can have more or less lines than the raw output)
|
||||||
property Urgency: TMessageLineUrgency read FUrgency write SetUrgency;
|
property Urgency: TMessageLineUrgency read FUrgency write SetUrgency;
|
||||||
@ -1760,6 +1761,20 @@ begin
|
|||||||
Result:=(Line>0) and (Column>0) and (GetFullFilename<>'');
|
Result:=(Line>0) and (Column>0) and (GetFullFilename<>'');
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TMessageLine.GetAttributes(List: TStrings);
|
||||||
|
begin
|
||||||
|
List.Assign(fAttributes);
|
||||||
|
List.Values['Urgency']:=MessageLineUrgencyNames[Urgency];
|
||||||
|
List.Values['SubTool']:=SubTool;
|
||||||
|
List.Values['SubType']:=IntToStr(SubType);
|
||||||
|
List.Values['File']:=Filename;
|
||||||
|
List.Values['Line']:=IntToStr(Line);
|
||||||
|
List.Values['Col']:=IntToStr(Column);
|
||||||
|
List.Values['Msg']:=Msg;
|
||||||
|
List.Values['MsgID']:=IntToStr(MsgID);
|
||||||
|
List.Values['OriginalLine']:=OriginalLine;
|
||||||
|
end;
|
||||||
|
|
||||||
{ TExtToolView }
|
{ TExtToolView }
|
||||||
|
|
||||||
procedure TExtToolView.FetchAllPending;
|
procedure TExtToolView.FetchAllPending;
|
||||||
|
@ -59,7 +59,11 @@ type
|
|||||||
function ShowHelpForSourcePosition(const Filename: string;
|
function ShowHelpForSourcePosition(const Filename: string;
|
||||||
const CodePos: TPoint;
|
const CodePos: TPoint;
|
||||||
var ErrMsg: string): TShowHelpResult; virtual; abstract;
|
var ErrMsg: string): TShowHelpResult; virtual; abstract;
|
||||||
|
{$IFDEF EnableNewExtTools}
|
||||||
|
procedure ShowHelpForMessage; virtual; abstract;
|
||||||
|
{$ELSE}
|
||||||
procedure ShowHelpForMessage(Line: integer); virtual; abstract;
|
procedure ShowHelpForMessage(Line: integer); virtual; abstract;
|
||||||
|
{$ENDIF}
|
||||||
procedure ShowHelpForObjectInspector(Sender: TObject); virtual; abstract;
|
procedure ShowHelpForObjectInspector(Sender: TObject); virtual; abstract;
|
||||||
procedure ShowHelpForIDEControl(Sender: TControl); virtual; abstract;
|
procedure ShowHelpForIDEControl(Sender: TControl); virtual; abstract;
|
||||||
function GetHintForSourcePosition(const ExpandedFilename: string;
|
function GetHintForSourcePosition(const ExpandedFilename: string;
|
||||||
|
@ -50,7 +50,7 @@ uses
|
|||||||
SynHighlighterPas,
|
SynHighlighterPas,
|
||||||
// IDEIntf
|
// IDEIntf
|
||||||
IDECommands, IDEMsgIntf, MacroIntf, PackageIntf, LazHelpIntf, ProjectIntf,
|
IDECommands, IDEMsgIntf, MacroIntf, PackageIntf, LazHelpIntf, ProjectIntf,
|
||||||
IDEDialogs, IDEHelpIntf, LazIDEIntf,
|
IDEDialogs, IDEHelpIntf, LazIDEIntf, IDEExternToolIntf,
|
||||||
// IDE
|
// IDE
|
||||||
EditorOptions, LazarusIDEStrConsts, CompilerOptions, IDEProcs, PackageDefs,
|
EditorOptions, LazarusIDEStrConsts, CompilerOptions, IDEProcs, PackageDefs,
|
||||||
EnvironmentOpts, TransferMacros, PackageSystem, DialogProcs, KeyMapping;
|
EnvironmentOpts, TransferMacros, PackageSystem, DialogProcs, KeyMapping;
|
||||||
@ -1411,7 +1411,8 @@ begin
|
|||||||
if not (chofQuiet in Flags) then begin
|
if not (chofQuiet in Flags) then begin
|
||||||
// for example: Filename(y,x) Error: description
|
// for example: Filename(y,x) Error: description
|
||||||
{$IFDEF EnableNewExtTools}
|
{$IFDEF EnableNewExtTools}
|
||||||
IDEMessagesWindow.addcu
|
IDEMessagesWindow.AddCustomMessage(mluError,ADocFile.DocErrorMsg,
|
||||||
|
ADocFile.CodeBuffer.Filename,0,0,'FPDoc');
|
||||||
{$ELSE}
|
{$ELSE}
|
||||||
IDEMessagesWindow.AddMsg(ADocFile.DocErrorMsg,
|
IDEMessagesWindow.AddMsg(ADocFile.DocErrorMsg,
|
||||||
ExtractFilePath(ADocFile.CodeBuffer.Filename),-1);
|
ExtractFilePath(ADocFile.CodeBuffer.Filename),-1);
|
||||||
@ -1456,7 +1457,12 @@ begin
|
|||||||
DebugLn(['TCodeHelpManager.LoadFPDocFile ',E.Message]);
|
DebugLn(['TCodeHelpManager.LoadFPDocFile ',E.Message]);
|
||||||
if not (chofQuiet in Flags) then begin
|
if not (chofQuiet in Flags) then begin
|
||||||
// for example: Filename(y,x) Error: description
|
// for example: Filename(y,x) Error: description
|
||||||
|
{$IFDEF EnableNewExtTools}
|
||||||
|
IDEMessagesWindow.AddCustomMessage(mluError,ADocFile.DocErrorMsg,
|
||||||
|
CurFilename,0,0,'FPDoc');
|
||||||
|
{$ELSE}
|
||||||
IDEMessagesWindow.AddMsg(ADocFile.DocErrorMsg,ExtractFilePath(CurFilename),-1);
|
IDEMessagesWindow.AddMsg(ADocFile.DocErrorMsg,ExtractFilePath(CurFilename),-1);
|
||||||
|
{$ENDIF}
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
on E: Exception do begin
|
on E: Exception do begin
|
||||||
|
@ -43,6 +43,7 @@ uses
|
|||||||
PropEdits, ObjectInspector, FormEditingIntf, ProjectIntf, TextTools,
|
PropEdits, ObjectInspector, FormEditingIntf, ProjectIntf, TextTools,
|
||||||
IDEDialogs, LazHelpIntf, LazHelpHTML, HelpFPDoc, MacroIntf, IDEWindowIntf,
|
IDEDialogs, LazHelpIntf, LazHelpHTML, HelpFPDoc, MacroIntf, IDEWindowIntf,
|
||||||
IDEMsgIntf, PackageIntf, LazIDEIntf, HelpIntfs, IDEHelpIntf,
|
IDEMsgIntf, PackageIntf, LazIDEIntf, HelpIntfs, IDEHelpIntf,
|
||||||
|
IDEExternToolIntf,
|
||||||
// IDE
|
// IDE
|
||||||
LazarusIDEStrConsts, TransferMacros, DialogProcs, IDEOptionDefs,
|
LazarusIDEStrConsts, TransferMacros, DialogProcs, IDEOptionDefs,
|
||||||
ObjInspExt, EnvironmentOpts, AboutFrm, Project, MainBar,
|
ObjInspExt, EnvironmentOpts, AboutFrm, Project, MainBar,
|
||||||
@ -210,7 +211,11 @@ type
|
|||||||
function ShowHelpForSourcePosition(const Filename: string;
|
function ShowHelpForSourcePosition(const Filename: string;
|
||||||
const CodePos: TPoint;
|
const CodePos: TPoint;
|
||||||
var ErrMsg: string): TShowHelpResult; override;
|
var ErrMsg: string): TShowHelpResult; override;
|
||||||
|
{$IFDEF EnableNewExtTools}
|
||||||
|
procedure ShowHelpForMessage; override;
|
||||||
|
{$ELSE}
|
||||||
procedure ShowHelpForMessage(Line: integer); override;
|
procedure ShowHelpForMessage(Line: integer); override;
|
||||||
|
{$ENDIF}
|
||||||
procedure ShowHelpForObjectInspector(Sender: TObject); override;
|
procedure ShowHelpForObjectInspector(Sender: TObject); override;
|
||||||
procedure ShowHelpForIDEControl(Sender: TControl); override;
|
procedure ShowHelpForIDEControl(Sender: TControl); override;
|
||||||
|
|
||||||
@ -1567,8 +1572,21 @@ begin
|
|||||||
CacheWasUsed,AnOwner);
|
CacheWasUsed,AnOwner);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
{$IFDEF EnableNewExtTools}
|
||||||
|
procedure TIDEHelpManager.ShowHelpForMessage;
|
||||||
|
var
|
||||||
|
Line: TMessageLine;
|
||||||
|
Parts: TStringList;
|
||||||
|
begin
|
||||||
|
if IDEMessagesWindow=nil then exit;
|
||||||
|
Line:=IDEMessagesWindow.GetSelectedLine;
|
||||||
|
if Line=nil then exit;
|
||||||
|
Parts:=TStringList.Create;
|
||||||
|
Line.GetAttributes(Parts);
|
||||||
|
ShowHelpOrErrorForMessageLine(Line.Msg,Parts);
|
||||||
|
end;
|
||||||
|
{$ELSE EnableNewExtTools}
|
||||||
procedure TIDEHelpManager.ShowHelpForMessage(Line: integer);
|
procedure TIDEHelpManager.ShowHelpForMessage(Line: integer);
|
||||||
|
|
||||||
function ParseMessage(MsgItem: TIDEMessageLine): TStringList;
|
function ParseMessage(MsgItem: TIDEMessageLine): TStringList;
|
||||||
begin
|
begin
|
||||||
Result:=TStringList.Create;
|
Result:=TStringList.Create;
|
||||||
@ -1576,7 +1594,6 @@ procedure TIDEHelpManager.ShowHelpForMessage(Line: integer);
|
|||||||
if MsgItem.Parts<>nil then
|
if MsgItem.Parts<>nil then
|
||||||
Result.Assign(MsgItem.Parts);
|
Result.Assign(MsgItem.Parts);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
var
|
var
|
||||||
MsgItem: TIDEMessageLine;
|
MsgItem: TIDEMessageLine;
|
||||||
MessageParts: TStringList;
|
MessageParts: TStringList;
|
||||||
@ -1594,6 +1611,7 @@ begin
|
|||||||
ShowHelpOrErrorForMessageLine(MsgItem.Msg,MessageParts);
|
ShowHelpOrErrorForMessageLine(MsgItem.Msg,MessageParts);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
{$ENDIF EnableNewExtTools}
|
||||||
|
|
||||||
procedure TIDEHelpManager.ShowHelpForObjectInspector(Sender: TObject);
|
procedure TIDEHelpManager.ShowHelpForObjectInspector(Sender: TObject);
|
||||||
var
|
var
|
||||||
|
@ -351,8 +351,10 @@ type
|
|||||||
procedure StartIdentCompletionBox(JumpToError: boolean);
|
procedure StartIdentCompletionBox(JumpToError: boolean);
|
||||||
procedure StartWordCompletionBox(JumpToError: boolean);
|
procedure StartWordCompletionBox(JumpToError: boolean);
|
||||||
|
|
||||||
|
{$IFNDEF EnableNewExtTools}
|
||||||
procedure LinesInserted(sender: TObject; FirstLine, Count: Integer);
|
procedure LinesInserted(sender: TObject; FirstLine, Count: Integer);
|
||||||
procedure LinesDeleted(sender: TObject; FirstLine, Count: Integer);
|
procedure LinesDeleted(sender: TObject; FirstLine, Count: Integer);
|
||||||
|
{$ENDIF}
|
||||||
|
|
||||||
function GetFilename: string; override;
|
function GetFilename: string; override;
|
||||||
function GetEditorControl: TWinControl; override;
|
function GetEditorControl: TWinControl; override;
|
||||||
@ -2778,8 +2780,11 @@ Begin
|
|||||||
|
|
||||||
FEditPlugin := TSynEditPlugin1.Create(FEditor);
|
FEditPlugin := TSynEditPlugin1.Create(FEditor);
|
||||||
// IMPORTANT: when you add/remove events below, don't forget updating UnbindEditor
|
// IMPORTANT: when you add/remove events below, don't forget updating UnbindEditor
|
||||||
|
{$IFDEF EnableNewExtTools}
|
||||||
|
{$ELSE}
|
||||||
FEditPlugin.OnLinesInserted := @LinesInserted;
|
FEditPlugin.OnLinesInserted := @LinesInserted;
|
||||||
FEditPlugin.OnLinesDeleted := @LinesDeleted;
|
FEditPlugin.OnLinesDeleted := @LinesDeleted;
|
||||||
|
{$ENDIF}
|
||||||
end;
|
end;
|
||||||
|
|
||||||
destructor TSourceEditor.Destroy;
|
destructor TSourceEditor.Destroy;
|
||||||
@ -5565,6 +5570,7 @@ begin
|
|||||||
Result := FEditor.GetWordAtRowCol(ACaretPos);
|
Result := FEditor.GetWordAtRowCol(ACaretPos);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
{$IFNDEF EnableNewExtTools}
|
||||||
procedure TSourceEditor.LinesDeleted(sender: TObject; FirstLine, Count: Integer
|
procedure TSourceEditor.LinesDeleted(sender: TObject; FirstLine, Count: Integer
|
||||||
);
|
);
|
||||||
begin
|
begin
|
||||||
@ -5582,6 +5588,7 @@ begin
|
|||||||
if (Self = FSharedValues.SharedEditors[0]) then
|
if (Self = FSharedValues.SharedEditors[0]) then
|
||||||
MessagesView.SrcEditLinesInsertedDeleted(Filename,FirstLine,Count);
|
MessagesView.SrcEditLinesInsertedDeleted(Filename,FirstLine,Count);
|
||||||
end;
|
end;
|
||||||
|
{$ENDIF}
|
||||||
|
|
||||||
procedure TSourceEditor.SetVisible(Value: boolean);
|
procedure TSourceEditor.SetVisible(Value: boolean);
|
||||||
begin
|
begin
|
||||||
|
Loading…
Reference in New Issue
Block a user