mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-08 02:38:03 +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 MarkFixed;
|
||||
function HasSourcePosition: boolean;
|
||||
procedure GetAttributes(List: TStrings);
|
||||
public
|
||||
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;
|
||||
@ -1760,6 +1761,20 @@ begin
|
||||
Result:=(Line>0) and (Column>0) and (GetFullFilename<>'');
|
||||
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 }
|
||||
|
||||
procedure TExtToolView.FetchAllPending;
|
||||
|
@ -59,7 +59,11 @@ type
|
||||
function ShowHelpForSourcePosition(const Filename: string;
|
||||
const CodePos: TPoint;
|
||||
var ErrMsg: string): TShowHelpResult; virtual; abstract;
|
||||
{$IFDEF EnableNewExtTools}
|
||||
procedure ShowHelpForMessage; virtual; abstract;
|
||||
{$ELSE}
|
||||
procedure ShowHelpForMessage(Line: integer); virtual; abstract;
|
||||
{$ENDIF}
|
||||
procedure ShowHelpForObjectInspector(Sender: TObject); virtual; abstract;
|
||||
procedure ShowHelpForIDEControl(Sender: TControl); virtual; abstract;
|
||||
function GetHintForSourcePosition(const ExpandedFilename: string;
|
||||
|
@ -50,7 +50,7 @@ uses
|
||||
SynHighlighterPas,
|
||||
// IDEIntf
|
||||
IDECommands, IDEMsgIntf, MacroIntf, PackageIntf, LazHelpIntf, ProjectIntf,
|
||||
IDEDialogs, IDEHelpIntf, LazIDEIntf,
|
||||
IDEDialogs, IDEHelpIntf, LazIDEIntf, IDEExternToolIntf,
|
||||
// IDE
|
||||
EditorOptions, LazarusIDEStrConsts, CompilerOptions, IDEProcs, PackageDefs,
|
||||
EnvironmentOpts, TransferMacros, PackageSystem, DialogProcs, KeyMapping;
|
||||
@ -1411,7 +1411,8 @@ begin
|
||||
if not (chofQuiet in Flags) then begin
|
||||
// for example: Filename(y,x) Error: description
|
||||
{$IFDEF EnableNewExtTools}
|
||||
IDEMessagesWindow.addcu
|
||||
IDEMessagesWindow.AddCustomMessage(mluError,ADocFile.DocErrorMsg,
|
||||
ADocFile.CodeBuffer.Filename,0,0,'FPDoc');
|
||||
{$ELSE}
|
||||
IDEMessagesWindow.AddMsg(ADocFile.DocErrorMsg,
|
||||
ExtractFilePath(ADocFile.CodeBuffer.Filename),-1);
|
||||
@ -1456,7 +1457,12 @@ begin
|
||||
DebugLn(['TCodeHelpManager.LoadFPDocFile ',E.Message]);
|
||||
if not (chofQuiet in Flags) then begin
|
||||
// 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);
|
||||
{$ENDIF}
|
||||
end;
|
||||
end;
|
||||
on E: Exception do begin
|
||||
|
@ -43,6 +43,7 @@ uses
|
||||
PropEdits, ObjectInspector, FormEditingIntf, ProjectIntf, TextTools,
|
||||
IDEDialogs, LazHelpIntf, LazHelpHTML, HelpFPDoc, MacroIntf, IDEWindowIntf,
|
||||
IDEMsgIntf, PackageIntf, LazIDEIntf, HelpIntfs, IDEHelpIntf,
|
||||
IDEExternToolIntf,
|
||||
// IDE
|
||||
LazarusIDEStrConsts, TransferMacros, DialogProcs, IDEOptionDefs,
|
||||
ObjInspExt, EnvironmentOpts, AboutFrm, Project, MainBar,
|
||||
@ -210,7 +211,11 @@ type
|
||||
function ShowHelpForSourcePosition(const Filename: string;
|
||||
const CodePos: TPoint;
|
||||
var ErrMsg: string): TShowHelpResult; override;
|
||||
{$IFDEF EnableNewExtTools}
|
||||
procedure ShowHelpForMessage; override;
|
||||
{$ELSE}
|
||||
procedure ShowHelpForMessage(Line: integer); override;
|
||||
{$ENDIF}
|
||||
procedure ShowHelpForObjectInspector(Sender: TObject); override;
|
||||
procedure ShowHelpForIDEControl(Sender: TControl); override;
|
||||
|
||||
@ -1567,8 +1572,21 @@ begin
|
||||
CacheWasUsed,AnOwner);
|
||||
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);
|
||||
|
||||
function ParseMessage(MsgItem: TIDEMessageLine): TStringList;
|
||||
begin
|
||||
Result:=TStringList.Create;
|
||||
@ -1576,7 +1594,6 @@ procedure TIDEHelpManager.ShowHelpForMessage(Line: integer);
|
||||
if MsgItem.Parts<>nil then
|
||||
Result.Assign(MsgItem.Parts);
|
||||
end;
|
||||
|
||||
var
|
||||
MsgItem: TIDEMessageLine;
|
||||
MessageParts: TStringList;
|
||||
@ -1594,6 +1611,7 @@ begin
|
||||
ShowHelpOrErrorForMessageLine(MsgItem.Msg,MessageParts);
|
||||
end;
|
||||
end;
|
||||
{$ENDIF EnableNewExtTools}
|
||||
|
||||
procedure TIDEHelpManager.ShowHelpForObjectInspector(Sender: TObject);
|
||||
var
|
||||
|
@ -351,8 +351,10 @@ type
|
||||
procedure StartIdentCompletionBox(JumpToError: boolean);
|
||||
procedure StartWordCompletionBox(JumpToError: boolean);
|
||||
|
||||
{$IFNDEF EnableNewExtTools}
|
||||
procedure LinesInserted(sender: TObject; FirstLine, Count: Integer);
|
||||
procedure LinesDeleted(sender: TObject; FirstLine, Count: Integer);
|
||||
{$ENDIF}
|
||||
|
||||
function GetFilename: string; override;
|
||||
function GetEditorControl: TWinControl; override;
|
||||
@ -2778,8 +2780,11 @@ Begin
|
||||
|
||||
FEditPlugin := TSynEditPlugin1.Create(FEditor);
|
||||
// IMPORTANT: when you add/remove events below, don't forget updating UnbindEditor
|
||||
{$IFDEF EnableNewExtTools}
|
||||
{$ELSE}
|
||||
FEditPlugin.OnLinesInserted := @LinesInserted;
|
||||
FEditPlugin.OnLinesDeleted := @LinesDeleted;
|
||||
{$ENDIF}
|
||||
end;
|
||||
|
||||
destructor TSourceEditor.Destroy;
|
||||
@ -5565,6 +5570,7 @@ begin
|
||||
Result := FEditor.GetWordAtRowCol(ACaretPos);
|
||||
end;
|
||||
|
||||
{$IFNDEF EnableNewExtTools}
|
||||
procedure TSourceEditor.LinesDeleted(sender: TObject; FirstLine, Count: Integer
|
||||
);
|
||||
begin
|
||||
@ -5582,6 +5588,7 @@ begin
|
||||
if (Self = FSharedValues.SharedEditors[0]) then
|
||||
MessagesView.SrcEditLinesInsertedDeleted(Filename,FirstLine,Count);
|
||||
end;
|
||||
{$ENDIF}
|
||||
|
||||
procedure TSourceEditor.SetVisible(Value: boolean);
|
||||
begin
|
||||
|
Loading…
Reference in New Issue
Block a user