mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-05 13:38:08 +02:00
ide: find used unit: search in virtual units
This commit is contained in:
parent
b09fddb930
commit
d927aa92cb
@ -3070,6 +3070,10 @@ var
|
||||
Result:=false;
|
||||
if FilenameIsAbsolute(TargetFilename) then exit;
|
||||
Result:=DoOnFindUsedUnit(CurFilename,TargetUnitName,'')<>nil;
|
||||
{$IFDEF VerboseFindSourceNameReferences}
|
||||
if Result then
|
||||
debugln(['TCodeToolManager.FindSourceNameReferences File ',Filename,', virtual target in unit path']);
|
||||
{$ENDIF}
|
||||
end;
|
||||
|
||||
begin
|
||||
|
@ -10082,6 +10082,7 @@ function TMainIDE.CodeToolBossSearchUsedUnit(const SrcFilename: string;
|
||||
const TheUnitName, TheUnitInFilename: string): TCodeBuffer;
|
||||
var
|
||||
AnUnitInfo: TUnitInfo;
|
||||
aFilename: String;
|
||||
begin
|
||||
Result:=nil;
|
||||
// check if SrcFilename is project file
|
||||
@ -10090,11 +10091,11 @@ begin
|
||||
AnUnitInfo:=Project1.ProjectUnitWithFilename(SrcFilename);
|
||||
if AnUnitInfo=nil then exit;
|
||||
// SrcFilename is a project file
|
||||
// -> search virtual project files
|
||||
AnUnitInfo:=Project1.ProjectUnitWithUnitname(TheUnitName);
|
||||
if AnUnitInfo=nil then exit;
|
||||
// -> search in virtual files
|
||||
aFilename:=CodeToolBoss.DirectoryCachePool.FindVirtualUnit(TheUnitName);
|
||||
if aFilename='' then exit;
|
||||
// virtual unit found
|
||||
Result:=AnUnitInfo.Source;
|
||||
Result:=CodeToolBoss.LoadFile(aFilename,false,false);
|
||||
end;
|
||||
|
||||
procedure TMainIDE.CodeToolBossGetVirtualDirectoryAlias(Sender: TObject;
|
||||
|
Loading…
Reference in New Issue
Block a user