mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-23 09:19:40 +02:00
IDE: clean up old external tools
git-svn-id: trunk@45945 -
This commit is contained in:
parent
a826bc11f6
commit
160cd91c5a
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -5463,7 +5463,6 @@ ide/miscoptions.pas svneol=native#text/pascal
|
||||
ide/modematrixopts.pas svneol=native#text/plain
|
||||
ide/mouseactiondialog.lfm svneol=native#text/plain
|
||||
ide/mouseactiondialog.pas svneol=native#text/pascal
|
||||
ide/msgquickfixes.pas svneol=native#text/plain
|
||||
ide/msgvieweditor.lfm svneol=native#text/plain
|
||||
ide/msgvieweditor.pas svneol=native#text/pascal
|
||||
ide/multireplacedlg.lfm svneol=native#text/plain
|
||||
|
@ -32,20 +32,17 @@ interface
|
||||
|
||||
uses
|
||||
// FCL+LCL
|
||||
Classes, SysUtils, Math, TypInfo, LCLProc, LResources, Forms, Controls,
|
||||
Graphics, Dialogs, Buttons, StdCtrls, contnrs,
|
||||
Classes, SysUtils, Math, TypInfo, contnrs,
|
||||
LCLProc, LResources, Forms, Controls,
|
||||
Graphics, Dialogs, Buttons, StdCtrls, ExtCtrls,
|
||||
// components
|
||||
SynHighlighterLFM, SynEdit, BasicCodeTools, CodeCache, CodeToolManager,
|
||||
SynEditMiscClasses, LFMTrees,
|
||||
// IDE
|
||||
PropEdits, IDEDialogs, ComponentReg, PackageIntf, IDEWindowIntf,
|
||||
IDEExternToolIntf, PackageIntf, IDEWindowIntf, PropEdits, PropEditUtils, IDEMsgIntf,
|
||||
IDEDialogs, ComponentReg,
|
||||
CustomFormEditor, LazarusIDEStrConsts,
|
||||
{$IFNDEF EnableOldExtTools}
|
||||
IDEExternToolIntf,
|
||||
{$ELSE}
|
||||
{$ENDIF}
|
||||
IDEProcs, IDEOptionDefs, EditorOptions, SourceMarks, ExtCtrls, JITForms,
|
||||
PropEditUtils, IDEMsgIntf;
|
||||
IDEProcs, IDEOptionDefs, EditorOptions, SourceMarks, JITForms;
|
||||
|
||||
type
|
||||
|
||||
@ -419,14 +416,7 @@ begin
|
||||
if Code=nil then
|
||||
Code:=fPascalBuffer;
|
||||
Filename:=ExtractFilename(Code.Filename);
|
||||
{$IFNDEF EnableOldExtTools}
|
||||
IDEMessagesWindow.AddCustomMessage(mluError,ErrorMessage,Filename,Y,X);
|
||||
{$ELSE}
|
||||
IDEMessagesWindow.AddMsg(Filename
|
||||
+'('+IntToStr(Y)+','+IntToStr(X)+')'
|
||||
+' Error: '+ErrorMessage,
|
||||
ExtractFilePath(Code.Filename),-1);
|
||||
{$ENDIF}
|
||||
Application.ProcessMessages;
|
||||
end;
|
||||
|
||||
@ -445,15 +435,8 @@ begin
|
||||
CurError:=fLFMTree.FirstError;
|
||||
Filename:=ExtractFilename(fLFMBuffer.Filename);
|
||||
while CurError<>nil do begin
|
||||
{$IFNDEF EnableOldExtTools}
|
||||
IDEMessagesWindow.AddCustomMessage(mluError,CurError.ErrorMessage,
|
||||
Filename,CurError.Caret.Y,CurError.Caret.X);
|
||||
{$ELSE}
|
||||
IDEMessagesWindow.AddMsg(Filename
|
||||
+'('+IntToStr(CurError.Caret.Y)+','+IntToStr(CurError.Caret.X)+')'
|
||||
+' Error: '+CurError.ErrorMessage,
|
||||
ExtractFilePath(fLFMBuffer.Filename),-1);
|
||||
{$ENDIF}
|
||||
CurError:=CurError.NextError;
|
||||
end;
|
||||
Application.ProcessMessages;
|
||||
|
@ -56,13 +56,7 @@ uses
|
||||
IDEExternToolIntf,
|
||||
// IDE
|
||||
Project, DialogProcs, PackageSystem, PackageDefs, LazarusIDEStrConsts,
|
||||
IDEOptionDefs,
|
||||
{$IFNDEF EnableOldExtTools}
|
||||
etFPCMsgParser,
|
||||
{$ELSE}
|
||||
MsgQuickFixes,
|
||||
{$ENDIF}
|
||||
BasePkgManager, AddToProjectDlg,
|
||||
IDEOptionDefs, etFPCMsgParser, BasePkgManager, AddToProjectDlg,
|
||||
EnvironmentOpts;
|
||||
|
||||
|
||||
@ -376,7 +370,6 @@ type
|
||||
property IdleConnected: boolean read FIdleConnected write SetIdleConnected;
|
||||
end;
|
||||
|
||||
{$IFNDEF EnableOldExtTools}
|
||||
type
|
||||
|
||||
{ TQuickFixIdentifierNotFound_Search }
|
||||
@ -387,17 +380,6 @@ type
|
||||
procedure CreateMenuItems(Fixes: TMsgQuickFixes); override;
|
||||
procedure QuickFix(Fixes: TMsgQuickFixes; Msg: TMessageLine); override;
|
||||
end;
|
||||
{$ELSE}
|
||||
type
|
||||
{ TQuickFixIdentifierNotFound_Search - add menu item to open codebrowser }
|
||||
|
||||
TQuickFixIdentifierNotFound_Search = class(TIDEMsgQuickFixItem)
|
||||
public
|
||||
constructor Create;
|
||||
function IsApplicable(Line: TIDEMessageLine): boolean; override;
|
||||
procedure Execute(const Msg: TIDEMessageLine; Step: TIMQuickFixStep); override;
|
||||
end;
|
||||
{$ENDIF}
|
||||
var
|
||||
CodeBrowserView: TCodeBrowserView = nil;
|
||||
|
||||
@ -3209,8 +3191,6 @@ end;
|
||||
|
||||
{ TQuickFixIdentifierNotFound_Search }
|
||||
|
||||
{$IFNDEF EnableOldExtTools}
|
||||
|
||||
function TQuickFixIdentifierNotFound_Search.IsApplicable(Msg: TMessageLine; out
|
||||
Identifier: string): boolean;
|
||||
var
|
||||
@ -3279,90 +3259,6 @@ begin
|
||||
CodeBrowserView.SetFilterToSimpleIdentifier(Identifier);
|
||||
IDEWindowCreators.ShowForm(CodeBrowserView,true);
|
||||
end;
|
||||
{$ELSE}
|
||||
constructor TQuickFixIdentifierNotFound_Search.Create;
|
||||
begin
|
||||
Name:='Search identifier: Error: Identifier not found "identifier"';
|
||||
Caption:=lisQuickFixSearchIdentifier;
|
||||
Steps:=[imqfoMenuItem];
|
||||
end;
|
||||
|
||||
function TQuickFixIdentifierNotFound_Search.IsApplicable(Line: TIDEMessageLine
|
||||
): boolean;
|
||||
const
|
||||
SearchStr = ') Error: Identifier not found "';
|
||||
var
|
||||
Msg: String;
|
||||
p: integer;
|
||||
Code: TCodeBuffer;
|
||||
Filename: string;
|
||||
Caret: TPoint;
|
||||
begin
|
||||
Result:=false;
|
||||
if (Line.Parts=nil) then exit;
|
||||
Msg:=Line.Msg;
|
||||
p:=System.Pos(SearchStr,Msg);
|
||||
if p<1 then exit;
|
||||
inc(p,length(SearchStr));
|
||||
Line.GetSourcePosition(Filename,Caret.Y,Caret.X);
|
||||
if (Filename='') or (Caret.X<1) or (Caret.Y<1) then exit;
|
||||
Code:=CodeToolBoss.LoadFile(Filename,true,false);
|
||||
if Code=nil then exit;
|
||||
Result:=true;
|
||||
end;
|
||||
|
||||
procedure TQuickFixIdentifierNotFound_Search.Execute(
|
||||
const Msg: TIDEMessageLine; Step: TIMQuickFixStep);
|
||||
var
|
||||
Identifier: String;
|
||||
CodeBuf: TCodeBuffer;
|
||||
Filename, KnownFilename: string;
|
||||
Caret: TPoint;
|
||||
begin
|
||||
if Step=imqfoMenuItem then begin
|
||||
DebugLn(['TQuickFixIdentifierNotFound_Search.Execute Dir=',Msg.Directory,' Msg=',Msg.Msg,' Filename=',Msg.Parts.Values['Filename']]);
|
||||
// get source position
|
||||
// (FPC reports position right after the unknown identifier
|
||||
// for example right after FilenameIsAbsolute)
|
||||
if not GetMsgLineFile(Msg,CodeBuf,false) then exit;
|
||||
Msg.GetSourcePosition(Filename,Caret.Y,Caret.X);
|
||||
if not LazarusIDE.BeginCodeTools then begin
|
||||
DebugLn(['TQuickFixIdentifierNotFound_Search.Execute failed because IDE busy']);
|
||||
exit;
|
||||
end;
|
||||
|
||||
// get identifier
|
||||
if not REMatches(Msg.Msg,'Error: Identifier not found "([a-z_0-9]+)"','I') then begin
|
||||
DebugLn('TQuickFixIdentifierNotFound_Search invalid message ',Msg.Msg);
|
||||
exit;
|
||||
end;
|
||||
Identifier:=REVar(1);
|
||||
DebugLn(['TQuickFixIdentifierNotFound_Search.Execute Identifier=',Identifier]);
|
||||
|
||||
if (Identifier='') or (not IsValidIdent(Identifier)) then begin
|
||||
DebugLn(['TQuickFixIdentifierNotFound_Search.Execute not an identifier "',dbgstr(Identifier),'"']);
|
||||
exit;
|
||||
end;
|
||||
|
||||
KnownFilename:= LazarusIDE.FindSourceFile(Filename, Project1.ProjectDirectory,
|
||||
[fsfSearchForProject, fsfUseIncludePaths, fsfMapTempToVirtualFiles]);
|
||||
|
||||
if (KnownFilename <> '') and (KnownFilename <> Filename) then begin
|
||||
if LazarusIDE.DoOpenFileAndJumpToPos(KnownFilename,Caret,-1,-1,-1,OpnFlagsPlainFile)<>mrOk
|
||||
then
|
||||
if LazarusIDE.DoOpenFileAndJumpToPos(Filename,Caret,-1,-1,-1,OpnFlagsPlainFile)<>mrOk
|
||||
then exit;
|
||||
end
|
||||
else
|
||||
if LazarusIDE.DoOpenFileAndJumpToPos(Filename,Caret,-1,-1,-1,OpnFlagsPlainFile
|
||||
)<>mrOk
|
||||
then exit;
|
||||
|
||||
// start code browser
|
||||
ShowCodeBrowser(Identifier);
|
||||
end;
|
||||
end;
|
||||
{$Endif EnableOldExtTools}
|
||||
|
||||
end.
|
||||
|
||||
|
@ -1410,13 +1410,8 @@ begin
|
||||
if ADocFile.DocErrorMsg<>'' then begin
|
||||
if not (chofQuiet in Flags) then begin
|
||||
// for example: Filename(y,x) Error: description
|
||||
{$IFNDEF EnableOldExtTools}
|
||||
IDEMessagesWindow.AddCustomMessage(mluError,ADocFile.DocErrorMsg,
|
||||
ADocFile.CodeBuffer.Filename,0,0,'FPDoc');
|
||||
{$ELSE}
|
||||
IDEMessagesWindow.AddMsg(ADocFile.DocErrorMsg,
|
||||
ExtractFilePath(ADocFile.CodeBuffer.Filename),-1);
|
||||
{$ENDIF}
|
||||
end;
|
||||
// no update needed
|
||||
exit(chprFailed);
|
||||
@ -1457,12 +1452,8 @@ begin
|
||||
DebugLn(['TCodeHelpManager.LoadFPDocFile ',E.Message]);
|
||||
if not (chofQuiet in Flags) then begin
|
||||
// for example: Filename(y,x) Error: description
|
||||
{$IFNDEF EnableOldExtTools}
|
||||
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
|
||||
|
@ -25,8 +25,6 @@
|
||||
}
|
||||
unit etFPCMsgParser;
|
||||
|
||||
{$IFDEF EnableOldExtTools}{$ERROR Wrong}{$ENDIF}
|
||||
|
||||
{$mode objfpc}{$H+}
|
||||
|
||||
{off $DEFINE VerboseFPCMsgUnitNotFound}
|
||||
|
@ -27,8 +27,6 @@ unit etMakeMsgParser;
|
||||
|
||||
{$mode objfpc}{$H+}
|
||||
|
||||
{$IFDEF EnableOldExtTools}{$ERROR Wonrg}{$ENDIF}
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
|
@ -27,8 +27,6 @@ unit etMessagesWnd;
|
||||
|
||||
{$mode objfpc}{$H+}
|
||||
|
||||
{$IFDEF EnableOldExtTools}{$Error Wrong}{$ENDIF}
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
|
@ -27,8 +27,6 @@ unit etSrcEditMarks;
|
||||
|
||||
{$mode objfpc}{$H+}
|
||||
|
||||
{$IFDEF EnableOldExtTools}{$Error Wrong}{$ENDIF}
|
||||
|
||||
{off $DEFINE VerboseETSrcChange}
|
||||
|
||||
interface
|
||||
|
@ -45,15 +45,8 @@ uses
|
||||
StdCtrls, Dialogs, ExtCtrls, LCLProc, ButtonPanel,
|
||||
IDEExternToolIntf, IDEHelpIntf, PropEdits, IDEDialogs, IDECommands,
|
||||
FileProcs, TransferMacros, LazarusIDEStrConsts, EnvironmentOpts, KeyMapping,
|
||||
IDEProcs
|
||||
{$IFNDEF EnableOldExtTools}
|
||||
,LazConfigStorage, contnrs, IDEUtils
|
||||
{$ELSE}
|
||||
,IDEMsgIntf, EditMsgScannersDlg
|
||||
{$ENDIF}
|
||||
;
|
||||
IDEProcs, LazConfigStorage, contnrs, IDEUtils;
|
||||
|
||||
{$IFNDEF EnableOldExtTools}
|
||||
const
|
||||
ExternalToolOptionsVersion = 3;
|
||||
// 3: changed ScanOutputForFPCMessages to scanner SubToolFPC
|
||||
@ -145,22 +138,6 @@ type
|
||||
|
||||
var
|
||||
ExternalUserTools: TExternalUserTools = nil;
|
||||
{$ELSE}
|
||||
type
|
||||
{ TExternalToolOptions }
|
||||
|
||||
TExternalToolOptions = class(TIDEExternalToolOptions)
|
||||
private
|
||||
fKey: word;
|
||||
fShift: TShiftState;
|
||||
public
|
||||
procedure Assign(Source: TPersistent); override;
|
||||
procedure Clear; override;
|
||||
// key and shift are loaded with the keymapping in the editoroptions
|
||||
property Key: word read fKey write fKey;
|
||||
property Shift: TShiftState read fShift write fShift;
|
||||
end;
|
||||
{$ENDIF}
|
||||
|
||||
type
|
||||
{ TExternalToolOptionDlg - the editor dialog for a single external tool }
|
||||
@ -197,7 +174,7 @@ type
|
||||
procedure ScannersButtonClick(Sender: TObject);
|
||||
private
|
||||
fAllKeys: TKeyCommandRelationList;
|
||||
fOptions: {$IFNDEF EnableOldExtTools}TExternalUserTool{$ELSE}TExternalToolOptions{$ENDIF};
|
||||
fOptions: TExternalUserTool;
|
||||
fTransferMacros: TTransferMacroList;
|
||||
fScanners: TStrings;
|
||||
fKeyBox: TShortCutGrabBox;
|
||||
@ -208,17 +185,17 @@ type
|
||||
procedure UpdateButtons;
|
||||
function ScannersToString(List: TStrings): string;
|
||||
procedure SetComboBox(AComboBox: TComboBox; const AValue: string);
|
||||
procedure SetOptions(TheOptions: {$IFNDEF EnableOldExtTools}TExternalUserTool{$ELSE}TExternalToolOptions{$ENDIF});
|
||||
procedure SetOptions(TheOptions: TExternalUserTool);
|
||||
procedure SetTransferMacros(TransferMacroList: TTransferMacroList);
|
||||
public
|
||||
property Options: {$IFNDEF EnableOldExtTools}TExternalUserTool{$ELSE}TExternalToolOptions{$ENDIF} read fOptions write SetOptions;
|
||||
property Options: TExternalUserTool read fOptions write SetOptions;
|
||||
property MacroList: TTransferMacroList
|
||||
read fTransferMacros write SetTransferMacros;
|
||||
end;
|
||||
|
||||
|
||||
function ShowExtToolOptionDlg(TransferMacroList: TTransferMacroList;
|
||||
ExternalToolMenuItem: {$IFNDEF EnableOldExtTools}TExternalUserTool{$ELSE}TExternalToolOptions{$ENDIF};
|
||||
ExternalToolMenuItem: TExternalUserTool;
|
||||
AllKeys: TKeyCommandRelationList):TModalResult;
|
||||
|
||||
implementation
|
||||
@ -226,7 +203,7 @@ implementation
|
||||
{$R *.lfm}
|
||||
|
||||
function ShowExtToolOptionDlg(TransferMacroList: TTransferMacroList;
|
||||
ExternalToolMenuItem: {$IFNDEF EnableOldExtTools}TExternalUserTool{$ELSE}TExternalToolOptions{$ENDIF};
|
||||
ExternalToolMenuItem: TExternalUserTool;
|
||||
AllKeys: TKeyCommandRelationList):TModalResult;
|
||||
var
|
||||
ExternalToolOptionDlg: TExternalToolOptionDlg;
|
||||
@ -245,7 +222,6 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
{$IFNDEF EnableOldExtTools}
|
||||
{ TExternalUserTool }
|
||||
|
||||
// inline
|
||||
@ -672,28 +648,6 @@ begin
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
{$ELSE EnableOldExtTools}
|
||||
{ TExternalToolOptions }
|
||||
|
||||
procedure TExternalToolOptions.Assign(Source: TPersistent);
|
||||
var
|
||||
Src: TExternalToolOptions;
|
||||
begin
|
||||
if Source is TExternalToolOptions then begin
|
||||
Src:=TExternalToolOptions(Source);
|
||||
fKey:=Src.fKey;
|
||||
fShift:=Src.fShift;
|
||||
end;
|
||||
inherited Assign(Source);
|
||||
end;
|
||||
|
||||
procedure TExternalToolOptions.Clear;
|
||||
begin
|
||||
fKey:=VK_UNKNOWN;
|
||||
fShift:=[];
|
||||
inherited Clear;
|
||||
end;
|
||||
{$Endif EnableOldExtTools}
|
||||
|
||||
{ TExternalToolOptionDlg }
|
||||
|
||||
@ -705,13 +659,6 @@ End;
|
||||
|
||||
procedure TExternalToolOptionDlg.ScannersButtonClick(Sender: TObject);
|
||||
begin
|
||||
{$IFNDEF EnableOldExtTools}
|
||||
{$ELSE}
|
||||
if ShowEditMsgScannersDialog('Edit tool '+copy(TitleEdit.Text,1,20),
|
||||
fScanners)=mrOk
|
||||
then
|
||||
UpdateButtons;
|
||||
{$ENDIF}
|
||||
end;
|
||||
|
||||
procedure TExternalToolOptionDlg.LoadFromOptions;
|
||||
@ -722,13 +669,8 @@ begin
|
||||
WorkingDirEdit.Text:=fOptions.WorkingDirectory;
|
||||
fKeyBox.Key:=fOptions.Key;
|
||||
fKeyBox.ShiftState:=fOptions.Shift;
|
||||
{$IFNDEF EnableOldExtTools}
|
||||
OptionScanOutputForFPCMessagesCheckBox.Checked:=fOptions.HasScanner[SubToolFPC];
|
||||
OptionScanOutputForMakeMessagesCheckBox.Checked:=fOptions.HasScanner[SubToolMake];
|
||||
{$ELSE}
|
||||
OptionScanOutputForFPCMessagesCheckBox.Checked:=fOptions.ScanOutputForFPCMessages;
|
||||
OptionScanOutputForMakeMessagesCheckBox.Checked:=fOptions.ScanOutputForMakeMessages;
|
||||
{$ENDIF}
|
||||
chkHideMainForm.Checked:=FOptions.HideMainForm;
|
||||
fScanners.Assign(fOptions.Scanners);
|
||||
UpdateButtons;
|
||||
@ -743,28 +685,13 @@ begin
|
||||
fOptions.Key:=fKeyBox.Key;
|
||||
fOptions.Shift:=fKeyBox.ShiftState;
|
||||
FOptions.HideMainForm := chkHideMainForm.Checked;
|
||||
{$IFNDEF EnableOldExtTools}
|
||||
fOptions.HasScanner[SubToolFPC]:=OptionScanOutputForFPCMessagesCheckBox.Checked;
|
||||
fOptions.HasScanner[SubToolMake]:=OptionScanOutputForMakeMessagesCheckBox.Checked;
|
||||
{$ELSE}
|
||||
fOptions.ScanOutputForFPCMessages:=OptionScanOutputForFPCMessagesCheckBox.Checked;
|
||||
fOptions.ScanOutputForMakeMessages:=OptionScanOutputForMakeMessagesCheckBox.Checked;
|
||||
fOptions.Scanners:=fScanners;
|
||||
{$ENDIF}
|
||||
end;
|
||||
|
||||
procedure TExternalToolOptionDlg.UpdateButtons;
|
||||
begin
|
||||
{$IFNDEF EnableOldExtTools}
|
||||
ScannersButton.Visible:=false;
|
||||
{$ELSE}
|
||||
if IDEMsgScanners.Count>0 then begin
|
||||
ScannersButton.Visible:=true;
|
||||
ScannersButton.Caption:=Format(lisetEditCustomScanners, [ScannersToString(fScanners)]);
|
||||
end else begin
|
||||
ScannersButton.Visible:=false;
|
||||
end;
|
||||
{$ENDIF}
|
||||
end;
|
||||
|
||||
function TExternalToolOptionDlg.ScannersToString(List: TStrings): string;
|
||||
@ -834,7 +761,7 @@ begin
|
||||
ButtonPanel.HelpButton.Caption:=lisMenuHelp;
|
||||
ButtonPanel.CancelButton.Caption:=lisCancel;
|
||||
|
||||
fOptions:={$IFNDEF EnableOldExtTools}TExternalUserTool.Create(nil){$ELSE}TExternalToolOptions.Create{$ENDIF};
|
||||
fOptions:=TExternalUserTool.Create(nil);
|
||||
end;
|
||||
|
||||
procedure TExternalToolOptionDlg.FormDestroy(Sender: TObject);
|
||||
@ -848,7 +775,7 @@ begin
|
||||
LazarusHelp.ShowHelpForIDEControl(Self);
|
||||
end;
|
||||
|
||||
procedure TExternalToolOptionDlg.SetOptions(TheOptions: {$IFNDEF EnableOldExtTools}TExternalUserTool{$ELSE}TExternalToolOptions{$ENDIF});
|
||||
procedure TExternalToolOptionDlg.SetOptions(TheOptions: TExternalUserTool);
|
||||
begin
|
||||
if fOptions=TheOptions then exit;
|
||||
fOptions.Assign(TheOptions);
|
||||
@ -1002,8 +929,6 @@ begin
|
||||
end;
|
||||
|
||||
initialization
|
||||
{$IFNDEF EnableOldExtTools}
|
||||
ExternalUserToolsClass := TExternalUserTools;
|
||||
{$ENDIF}
|
||||
|
||||
end.
|
||||
|
@ -42,11 +42,7 @@ uses
|
||||
LazIDEIntf, TextTools, IDEMsgIntf, PackageIntf, IDEExternToolIntf,
|
||||
// IDE
|
||||
DialogProcs, PackageDefs, Project, IDEProcs, LazarusIDEStrConsts,
|
||||
{$IFNDEF EnableOldExtTools}
|
||||
etFPCMsgParser,
|
||||
{$ELSE}
|
||||
MsgQuickFixes,
|
||||
{$ENDIF}
|
||||
PackageLinks, PackageSystem, BasePkgManager;
|
||||
|
||||
type
|
||||
@ -118,7 +114,6 @@ type
|
||||
property MainOwnerName: string read FMainOwnerName;
|
||||
end;
|
||||
|
||||
{$IFNDEF EnableOldExtTools}
|
||||
type
|
||||
{ TQuickFixUnitNotFound_Search - add menu item to open this search dialog }
|
||||
|
||||
@ -139,28 +134,6 @@ type
|
||||
function IsCodetoolsErrorIncludeFileNotFound(Msg: string;
|
||||
out IncludeFile: string): boolean;
|
||||
end;
|
||||
{$ELSE}
|
||||
type
|
||||
{ TQuickFixUnitNotFound_Search - add menu item to open this search dialog }
|
||||
|
||||
TQuickFixUnitNotFound_Search = class(TIDEMsgQuickFixItem)
|
||||
public
|
||||
constructor Create;
|
||||
function IsApplicable(Line: TIDEMessageLine): boolean; override;
|
||||
procedure Execute(const Msg: TIDEMessageLine; Step: TIMQuickFixStep); override;
|
||||
end;
|
||||
|
||||
{ TQuickFixIncludeNotFound_Search - add menu item to open this search dialog }
|
||||
|
||||
TQuickFixIncludeNotFound_Search = class(TIDEMsgQuickFixItem)
|
||||
public
|
||||
constructor Create;
|
||||
function IsCodetoolsErrorIncludeFileNotFound(Msg: string;
|
||||
out IncludeFile: string): boolean;
|
||||
function IsApplicable(Line: TIDEMessageLine): boolean; override;
|
||||
procedure Execute(const Msg: TIDEMessageLine; Step: TIMQuickFixStep); override;
|
||||
end;
|
||||
{$ENDIF}
|
||||
|
||||
procedure InitFindUnitQuickFixItems;
|
||||
|
||||
@ -174,7 +147,6 @@ begin
|
||||
// ToDo: implement RegisterIDEMsgQuickFix(TQuickFixIncludeNotFound_Search.Create);
|
||||
end;
|
||||
|
||||
{$IFNDEF EnableOldExtTools}
|
||||
{ TQuickFixUnitNotFound_Search }
|
||||
|
||||
function TQuickFixUnitNotFound_Search.IsApplicable(Msg: TMessageLine; out
|
||||
@ -245,74 +217,6 @@ begin
|
||||
Dlg.Free;
|
||||
end;
|
||||
end;
|
||||
{$ELSE EnableOldExtTools}
|
||||
{ TQuickFixUnitNotFound_Search }
|
||||
|
||||
constructor TQuickFixUnitNotFound_Search.Create;
|
||||
begin
|
||||
Name:='Search unit: Error: Can''t find unit Name';
|
||||
Caption:=lisSearchUnit;
|
||||
Steps:=[imqfoMenuItem];
|
||||
end;
|
||||
|
||||
function TQuickFixUnitNotFound_Search.IsApplicable(Line: TIDEMessageLine): boolean;
|
||||
const
|
||||
SearchStr = ') Fatal: Can''t find unit ';
|
||||
var
|
||||
Msg: String;
|
||||
p: integer;
|
||||
begin
|
||||
Result:=false;
|
||||
if (Line.Parts=nil) then exit;
|
||||
Msg:=Line.Msg;
|
||||
p:=System.Pos(SearchStr,Msg);
|
||||
if p<1 then exit;
|
||||
Result:=true;
|
||||
end;
|
||||
|
||||
procedure TQuickFixUnitNotFound_Search.Execute(const Msg: TIDEMessageLine;
|
||||
Step: TIMQuickFixStep);
|
||||
var
|
||||
AnUnitName: String;
|
||||
Dlg: TFindUnitDialog;
|
||||
CodeBuf: TCodeBuffer;
|
||||
Filename: string;
|
||||
Caret: TPoint;
|
||||
begin
|
||||
if Step=imqfoMenuItem then begin
|
||||
DebugLn(['TQuickFixUnitNotFound_Search.Execute ']);
|
||||
// get source position
|
||||
if not GetMsgLineFile(Msg,CodeBuf,false) then exit;
|
||||
Msg.GetSourcePosition(Filename,Caret.Y,Caret.X);
|
||||
if not LazarusIDE.BeginCodeTools then begin
|
||||
DebugLn(['TQuickFixUnitNotFound_Search.Execute failed because IDE busy']);
|
||||
exit;
|
||||
end;
|
||||
|
||||
// get unitname
|
||||
if not REMatches(Msg.Msg,'Fatal: Can''t find unit ([a-z_0-9]+) ','I') then begin
|
||||
DebugLn('TQuickFixUnitNotFound_Search invalid message ',Msg.Msg);
|
||||
exit;
|
||||
end;
|
||||
AnUnitName:=REVar(1);
|
||||
DebugLn(['TQuickFixUnitNotFound_Search.Execute Unit=',AnUnitName]);
|
||||
|
||||
if (AnUnitName='') or (not IsValidIdent(AnUnitName)) then begin
|
||||
DebugLn(['TQuickFixUnitNotFound_Search.Execute not an identifier "',dbgstr(AnUnitName),'"']);
|
||||
exit;
|
||||
end;
|
||||
|
||||
// show dialog
|
||||
Dlg:=TFindUnitDialog.Create(nil);
|
||||
try
|
||||
Dlg.InitWithMsg(Msg.Msg,CodeBuf,AnUnitName);
|
||||
Dlg.ShowModal;
|
||||
finally
|
||||
Dlg.Free;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
{$ENDIF}
|
||||
|
||||
{ TFindUnitDialog }
|
||||
|
||||
@ -702,7 +606,6 @@ begin
|
||||
Caption:='Remove unit from uses clause';
|
||||
end;
|
||||
|
||||
{$IFNDEF EnableOldExtTools}
|
||||
{ TQuickFixIncludeNotFound_Search }
|
||||
|
||||
function TQuickFixIncludeNotFound_Search.IsApplicable(Msg: TMessageLine; out
|
||||
@ -766,61 +669,6 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
{$ELSE EnableOldExtTools}
|
||||
constructor TQuickFixIncludeNotFound_Search.Create;
|
||||
begin
|
||||
Name:='Search include file: Error: include file not found';
|
||||
Caption:=lisSearchUnit;
|
||||
Steps:=[imqfoMenuItem];
|
||||
end;
|
||||
|
||||
function TQuickFixIncludeNotFound_Search.IsApplicable(Line: TIDEMessageLine
|
||||
): boolean;
|
||||
var
|
||||
Filename: string;
|
||||
begin
|
||||
Result:=IsCodetoolsErrorIncludeFileNotFound(Line.Msg,Filename)
|
||||
and (Filename<>'');
|
||||
end;
|
||||
|
||||
procedure TQuickFixIncludeNotFound_Search.Execute(const Msg: TIDEMessageLine;
|
||||
Step: TIMQuickFixStep);
|
||||
var
|
||||
CodeBuf: TCodeBuffer;
|
||||
Filename, IncludeFilename: string;
|
||||
Caret: TPoint;
|
||||
Dlg: TFindUnitDialog;
|
||||
begin
|
||||
if Step=imqfoMenuItem then begin
|
||||
DebugLn(['TQuickFixIncludeNotFound_Search.Execute ']);
|
||||
// get source position
|
||||
if not GetMsgLineFile(Msg,CodeBuf,false) then exit;
|
||||
Msg.GetSourcePosition(Filename,Caret.Y,Caret.X);
|
||||
if not LazarusIDE.BeginCodeTools then begin
|
||||
DebugLn(['TQuickFixIncludeNotFound_Search.Execute failed because IDE busy']);
|
||||
exit;
|
||||
end;
|
||||
|
||||
// get include file name
|
||||
if not IsCodetoolsErrorIncludeFileNotFound(Msg.Msg,IncludeFilename) then
|
||||
begin
|
||||
DebugLn('TQuickFixIncludeNotFound_Search invalid message ',Msg.Msg);
|
||||
exit;
|
||||
end;
|
||||
DebugLn(['TQuickFixIncludeNotFound_Search.Execute include file=',IncludeFilename]);
|
||||
|
||||
// show dialog
|
||||
Dlg:=TFindUnitDialog.Create(nil);
|
||||
try
|
||||
Dlg.InitWithMsg(Msg.Msg,CodeBuf,IncludeFilename);
|
||||
Dlg.ShowModal;
|
||||
finally
|
||||
Dlg.Free;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
{$ENDIF}
|
||||
|
||||
function TQuickFixIncludeNotFound_Search.IsCodetoolsErrorIncludeFileNotFound(
|
||||
Msg: string; out IncludeFile: string): boolean;
|
||||
var
|
||||
|
@ -8,11 +8,7 @@ uses
|
||||
Classes, SysUtils, FileUtil, LazFileCache, LazLoggerBase, ListFilterEdit,
|
||||
StdCtrls, CheckLst, Dialogs, IDEOptionsIntf, IDEMsgIntf, IDEExternToolIntf,
|
||||
MacroIntf, IDEDialogs, CompOptsIntf, CodeToolsFPCMsgs, CompilerOptions,
|
||||
LazarusIDEStrConsts
|
||||
{$IFNDEF EnableOldExtTools}
|
||||
,etFPCMsgParser
|
||||
{$ENDIF}
|
||||
;
|
||||
LazarusIDEStrConsts, etFPCMsgParser;
|
||||
|
||||
type
|
||||
|
||||
@ -31,7 +27,7 @@ type
|
||||
procedure MsgFileBrowseButtonClick(Sender: TObject);
|
||||
procedure UseMsgFileCheckBoxChange(Sender: TObject);
|
||||
private
|
||||
TempMessages: {$IFNDEF EnableOldExtTools}TCompilerMsgIDFlags{$ELSE}TCompilerMessagesList{$ENDIF};
|
||||
TempMessages: TCompilerMsgIDFlags;
|
||||
public
|
||||
constructor Create(TheOwner: TComponent); override;
|
||||
destructor Destroy; override;
|
||||
@ -50,18 +46,10 @@ implementation
|
||||
{ TCompilerMessagesOptionsFrame }
|
||||
|
||||
procedure TCompilerMessagesOptionsFrame.chklistCompMsgItemClick(Sender: TObject; Index: integer);
|
||||
{$IFNDEF EnableOldExtTools}
|
||||
var
|
||||
MsgId: Integer;
|
||||
{$ELSE}
|
||||
const
|
||||
BoolToMessageState: array[Boolean] of TCompilerMessageState = (msOff, msOn);
|
||||
var
|
||||
m: TCompilerMessageConfig;
|
||||
{$ENDIF}
|
||||
begin
|
||||
if (Index < 0) or (Index >= chklistCompMsg.Items.Count) then exit;
|
||||
{$IFNDEF EnableOldExtTools}
|
||||
MsgId:=Integer(PtrUInt(Pointer(chklistCompMsg.Items.Objects[Index])));
|
||||
if MsgId<=0 then exit;
|
||||
if chklistCompMsg.Checked[Index] then begin
|
||||
@ -69,17 +57,9 @@ begin
|
||||
TempMessages[MsgId]:=cfvNone
|
||||
end else
|
||||
TempMessages[MsgId]:=cfvHide;
|
||||
{$ELSE}
|
||||
m := TCompilerMessageConfig(chklistCompMsg.Items.Objects[Index]);
|
||||
if (m.DefIgnored <> chklistCompMsg.Checked[Index]) then
|
||||
m.State := msDefault
|
||||
else
|
||||
m.State := BoolToMessageState[chklistCompMsg.Checked[Index]];
|
||||
{$ENDIF}
|
||||
end;
|
||||
|
||||
function TCompilerMessagesOptionsFrame.CheckItem(Item: TObject): Boolean;
|
||||
{$IFNDEF EnableOldExtTools}
|
||||
var
|
||||
MsgId: Integer;
|
||||
begin
|
||||
@ -89,17 +69,6 @@ begin
|
||||
if MsgId<=0 then exit;
|
||||
Result:=TempMessages[MsgId]<>cfvHide;
|
||||
end;
|
||||
{$ELSE}
|
||||
var
|
||||
m: TCompilerMessageConfig;
|
||||
begin
|
||||
m := Item as TCompilerMessageConfig;
|
||||
if m.State = msDefault then
|
||||
Result := not m.DefIgnored
|
||||
else
|
||||
Result := m.State = msOn;
|
||||
end;
|
||||
{$ENDIF}
|
||||
|
||||
procedure TCompilerMessagesOptionsFrame.MsgFileBrowseButtonClick(Sender: TObject
|
||||
);
|
||||
@ -129,23 +98,14 @@ end;
|
||||
constructor TCompilerMessagesOptionsFrame.Create(TheOwner: TComponent);
|
||||
begin
|
||||
inherited Create(TheOwner);
|
||||
{$IFNDEF EnableOldExtTools}
|
||||
TempMessages:=TCompilerMsgIDFlags.Create;
|
||||
UseMsgFileCheckBox.Visible:=false;
|
||||
MsgFileEdit.Visible:=false;
|
||||
MsgFileBrowseButton.Visible:=false;
|
||||
{$ELSE}
|
||||
TempMessages:=TCompilerMessagesList.Create;
|
||||
{$ENDIF}
|
||||
end;
|
||||
|
||||
destructor TCompilerMessagesOptionsFrame.Destroy;
|
||||
begin
|
||||
{$IFNDEF EnableOldExtTools}
|
||||
{$ELSE}
|
||||
editMsgFilter.Items.Clear;
|
||||
chklistCompMsg.Clear;
|
||||
{$ENDIF}
|
||||
FreeAndNil(TempMessages);
|
||||
inherited Destroy;
|
||||
end;
|
||||
@ -159,32 +119,21 @@ procedure TCompilerMessagesOptionsFrame.Setup(ADialog: TAbstractOptionsEditorDia
|
||||
begin
|
||||
grpCompilerMessages.Caption:=dlgCompilerMessage;
|
||||
lblFilter.Caption:=lisFilter;
|
||||
{$IFNDEF EnableOldExtTools}
|
||||
{$ELSE}
|
||||
UseMsgFileCheckBox.Caption:=lisUseMessageFile;
|
||||
MsgFileBrowseButton.Caption:=lisPathEditBrowse;
|
||||
{$ENDIF}
|
||||
end;
|
||||
|
||||
procedure TCompilerMessagesOptionsFrame.ReadSettings(AOptions: TAbstractIDEOptions);
|
||||
var
|
||||
topidx: Integer;
|
||||
CompOpts: TBaseCompilerOptions;
|
||||
{$IFNDEF EnableOldExtTools}
|
||||
FPCMsgFile: TFPCMsgFilePoolItem;
|
||||
i: Integer;
|
||||
Item: TFPCMsgItem;
|
||||
Urgency: TMessageLineUrgency;
|
||||
s: String;
|
||||
{$ELSE}
|
||||
i: integer;
|
||||
m: TCompilerMessageConfig;
|
||||
{$ENDIF}
|
||||
begin
|
||||
CompOpts:=AOptions as TBaseCompilerOptions;
|
||||
|
||||
topidx := chklistCompMsg.TopIndex;
|
||||
{$IFNDEF EnableOldExtTools}
|
||||
TempMessages.Assign(CompOpts.MessageFlags);
|
||||
editMsgFilter.Items.Clear;
|
||||
FPCMsgFile:=FPCMsgFilePool.LoadCurrentEnglishFile(true,nil);
|
||||
@ -207,25 +156,6 @@ begin
|
||||
FPCMsgFilePool.UnloadFile(FPCMsgFile);
|
||||
end;
|
||||
end;
|
||||
{$ELSE}
|
||||
TempMessages.Assign(CompOpts.CompilerMessages);
|
||||
UseMsgFileCheckBox.Checked:=CompOpts.UseMsgFile;
|
||||
MsgFileEdit.Text:=CompOpts.MsgFileName;
|
||||
MsgFileEdit.Enabled:=UseMsgFileCheckBox.Checked;
|
||||
MsgFileBrowseButton.Enabled:=UseMsgFileCheckBox.Checked;
|
||||
|
||||
// Copy data to filter component
|
||||
editMsgFilter.Items.Clear;
|
||||
for i := 0 to TempMessages.Count - 1 do
|
||||
begin
|
||||
m := TempMessages.Msg[i];
|
||||
case m.MsgType of
|
||||
etHint: editMsgFilter.Items.AddObject('(H) '+m.MsgText, m);
|
||||
etNote: editMsgFilter.Items.AddObject('(N) '+m.MsgText, m);
|
||||
etWarning: editMsgFilter.Items.AddObject('(W) '+m.MsgText, m);
|
||||
end;
|
||||
end;
|
||||
{$ENDIF}
|
||||
editMsgFilter.InvalidateFilter;
|
||||
chkListCompMsg.TopIndex := topidx;
|
||||
end;
|
||||
@ -234,13 +164,7 @@ procedure TCompilerMessagesOptionsFrame.WriteSettings(AOptions: TAbstractIDEOpti
|
||||
begin
|
||||
with AOptions as TBaseCompilerOptions do
|
||||
begin
|
||||
{$IFNDEF EnableOldExtTools}
|
||||
MessageFlags.Assign(TempMessages);
|
||||
{$ELSE}
|
||||
UseMsgFile:=UseMsgFileCheckBox.Checked;
|
||||
MsgFileName:=MsgFileEdit.Text;
|
||||
CompilerMessages.Assign(TempMessages);
|
||||
{$ENDIF}
|
||||
end;
|
||||
end;
|
||||
|
||||
|
@ -53,16 +53,10 @@ begin
|
||||
Items.Add(dlgShowGeneralInfo + ' (-vi)');
|
||||
Items.Add(dlgShowCompilingLineNumbers + ' (-vl)');
|
||||
Items.Add(dlgShowCompiledProcedures + ' (-vp)');
|
||||
{$IFDEF EnableOldExtTools}
|
||||
Items.Add(dlgShowFullFileNames + ' (-vb)');
|
||||
{$ENDIF}
|
||||
Items.Add(dlgShowConditionals + ' (-vc)');
|
||||
Items.Add(dlgShowEverything + ' (-va)');
|
||||
Items.Add(dlgShowExecutableInfo + ' (-vx)');
|
||||
Items.Add(dlgShowSummary + ' ' + dlgPOIconDescNone);
|
||||
{$IFDEF EnableOldExtTools}
|
||||
Items.Add(dlgShowNothing + ' (-v0)');
|
||||
{$ENDIF}
|
||||
Items.Add(dlgHintsUnused + ' ' + dlgPOIconDescNone);
|
||||
Items.Add(dlgWriteFPCLogo + ' (-l)');
|
||||
end;
|
||||
@ -89,16 +83,10 @@ begin
|
||||
Checked[i] := ShowGenInfo; i+=1;
|
||||
Checked[i] := ShowLineNum; i+=1;
|
||||
Checked[i] := ShowCompProc; i+=1;
|
||||
{$IFDEF EnableOldExtTools}
|
||||
Checked[i] := ShowAllProcsOnError; i+=1;
|
||||
{$ENDIF}
|
||||
Checked[i] := ShowCond; i+=1;
|
||||
Checked[i] := ShowAll; i+=1;
|
||||
Checked[i] := ShowExecInfo; i+=1;
|
||||
Checked[i] := ShowSummary; i+=1;
|
||||
{$IFDEF EnableOldExtTools}
|
||||
Checked[i] := ShowNothing; i+=1;
|
||||
{$ENDIF}
|
||||
Checked[i] := ShowHintsForUnusedUnitsInMainSrc; i+=1;
|
||||
Checked[i] := WriteFPCLogo; i+=1;
|
||||
|
||||
@ -124,16 +112,10 @@ begin
|
||||
ShowGenInfo := Checked[i]; i+=1;
|
||||
ShowLineNum := Checked[i]; i+=1;
|
||||
ShowCompProc := Checked[i]; i+=1;
|
||||
{$IFDEF EnableOldExtTools}
|
||||
ShowAllProcsOnError := Checked[i]; i+=1;
|
||||
{$ENDIF}
|
||||
ShowCond := Checked[i]; i+=1;
|
||||
ShowAll := Checked[i]; i+=1;
|
||||
ShowExecInfo := Checked[i]; i+=1;
|
||||
ShowSummary := Checked[i]; i+=1;
|
||||
{$IFDEF EnableOldExtTools}
|
||||
ShowNothing := Checked[i]; i+=1;
|
||||
{$ENDIF}
|
||||
ShowHintsForUnusedUnitsInMainSrc := Checked[i]; i+=1;
|
||||
WriteFPCLogo := Checked[i]; i+=1;
|
||||
StopAfterErrCount := StrToIntDef(edtErrorCnt.Text, 1);
|
||||
|
@ -221,13 +221,8 @@ begin
|
||||
MaxRecentOpenFilesLabel.Caption:=dlgMaxRecentFiles;
|
||||
MaxRecentProjectFilesLabel.Caption:=dlgMaxRecentProjs;
|
||||
OpenLastProjectAtStartCheckBox.Caption:=dlgQOpenLastPrj;
|
||||
{$IFNDEF EnableOldExtTools}
|
||||
ShowCompileDialogCheckBox.Visible:=false;
|
||||
AutoCloseCompileDialogCheckBox.Visible:=false;
|
||||
{$ELSE}
|
||||
ShowCompileDialogCheckBox.Caption:=dlgQShowCompileDialog;
|
||||
AutoCloseCompileDialogCheckBox.Caption:=dlgQAutoCloseCompileDialog;
|
||||
{$ENDIF}
|
||||
LazarusDirLabel.Caption:=dlgLazarusDir;
|
||||
with LazarusDirComboBox.Items do
|
||||
begin
|
||||
|
@ -167,10 +167,6 @@ begin
|
||||
fReady:=false;
|
||||
FDialog := ADialog;
|
||||
MWSetEditorColorsButton.Visible:=false;
|
||||
{$IFNDEF EnableOldExtTools}
|
||||
{$ELSE}
|
||||
MWColorsGroupBox.Visible:=false;
|
||||
{$ENDIF}
|
||||
end;
|
||||
|
||||
procedure TMsgWndOptionsFrame.ReadSettings(AOptions: TAbstractIDEOptions);
|
||||
|
@ -127,7 +127,7 @@ const
|
||||
'JumpHistory',
|
||||
'ComponentList'
|
||||
);
|
||||
{$IFNDEF EnableOldExtTools}
|
||||
|
||||
type
|
||||
TLMsgViewFilter = class;
|
||||
|
||||
@ -222,7 +222,6 @@ type
|
||||
|
||||
function CompareFilterMsgType(FilterMsgType1, FilterMsgType2: Pointer): integer;
|
||||
function CompareLineAndFilterMsgType(MessageLine1, FilterMsgType1: Pointer): integer;
|
||||
{$ENDIF}
|
||||
|
||||
function CreateNiceWindowPosition(Width, Height: integer): TRect;
|
||||
function NonModalIDEFormIDToEnum(const FormID: string): TNonModalIDEWindow;
|
||||
@ -323,7 +322,6 @@ begin
|
||||
Result:=TXMLOptionsStorage.Create(ConfigFilename,LoadFromDisk);
|
||||
end;
|
||||
|
||||
{$IFNDEF EnableOldExtTools}
|
||||
function CompareFilterMsgType(FilterMsgType1, FilterMsgType2: Pointer): integer;
|
||||
var
|
||||
Item1: TLMVFilterMsgType absolute FilterMsgType1;
|
||||
@ -506,7 +504,6 @@ begin
|
||||
for i:=1 to Count do
|
||||
Filters[i-1].SaveToXMLConfig(XMLConfig,Path+'Filter'+IntToStr(i)+'/');
|
||||
end;
|
||||
{$ENDIF}
|
||||
|
||||
{ TXMLOptionsStorage }
|
||||
|
||||
@ -617,7 +614,6 @@ begin
|
||||
Result:=FXMLConfig.Filename;
|
||||
end;
|
||||
|
||||
{$IFNDEF EnableOldExtTools}
|
||||
{ TLMVFilterMsgType }
|
||||
|
||||
procedure TLMVFilterMsgType.SetMsgID(AValue: integer);
|
||||
@ -964,7 +960,6 @@ begin
|
||||
E(IntToStr(i));
|
||||
end;
|
||||
end;
|
||||
{$ENDIF}
|
||||
|
||||
initialization
|
||||
DefaultConfigClass:=TXMLOptionsStorage;
|
||||
|
@ -63,12 +63,7 @@ uses
|
||||
IDECommands, IDEMsgIntf, IDEWindowIntf,
|
||||
// IDE
|
||||
LazConf, LazarusIDEStrConsts, ProjectDefs, Project, PublishModule,
|
||||
BuildLazDialog, Compiler, ComponentReg,
|
||||
{$IFNDEF EnableOldExtTools}
|
||||
etMessagesWnd,
|
||||
{$ELSE}
|
||||
OutputFilter, MsgView,
|
||||
{$ENDIF}
|
||||
BuildLazDialog, Compiler, ComponentReg, etMessagesWnd,
|
||||
TransferMacros, ObjectInspector, PropEdits, IDEDefs,
|
||||
EnvironmentOpts, EditorOptions, CompilerOptions, KeyMapping, IDEProcs,
|
||||
Debugger, IDEOptionDefs, CodeToolsDefines, Splash, Designer,
|
||||
@ -136,9 +131,6 @@ type
|
||||
procedure mnuCenterWindowItemClick(Sender: TObject); virtual;
|
||||
procedure mnuWindowSourceItemClick(Sender: TObject); virtual;
|
||||
|
||||
{$IFDEF EnableOldExtTools}
|
||||
procedure ConnectOutputFilter;
|
||||
{$ENDIF}
|
||||
procedure UpdateWindowMenu;
|
||||
|
||||
public
|
||||
@ -302,17 +294,6 @@ begin
|
||||
SourceEditorManager.ShowActiveWindowOnTop(True);
|
||||
end;
|
||||
|
||||
{$IFDEF EnableOldExtTools}
|
||||
procedure TMainIDEBase.ConnectOutputFilter;
|
||||
begin
|
||||
TheOutputFilter.OnAddFilteredLine:=@MessagesView.AddMsg;
|
||||
TheOutputFilter.OnReadLine:=@MessagesView.AddProgress;
|
||||
TheOutputFilter.OnEndReading:=@MessagesView.CollectLineParts;
|
||||
TheOutputFilter.OnBeginUpdate:=@MessagesView.BeginUpdateNotification;
|
||||
TheOutputFilter.OnEndUpdate:=@MessagesView.EndUpdateNotification;
|
||||
end;
|
||||
{$ENDIF}
|
||||
|
||||
procedure TMainIDEBase.SetToolStatus(const AValue: TIDEToolStatus);
|
||||
begin
|
||||
if FToolStatus=AValue then exit;
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -64,13 +64,7 @@ uses
|
||||
IDEDialogs, LazarusIDEStrConsts, IDECommands, CompOptsIntf, EditorOptions,
|
||||
EnvironmentOpts, WordCompletion, FindReplaceDialog, IDEProcs, IDEOptionDefs,
|
||||
IDEHelpManager, MacroPromptDlg, TransferMacros, CodeContextForm,
|
||||
SrcEditHintFrm,
|
||||
{$IFNDEF EnableOldExtTools}
|
||||
etMessagesWnd, etSrcEditMarks,
|
||||
{$ELSE}
|
||||
MsgView,
|
||||
{$ENDIF}
|
||||
InputHistory,
|
||||
SrcEditHintFrm, etMessagesWnd, etSrcEditMarks, InputHistory,
|
||||
CodeMacroPrompt, CodeTemplatesDlg, CodeToolsOptions,
|
||||
SortSelectionDlg, EncloseSelectionDlg, ConDef, InvertAssignTool,
|
||||
SourceEditProcs, SourceMarks, CharacterMapDlg, SearchFrm,
|
||||
@ -106,32 +100,6 @@ type
|
||||
hcmSoftKeepEOL // Soft Center (distance to screen edge) Caret, but keep EOL at right border
|
||||
);
|
||||
|
||||
{$IFDEF EnableOldExtTools}
|
||||
TOnLinesInsertedDeleted = procedure(Sender : TObject;
|
||||
FirstLine,Count : Integer) of Object;
|
||||
|
||||
{ TSynEditPlugin1 }
|
||||
|
||||
TSynEditPlugin1 = class(TLazSynEditPlugin)
|
||||
private
|
||||
FEnabled: Boolean;
|
||||
FOnLinesInserted : TOnLinesInsertedDeleted;
|
||||
FOnLinesDeleted : TOnLinesInsertedDeleted;
|
||||
protected
|
||||
Procedure LineCountChanged(Sender: TSynEditStrings; AIndex, ACount : Integer);
|
||||
function OwnedByEditor: Boolean; override;
|
||||
public
|
||||
property OnLinesInserted : TOnLinesInsertedDeleted
|
||||
read FOnLinesinserted write FOnLinesInserted;
|
||||
property OnLinesDeleted : TOnLinesInsertedDeleted
|
||||
read FOnLinesDeleted write FOnLinesDeleted;
|
||||
property Enabled: Boolean read FEnabled write FEnabled;
|
||||
|
||||
constructor Create(AOwner: TComponent); override;
|
||||
destructor Destroy; override;
|
||||
end;
|
||||
{$ENDIF}
|
||||
|
||||
{ TSourceEditCompletion }
|
||||
|
||||
TSourceEditCompletion=class(TSynCompletion)
|
||||
@ -253,13 +221,8 @@ type
|
||||
FEditor: TIDESynEditor;
|
||||
FTempCaret: TPoint;
|
||||
FTempTopLine: Integer;
|
||||
{$IFNDEF EnableOldExtTools}
|
||||
FEditPlugin: TETSynPlugin; // used to update the "Messages Window"
|
||||
// when text is inserted/deleted
|
||||
{$ELSE}
|
||||
FEditPlugin: TSynEditPlugin1; // used to get the LinesInserted and
|
||||
// LinesDeleted messages
|
||||
{$ENDIF}
|
||||
FOnIfdefNodeStateRequest: TSynMarkupIfdefStateRequest;
|
||||
FLastIfDefNodeScannerStep: integer;
|
||||
|
||||
@ -356,12 +319,7 @@ type
|
||||
procedure StartIdentCompletionBox(JumpToError: boolean);
|
||||
procedure StartWordCompletionBox(JumpToError: boolean);
|
||||
|
||||
{$IFNDEF EnableOldExtTools}
|
||||
function IsFirstShared(Sender: TObject): boolean;
|
||||
{$ELSE}
|
||||
procedure LinesInserted(sender: TObject; FirstLine, Count: Integer);
|
||||
procedure LinesDeleted(sender: TObject; FirstLine, Count: Integer);
|
||||
{$ENDIF}
|
||||
|
||||
function GetFilename: string; override;
|
||||
function GetEditorControl: TWinControl; override;
|
||||
@ -889,9 +847,7 @@ type
|
||||
fProducers: TFPList; // list of TSourceMarklingProducer
|
||||
FChangeNotifyLists: Array [TsemChangeReason] of TMethodList;
|
||||
FHandlers: array[TSrcEditMangerHandlerType] of TMethodList;
|
||||
{$IFNDEF EnableOldExtTools}
|
||||
FChangesQueuedForMsgWnd: TETMultiSrcChanges;// source editor changes waiting to be applied to the Messages window
|
||||
{$ENDIF}
|
||||
function GetActiveSourceWindow: TSourceEditorWindowInterface; override;
|
||||
procedure SetActiveSourceWindow(const AValue: TSourceEditorWindowInterface); override;
|
||||
function GetSourceWindows(Index: integer): TSourceEditorWindowInterface; override;
|
||||
@ -903,9 +859,7 @@ type
|
||||
function GetSourceEditors(Index: integer): TSourceEditorInterface; override;
|
||||
function GetUniqueSourceEditors(Index: integer): TSourceEditorInterface; override;
|
||||
function GetMarklingProducers(Index: integer): TSourceMarklingProducer; override;
|
||||
{$IFNDEF EnableOldExtTools}
|
||||
procedure SyncMessageWnd(Sender: TObject);
|
||||
{$ENDIF}
|
||||
public
|
||||
procedure BeginAutoFocusLock;
|
||||
procedure EndAutoFocusLock;
|
||||
@ -1118,10 +1072,8 @@ type
|
||||
procedure OnSourceCompletionTimer(Sender: TObject);
|
||||
// marks
|
||||
procedure OnSourceMarksAction(AMark: TSourceMark; AAction: TMarksAction);
|
||||
{$IFNDEF EnableOldExtTools}
|
||||
procedure OnSourceMarksGetSynEdit(Sender: TObject; aFilename: string;
|
||||
var aSynEdit: TSynEdit);
|
||||
{$ENDIF}
|
||||
property CodeTemplateModul: TSynEditAutoComplete
|
||||
read FCodeTemplateModul write FCodeTemplateModul;
|
||||
// goto dialog
|
||||
@ -2329,19 +2281,15 @@ var
|
||||
i: Integer;
|
||||
SrcEdit: TSourceEditor;
|
||||
SharedEdit: TSourceEditor;
|
||||
{$IFNDEF EnableOldExtTools}
|
||||
ETChanges: TETSingleSrcChanges;
|
||||
{$ENDIF}
|
||||
begin
|
||||
if FCodeBuffer = AValue then exit;
|
||||
if FCodeBuffer<>nil then begin
|
||||
{$IFNDEF EnableOldExtTools}
|
||||
for i := 0 to FSharedEditorList.Count - 1 do begin
|
||||
SharedEdit := SharedEditors[i];
|
||||
if SharedEdit.FEditPlugin<>nil then
|
||||
SharedEdit.FEditPlugin.Changes:=nil;
|
||||
end;
|
||||
{$ENDIF}
|
||||
FCodeBuffer.RemoveChangeHook(@OnCodeBufferChanged);
|
||||
if FCodeBuffer.Scanner<>nil then
|
||||
DisconnectScanner(FCodeBuffer.Scanner);
|
||||
@ -2375,7 +2323,6 @@ begin
|
||||
FCodeBuffer.AddChangeHook(@OnCodeBufferChanged);
|
||||
if FCodeBuffer.Scanner<>nil then
|
||||
ConnectScanner(FCodeBuffer.Scanner);
|
||||
{$IFNDEF EnableOldExtTools}
|
||||
ETChanges := SourceEditorManager.FChangesQueuedForMsgWnd.GetChanges(
|
||||
FCodeBuffer.Filename,true);
|
||||
for i := 0 to FSharedEditorList.Count - 1 do begin
|
||||
@ -2385,7 +2332,6 @@ begin
|
||||
end;
|
||||
if MessagesView<>nil then
|
||||
MessagesView.MessagesFrame1.CreateMarksForFile(SynEditor,FCodeBuffer.Filename,true);
|
||||
{$ENDIF}
|
||||
if (FIgnoreCodeBufferLock <= 0) and (not FCodeBuffer.IsEqual(SynEditor.Lines))
|
||||
then begin
|
||||
{$IFDEF IDE_DEBUG}
|
||||
@ -2836,15 +2782,8 @@ Begin
|
||||
FEditor.Beautifier := ASharedEditor.EditorComponent.Beautifier;
|
||||
end;
|
||||
|
||||
{$IFNDEF EnableOldExtTools}
|
||||
FEditPlugin := TETSynPlugin.Create(FEditor);
|
||||
FEditPlugin.OnIsEnabled:=@IsFirstShared;
|
||||
{$ELSE}
|
||||
FEditPlugin := TSynEditPlugin1.Create(FEditor);
|
||||
// IMPORTANT: when you add/remove events below, don't forget updating UnbindEditor
|
||||
FEditPlugin.OnLinesInserted := @LinesInserted;
|
||||
FEditPlugin.OnLinesDeleted := @LinesDeleted;
|
||||
{$ENDIF}
|
||||
end;
|
||||
|
||||
destructor TSourceEditor.Destroy;
|
||||
@ -5664,32 +5603,11 @@ begin
|
||||
Result := FEditor.GetWordAtRowCol(ACaretPos);
|
||||
end;
|
||||
|
||||
{$IFNDEF EnableOldExtTools}
|
||||
function TSourceEditor.IsFirstShared(Sender: TObject): boolean;
|
||||
begin
|
||||
Result:=SharedEditors[0]=Self;
|
||||
end;
|
||||
|
||||
{$ELSE}
|
||||
procedure TSourceEditor.LinesDeleted(sender: TObject; FirstLine, Count: Integer
|
||||
);
|
||||
begin
|
||||
// notify the notebook that lines were deleted.
|
||||
// marks will use this to update themselves
|
||||
if (Self = FSharedValues.SharedEditors[0]) then
|
||||
MessagesView.SrcEditLinesInsertedDeleted(Filename,FirstLine,-Count);
|
||||
end;
|
||||
|
||||
procedure TSourceEditor.LinesInserted(sender: TObject; FirstLine, Count: Integer
|
||||
);
|
||||
begin
|
||||
// notify the notebook that lines were Inserted.
|
||||
// marks will use this to update themselves
|
||||
if (Self = FSharedValues.SharedEditors[0]) then
|
||||
MessagesView.SrcEditLinesInsertedDeleted(Filename,FirstLine,Count);
|
||||
end;
|
||||
{$ENDIF}
|
||||
|
||||
procedure TSourceEditor.SetVisible(Value: boolean);
|
||||
begin
|
||||
if FVisible=Value then exit;
|
||||
@ -5729,12 +5647,7 @@ begin
|
||||
TSynPluginSyncronizedEditBase(EditorComponent.Plugin[i]).OnDeactivate := nil;
|
||||
end;
|
||||
if FEditPlugin<>nil then begin
|
||||
{$IFNDEF EnableOldExtTools}
|
||||
FEditPlugin.Enabled:=false;
|
||||
{$ELSE}
|
||||
FEditPlugin.OnLinesInserted := nil;
|
||||
FEditPlugin.OnLinesDeleted := nil;
|
||||
{$ENDIF}
|
||||
end;
|
||||
end;
|
||||
|
||||
@ -6359,12 +6272,10 @@ begin
|
||||
Marks[i].CreatePopupMenuItems(@AddUserDefinedPopupMenuItem);
|
||||
FreeMem(Marks);
|
||||
end;
|
||||
{$IFNDEF EnableOldExtTools}
|
||||
if (EditorCaret.Y<=EditorComp.Lines.Count)
|
||||
and (MessagesView<>nil) then
|
||||
MessagesView.SourceEditorPopup(EditorComp.Marks.Line[EditorCaret.Y],
|
||||
EditorComp.LogicalCaretXY);
|
||||
{$ENDIF}
|
||||
end;
|
||||
|
||||
if Assigned(Manager.OnPopupMenu) then
|
||||
@ -8375,10 +8286,8 @@ begin
|
||||
HintStr:=HintStr+CurHint;
|
||||
end;
|
||||
|
||||
{$IFNDEF EnableOldExtTools}
|
||||
if (MessagesView<>nil) then
|
||||
MessagesView.SourceEditorHint(MLine,HintStr);
|
||||
{$ENDIF}
|
||||
end;
|
||||
|
||||
if HintStr<>'' then
|
||||
@ -8484,40 +8393,6 @@ begin
|
||||
Editors[i].ClearExecutionMarks;
|
||||
end;
|
||||
|
||||
{$IFDEF EnableOldExtTools}
|
||||
{ TSynEditPlugin1 }
|
||||
|
||||
constructor TSynEditPlugin1.Create(AOwner: TComponent);
|
||||
Begin
|
||||
inherited Create(AOwner);
|
||||
FEnabled := True;
|
||||
ViewedTextBuffer.AddChangeHandler(senrLineCount, @LineCountChanged);
|
||||
end;
|
||||
|
||||
destructor TSynEditPlugin1.Destroy;
|
||||
begin
|
||||
ViewedTextBuffer.RemoveChangeHandler(senrLineCount, @LineCountChanged);
|
||||
inherited Destroy;
|
||||
end;
|
||||
|
||||
procedure TSynEditPlugin1.LineCountChanged(Sender: TSynEditStrings; AIndex, ACount: Integer);
|
||||
begin
|
||||
if not FEnabled then exit;
|
||||
if ACount < 0 then begin
|
||||
if Assigned(OnLinesDeleted) then
|
||||
OnLinesDeleted(self, AIndex+1, -ACount);
|
||||
end else begin
|
||||
if Assigned(OnLinesInserted) then
|
||||
OnLinesInserted(self, AIndex+1, ACount);
|
||||
end;
|
||||
end;
|
||||
|
||||
function TSynEditPlugin1.OwnedByEditor: Boolean;
|
||||
begin
|
||||
Result := True;
|
||||
end;
|
||||
{$ENDIF}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
procedure InternalInit;
|
||||
@ -8837,12 +8712,10 @@ begin
|
||||
Result:=TSourceMarklingProducer(fProducers[Index]);
|
||||
end;
|
||||
|
||||
{$IFNDEF EnableOldExtTools}
|
||||
procedure TSourceEditorManagerBase.SyncMessageWnd(Sender: TObject);
|
||||
begin
|
||||
MessagesView.MessagesFrame1.ApplyMultiSrcChanges(Sender as TETMultiSrcChanges);
|
||||
end;
|
||||
{$ENDIF}
|
||||
|
||||
procedure TSourceEditorManagerBase.BeginAutoFocusLock;
|
||||
begin
|
||||
@ -9018,11 +8891,9 @@ begin
|
||||
FUpdateLock := 0;
|
||||
FActiveEditorLock := 0;
|
||||
fProducers := TFPList.Create;
|
||||
{$IFNDEF EnableOldExtTools}
|
||||
FChangesQueuedForMsgWnd:=TETMultiSrcChanges.Create(Self);
|
||||
FChangesQueuedForMsgWnd.AutoSync:=true;
|
||||
FChangesQueuedForMsgWnd.OnSync:=@SyncMessageWnd;
|
||||
{$ENDIF}
|
||||
inherited;
|
||||
end;
|
||||
|
||||
@ -9032,9 +8903,7 @@ var
|
||||
cr: TsemChangeReason;
|
||||
h: TSrcEditMangerHandlerType;
|
||||
begin
|
||||
{$IFNDEF EnableOldExtTools}
|
||||
FreeAndNil(FChangesQueuedForMsgWnd);
|
||||
{$ENDIF}
|
||||
for i:=MarklingProducerCount-1 downto 0 do
|
||||
MarklingProducers[i].Free;
|
||||
FreeAndNil(fProducers);
|
||||
@ -10284,7 +10153,6 @@ begin
|
||||
Editor.UpdateExecutionSourceMark;
|
||||
end;
|
||||
|
||||
{$IFNDEF EnableOldExtTools}
|
||||
procedure TSourceEditorManager.OnSourceMarksGetSynEdit(Sender: TObject;
|
||||
aFilename: string; var aSynEdit: TSynEdit);
|
||||
var
|
||||
@ -10294,7 +10162,6 @@ begin
|
||||
if SrcEdit=nil then exit;
|
||||
aSynEdit:=SrcEdit.EditorComponent;
|
||||
end;
|
||||
{$ENDIF}
|
||||
|
||||
function TSourceEditorManager.GotoDialog: TfrmGoto;
|
||||
begin
|
||||
@ -10345,9 +10212,7 @@ begin
|
||||
// marks
|
||||
SourceEditorMarks:=TSourceMarks.Create(Self);
|
||||
SourceEditorMarks.OnAction:=@OnSourceMarksAction;
|
||||
{$IFNDEF EnableOldExtTools}
|
||||
SourceEditorMarks.ExtToolsMarks.OnGetSynEditOfFile:=@OnSourceMarksGetSynEdit;
|
||||
{$ENDIF}
|
||||
|
||||
// HintWindow
|
||||
FHints := TIDEHintWindowManager.Create;
|
||||
|
@ -41,11 +41,8 @@ uses
|
||||
Classes, SysUtils, AVL_Tree, Graphics, Controls, LCLProc,
|
||||
MenuIntf,
|
||||
SynEdit, SynEditMarks, SynEditMarkupGutterMark,
|
||||
SrcEditorIntf
|
||||
{$IFNDEF EnableOldExtTools}
|
||||
, IDEExternToolIntf, etSrcEditMarks
|
||||
{$ENDIF}
|
||||
;
|
||||
SrcEditorIntf, IDEExternToolIntf,
|
||||
etSrcEditMarks;
|
||||
|
||||
type
|
||||
TAdditionalHilightAttribute =
|
||||
@ -191,9 +188,7 @@ type
|
||||
FCurrentLineBreakPointImg: Integer;
|
||||
FCurrentLineImg: Integer;
|
||||
FCurrentLineDisabledBreakPointImg: Integer;
|
||||
{$IFNDEF EnableOldExtTools}
|
||||
FExtToolsMarks: TETMarks;
|
||||
{$ENDIF}
|
||||
FSourceLineImg: Integer;
|
||||
FImgList: TImageList;
|
||||
fInactiveBreakPointImg: Integer;
|
||||
@ -233,9 +228,7 @@ type
|
||||
property ImgList: TImageList read FImgList write FImgList;
|
||||
property Items[Index: integer]: TSourceMark read GetItems; default;
|
||||
property OnAction: TMarksActionEvent read FOnAction write FOnAction;
|
||||
{$IFNDEF EnableOldExtTools}
|
||||
property ExtToolsMarks: TETMarks read FExtToolsMarks;
|
||||
{$ENDIF}
|
||||
public
|
||||
// icon index
|
||||
property ActiveBreakPointImg: Integer read fActiveBreakPointImg;
|
||||
@ -540,13 +533,11 @@ end;
|
||||
procedure TSourceMarks.CreateImageList;
|
||||
var
|
||||
i: Integer;
|
||||
{$IFNDEF EnableOldExtTools}
|
||||
ImgIDFatal: Integer;
|
||||
ImgIDError: Integer;
|
||||
ImgIDWarning: Integer;
|
||||
ImgIDNote: Integer;
|
||||
ImgIDHint: Integer;
|
||||
{$ENDIF}
|
||||
begin
|
||||
// create default mark icons
|
||||
ImgList:=TImageList.Create(Self);
|
||||
@ -580,7 +571,6 @@ begin
|
||||
// load source line
|
||||
FSourceLineImg:=AddImage('debugger_source_line');
|
||||
|
||||
{$IFNDEF EnableOldExtTools}
|
||||
ExtToolsMarks.ImageList:=ImgList;
|
||||
ImgIDFatal:=AddImage('state11x11_fatal');
|
||||
ImgIDError:=AddImage('state11x11_error');
|
||||
@ -600,7 +590,6 @@ begin
|
||||
ExtToolsMarks.MarkStyles[mluError].ImageIndex:=ImgIDError;
|
||||
ExtToolsMarks.MarkStyles[mluFatal].ImageIndex:=ImgIDFatal;
|
||||
ExtToolsMarks.MarkStyles[mluPanic].ImageIndex:=ImgIDFatal;
|
||||
{$ENDIF}
|
||||
end;
|
||||
|
||||
function TSourceMarks.FindFirstMarkNode(ASrcEditID: TObject; ALine: integer
|
||||
@ -626,18 +615,14 @@ begin
|
||||
inherited Create(TheOwner);
|
||||
fItems:=TList.Create;
|
||||
fSortedItems:=TAVLTree.Create(@CompareSourceMarks);
|
||||
{$IFNDEF EnableOldExtTools}
|
||||
FExtToolsMarks:=TETMarks.Create(nil);
|
||||
{$ENDIF}
|
||||
CreateImageList;
|
||||
end;
|
||||
|
||||
destructor TSourceMarks.Destroy;
|
||||
begin
|
||||
Clear;
|
||||
{$IFNDEF EnableOldExtTools}
|
||||
FreeAndNil(FExtToolsMarks);
|
||||
{$ENDIF}
|
||||
FreeThenNil(FItems);
|
||||
FreeThenNil(fSortedItems);
|
||||
inherited Destroy;
|
||||
|
@ -39,9 +39,7 @@ uses
|
||||
Forms, Controls, ExtCtrls, ComCtrls, StdCtrls, Buttons, Dialogs, Menus,
|
||||
Clipbrd, LvlGraphCtrl, LazIDEIntf, ProjectIntf, IDEWindowIntf, PackageIntf,
|
||||
SrcEditorIntf, IDEImagesIntf, IDECommands, IDEDialogs, IDEMsgIntf, TextTools,
|
||||
{$IFNDEF EnableOldExtTools}
|
||||
IDEExternToolIntf,
|
||||
{$ENDIF}
|
||||
CodeToolManager, DefineTemplates, CodeToolsStructs,
|
||||
CTUnitGraph, CTUnitGroupGraph, FileProcs, CodeCache, LazarusIDEStrConsts,
|
||||
UnusedUnitsDlg;
|
||||
@ -301,7 +299,6 @@ type
|
||||
write SetPendingUnitDependencyRoute; // list of unit names, missing links are automatically found
|
||||
end;
|
||||
|
||||
{$IFNDEF EnableOldExtTools}
|
||||
type
|
||||
|
||||
{ TQuickFixCircularUnitReference }
|
||||
@ -312,18 +309,6 @@ type
|
||||
procedure CreateMenuItems(Fixes: TMsgQuickFixes); override;
|
||||
procedure QuickFix(Fixes: TMsgQuickFixes; Msg: TMessageLine); override;
|
||||
end;
|
||||
{$ELSE}
|
||||
type
|
||||
|
||||
{ TQuickFixCircularUnitReference }
|
||||
|
||||
TQuickFixCircularUnitReference = class(TIDEMsgQuickFixItem)
|
||||
public
|
||||
constructor Create;
|
||||
function IsApplicable(Line: TIDEMessageLine): boolean; override;
|
||||
procedure Execute(const Msg: TIDEMessageLine; Step: TIMQuickFixStep); override;
|
||||
end;
|
||||
{$ENDIF}
|
||||
|
||||
var
|
||||
UnitDependenciesWindow: TUnitDependenciesWindow;
|
||||
@ -425,7 +410,6 @@ begin
|
||||
inherited Destroy;
|
||||
end;
|
||||
|
||||
{$IFNDEF EnableOldExtTools}
|
||||
{ TQuickFixCircularUnitReference }
|
||||
|
||||
function TQuickFixCircularUnitReference.IsApplicable(Msg: TMessageLine; out
|
||||
@ -469,67 +453,6 @@ begin
|
||||
Path.Free;
|
||||
end;
|
||||
end;
|
||||
{$ELSE}
|
||||
{ TQuickFixCircularUnitReference }
|
||||
|
||||
constructor TQuickFixCircularUnitReference.Create;
|
||||
begin
|
||||
Name:='Show unit dependencies';
|
||||
Caption:='Show unit dependencies';
|
||||
Steps:=[imqfoMenuItem];
|
||||
end;
|
||||
|
||||
function TQuickFixCircularUnitReference.IsApplicable(Line: TIDEMessageLine
|
||||
): boolean;
|
||||
const
|
||||
SearchStr = ') Fatal: Circular unit reference between ';
|
||||
var
|
||||
Msg: String;
|
||||
p: integer;
|
||||
Code: TCodeBuffer;
|
||||
Filename: string;
|
||||
Caret: TPoint;
|
||||
begin
|
||||
Result:=false;
|
||||
if (Line.Parts=nil) then exit;
|
||||
Msg:=Line.Msg;
|
||||
p:=System.Pos(SearchStr,Msg);
|
||||
if p<1 then exit;
|
||||
inc(p,length(SearchStr));
|
||||
Line.GetSourcePosition(Filename,Caret.Y,Caret.X);
|
||||
if (Filename='') or (Caret.X<1) or (Caret.Y<1) then exit;
|
||||
Code:=CodeToolBoss.LoadFile(Filename,true,false);
|
||||
if Code=nil then exit;
|
||||
Result:=true;
|
||||
end;
|
||||
|
||||
procedure TQuickFixCircularUnitReference.Execute(const Msg: TIDEMessageLine;
|
||||
Step: TIMQuickFixStep);
|
||||
var
|
||||
UnitName1: String;
|
||||
UnitName2: String;
|
||||
Path: TStringList;
|
||||
begin
|
||||
if Step<>imqfoMenuItem then exit;
|
||||
if not REMatches(Msg.Msg,'Fatal: Circular unit reference between ([a-z_0-9.]+) and ([a-z_0-9.]+)','I')
|
||||
then begin
|
||||
debugln(['TQuickFixCircularUnitReference.Execute invalid message ',Msg.Msg]);
|
||||
exit;
|
||||
end;
|
||||
UnitName1:=REVar(1);
|
||||
UnitName2:=REVar(2);
|
||||
ShowUnitDependencies(true,true);
|
||||
Path:=TStringList.Create;
|
||||
try
|
||||
Path.Add(UnitName1);
|
||||
Path.Add(UnitName2);
|
||||
Path.Add(UnitName1);
|
||||
UnitDependenciesWindow.PendingUnitDependencyRoute:=Path;
|
||||
finally
|
||||
Path.Free;
|
||||
end;
|
||||
end;
|
||||
{$ENDIF}
|
||||
|
||||
{ TUDNode }
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user