mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-12-06 20:57:44 +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;
|
||||
end;
|
||||
if (not FilenameHasSourceExt(Result.Filename)) then begin
|
||||
Result:=FindCodeOfMainUnitHint(Result);
|
||||
NewFile:=FindCodeOfMainUnitHint(Result);
|
||||
if NewFile<>nil then Result:=NewFile;
|
||||
end;
|
||||
if Result=nil then exit;
|
||||
CreateScanner(Result);
|
||||
end;
|
||||
|
||||
@ -1306,6 +1306,7 @@ begin
|
||||
if Code=nil then exit;
|
||||
//DebugLn('TCodeToolManager.FindCodeOfMainUnitHint ',Code.Filename);
|
||||
if not FindMainUnitHint(Code.Source,MainUnitFilename) then exit;
|
||||
if MainUnitFilename='' then exit;
|
||||
MainUnitFilename:=TrimFilename(MainUnitFilename);
|
||||
if (not FilenameIsAbsolute(MainUnitFilename))
|
||||
and (not Code.IsVirtual) then
|
||||
|
||||
Loading…
Reference in New Issue
Block a user