mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-14 16:42:06 +02:00
IDE: fpc msg parser: use relative Compiling paths
git-svn-id: trunk@45144 -
This commit is contained in:
parent
772e4d235b
commit
164c12f8ca
@ -267,6 +267,9 @@ type
|
|||||||
{ TFPCParser - standard parser for Free Pascal messages, implemented by IDE }
|
{ TFPCParser - standard parser for Free Pascal messages, implemented by IDE }
|
||||||
|
|
||||||
TFPCParser = class(TExtToolParser)
|
TFPCParser = class(TExtToolParser)
|
||||||
|
private
|
||||||
|
FHideHintsSenderNotUsed: boolean;
|
||||||
|
FHideHintsUnitNotUsedInMainSource: boolean;
|
||||||
protected
|
protected
|
||||||
FFilesToIgnoreUnitNotUsed: TStrings;
|
FFilesToIgnoreUnitNotUsed: TStrings;
|
||||||
public
|
public
|
||||||
@ -277,6 +280,11 @@ type
|
|||||||
class function GetFPCMsgValues(Msg: TMessageLine; out Value1, Value2: string): boolean; virtual; abstract;
|
class function GetFPCMsgValues(Msg: TMessageLine; out Value1, Value2: string): boolean; virtual; abstract;
|
||||||
property FilesToIgnoreUnitNotUsed: TStrings read FFilesToIgnoreUnitNotUsed
|
property FilesToIgnoreUnitNotUsed: TStrings read FFilesToIgnoreUnitNotUsed
|
||||||
write FFilesToIgnoreUnitNotUsed;
|
write FFilesToIgnoreUnitNotUsed;
|
||||||
|
property HideHintsSenderNotUsed: boolean read FHideHintsSenderNotUsed
|
||||||
|
write FHideHintsSenderNotUsed default true;
|
||||||
|
property HideHintsUnitNotUsedInMainSource: boolean
|
||||||
|
read FHideHintsUnitNotUsedInMainSource
|
||||||
|
write FHideHintsUnitNotUsedInMainSource default true;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{ TMakeParser - standard parser for 'make' messages, implemented by IDE }
|
{ TMakeParser - standard parser for 'make' messages, implemented by IDE }
|
||||||
|
@ -1028,6 +1028,8 @@ begin
|
|||||||
inc(p,2); // skip ./
|
inc(p,2); // skip ./
|
||||||
AFilename:=ExtractFilePath(TrimFilename(p));
|
AFilename:=ExtractFilePath(TrimFilename(p));
|
||||||
if AFilename<>'' then begin
|
if AFilename<>'' then begin
|
||||||
|
if (not FilenameIsAbsolute(AFilename)) and (Tool.WorkerDirectory<>'') then
|
||||||
|
AFilename:=TrimFilename(AppendPathDelim(Tool.WorkerDirectory)+AFilename);
|
||||||
if DirectoryStack=nil then DirectoryStack:=TStringList.Create;
|
if DirectoryStack=nil then DirectoryStack:=TStringList.Create;
|
||||||
if (DirectoryStack.Count=0)
|
if (DirectoryStack.Count=0)
|
||||||
or (DirectoryStack[DirectoryStack.Count-1]<>AFilename) then
|
or (DirectoryStack[DirectoryStack.Count-1]<>AFilename) then
|
||||||
@ -1504,8 +1506,8 @@ procedure TIDEFPCParser.ImproveMsgSenderNotUsed(MsgLine: TMessageLine);
|
|||||||
begin
|
begin
|
||||||
if (MsgLine.Urgency<=mluVerbose) then exit;
|
if (MsgLine.Urgency<=mluVerbose) then exit;
|
||||||
// check for Sender not used
|
// check for Sender not used
|
||||||
if (MsgLine.Msg='Parameter "Sender" not used') then begin
|
if HideHintsSenderNotUsed
|
||||||
// almost always not important
|
and (MsgLine.Msg='Parameter "Sender" not used') then begin
|
||||||
MsgLine.Urgency:=mluVerbose;
|
MsgLine.Urgency:=mluVerbose;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
@ -1526,7 +1528,8 @@ begin
|
|||||||
if IndexInStringList(FilesToIgnoreUnitNotUsed,cstFilename,aFilename)>=0 then
|
if IndexInStringList(FilesToIgnoreUnitNotUsed,cstFilename,aFilename)>=0 then
|
||||||
begin
|
begin
|
||||||
MsgLine.Urgency:=mluVerbose;
|
MsgLine.Urgency:=mluVerbose;
|
||||||
end else if FilenameIsAbsolute(aFilename)
|
end else if HideHintsUnitNotUsedInMainSource
|
||||||
|
and FilenameIsAbsolute(aFilename)
|
||||||
and ((CompareFileExt(aFilename, 'lpr', false)=0)
|
and ((CompareFileExt(aFilename, 'lpr', false)=0)
|
||||||
or FileExists(ChangeFileExt(aFilename, '.lpk'), aSynchronized))
|
or FileExists(ChangeFileExt(aFilename, '.lpk'), aSynchronized))
|
||||||
then begin
|
then begin
|
||||||
@ -1794,6 +1797,8 @@ begin
|
|||||||
fLineToMsgID:=TPatternToMsgIDs.Create;
|
fLineToMsgID:=TPatternToMsgIDs.Create;
|
||||||
fFileExists:=TFilenameToPointerTree.Create(false);
|
fFileExists:=TFilenameToPointerTree.Create(false);
|
||||||
FFilesToIgnoreUnitNotUsed:=TStringList.Create;
|
FFilesToIgnoreUnitNotUsed:=TStringList.Create;
|
||||||
|
HideHintsSenderNotUsed:=true;
|
||||||
|
HideHintsUnitNotUsedInMainSource:=true;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TIDEFPCParser.FileExists(const Filename: string; aSynchronized: boolean
|
function TIDEFPCParser.FileExists(const Filename: string; aSynchronized: boolean
|
||||||
|
@ -3522,8 +3522,10 @@ begin
|
|||||||
{$IFDEF EnableNewExtTools}
|
{$IFDEF EnableNewExtTools}
|
||||||
PkgCompileTool:=ExternalToolList.Add(Format(lisPkgMangCompilingPackage, [APackage.IDAsString]));
|
PkgCompileTool:=ExternalToolList.Add(Format(lisPkgMangCompilingPackage, [APackage.IDAsString]));
|
||||||
FPCParser:=TFPCParser(PkgCompileTool.AddParsers(SubToolFPC));
|
FPCParser:=TFPCParser(PkgCompileTool.AddParsers(SubToolFPC));
|
||||||
if APackage.MainUnit<>nil then
|
if (APackage.MainUnit<>nil)
|
||||||
|
and (APackage.CompilerOptions.ShowHintsForUnusedUnitsInMainSrc) then
|
||||||
FPCParser.FilesToIgnoreUnitNotUsed.Add(APackage.MainUnit.Filename);
|
FPCParser.FilesToIgnoreUnitNotUsed.Add(APackage.MainUnit.Filename);
|
||||||
|
FPCParser.HideHintsSenderNotUsed:=not APackage.CompilerOptions.ShowHintsForSenderNotUsed;
|
||||||
PkgCompileTool.AddParsers(SubToolMake);
|
PkgCompileTool.AddParsers(SubToolMake);
|
||||||
PkgCompileTool.Process.CurrentDirectory:=APackage.Directory;
|
PkgCompileTool.Process.CurrentDirectory:=APackage.Directory;
|
||||||
PkgCompileTool.Process.Executable:=CompilerFilename;
|
PkgCompileTool.Process.Executable:=CompilerFilename;
|
||||||
|
Loading…
Reference in New Issue
Block a user