mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-12-07 09:37:19 +01:00
codetools: TCodeToolManager.GetMainCode: if FindCodeOfMainUnitHint fails, use the source directly
git-svn-id: trunk@33777 -
This commit is contained in:
parent
c48066b140
commit
d3a1c4c3e8
@ -1243,9 +1243,9 @@ begin
|
|||||||
Result:=NewFile;
|
Result:=NewFile;
|
||||||
end;
|
end;
|
||||||
if (not FilenameHasSourceExt(Result.Filename)) then begin
|
if (not FilenameHasSourceExt(Result.Filename)) then begin
|
||||||
Result:=FindCodeOfMainUnitHint(Result);
|
NewFile:=FindCodeOfMainUnitHint(Result);
|
||||||
|
if NewFile<>nil then Result:=NewFile;
|
||||||
end;
|
end;
|
||||||
if Result=nil then exit;
|
|
||||||
CreateScanner(Result);
|
CreateScanner(Result);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -1306,6 +1306,7 @@ begin
|
|||||||
if Code=nil then exit;
|
if Code=nil then exit;
|
||||||
//DebugLn('TCodeToolManager.FindCodeOfMainUnitHint ',Code.Filename);
|
//DebugLn('TCodeToolManager.FindCodeOfMainUnitHint ',Code.Filename);
|
||||||
if not FindMainUnitHint(Code.Source,MainUnitFilename) then exit;
|
if not FindMainUnitHint(Code.Source,MainUnitFilename) then exit;
|
||||||
|
if MainUnitFilename='' then exit;
|
||||||
MainUnitFilename:=TrimFilename(MainUnitFilename);
|
MainUnitFilename:=TrimFilename(MainUnitFilename);
|
||||||
if (not FilenameIsAbsolute(MainUnitFilename))
|
if (not FilenameIsAbsolute(MainUnitFilename))
|
||||||
and (not Code.IsVirtual) then
|
and (not Code.IsVirtual) then
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user