mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-06 12:00:40 +02:00
implemented searching for indirect include files
git-svn-id: trunk@4185 -
This commit is contained in:
parent
f5fda4505a
commit
562671b13c
@ -208,6 +208,7 @@ type
|
||||
function GetCompilerModeForDirectory(const Directory: string): TCompilerMode;
|
||||
function GetCompiledSrcExtForDirectory(const Directory: string): string;
|
||||
function FindUnitInUnitLinks(const Directory, UnitName: string): string;
|
||||
function GetUnitLinksForDirectory(const Directory: string): string;
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
|
||||
@ -704,15 +705,24 @@ end;
|
||||
function TCodeToolManager.FindUnitInUnitLinks(const Directory, UnitName: string
|
||||
): string;
|
||||
var
|
||||
Evaluator: TExpressionEvaluator;
|
||||
UnitLinks: string;
|
||||
UnitLinkStart, UnitLinkEnd: integer;
|
||||
begin
|
||||
Result:='';
|
||||
UnitLinks:=GetUnitLinksForDirectory(Directory);
|
||||
if UnitLinks='' then exit;
|
||||
SearchUnitInUnitLinks(UnitLinks,UnitName,UnitLinkStart,UnitLinkEnd,Result);
|
||||
end;
|
||||
|
||||
function TCodeToolManager.GetUnitLinksForDirectory(const Directory: string
|
||||
): string;
|
||||
var
|
||||
Evaluator: TExpressionEvaluator;
|
||||
begin
|
||||
Result:='';
|
||||
Evaluator:=DefineTree.GetDefinesForDirectory(Directory,true);
|
||||
if Evaluator=nil then exit;
|
||||
UnitLinks:=Evaluator[ExternalMacroStart+'UnitLinks'];
|
||||
SearchUnitInUnitLinks(UnitLinks,UnitName,UnitLinkStart,UnitLinkEnd,Result);
|
||||
Result:=Evaluator[ExternalMacroStart+'UnitLinks'];
|
||||
end;
|
||||
|
||||
function TCodeToolManager.InitCurCodeTool(Code: TCodeBuffer): boolean;
|
||||
|
@ -395,6 +395,7 @@ function DefineTemplateFlagsToString(Flags: TDefineTemplateFlags): string;
|
||||
function SearchUnitInUnitLinks(const UnitLinks, TheUnitName: string;
|
||||
var UnitLinkStart, UnitLinkEnd: integer; var Filename: string): boolean;
|
||||
|
||||
|
||||
implementation
|
||||
|
||||
|
||||
|
@ -318,7 +318,8 @@ begin
|
||||
Exit;
|
||||
end;
|
||||
|
||||
SrcFile := MainIDE.FindSourceFile(ALocation.SrcFile);
|
||||
SrcFile := MainIDE.FindSourceFile(ALocation.SrcFile,Project1.ProjectDirectory,
|
||||
[fsfSearchForProject,fsfUseIncludePaths]);
|
||||
if SrcFile = '' then SrcFile := ALocation.SrcFile;
|
||||
|
||||
if not FilenameIsAbsolute(SrcFile)
|
||||
@ -936,6 +937,9 @@ end.
|
||||
|
||||
{ =============================================================================
|
||||
$Log$
|
||||
Revision 1.25 2003/05/25 15:31:11 mattias
|
||||
implemented searching for indirect include files
|
||||
|
||||
Revision 1.24 2003/05/25 12:12:36 mattias
|
||||
added TScreen handlers, implemented TMainIDE.UnHideIDE
|
||||
|
||||
|
@ -145,6 +145,13 @@ type
|
||||
);
|
||||
TCodeToolsFlags = set of TCodeToolsFlag;
|
||||
|
||||
// find source flags
|
||||
TFindSourceFlag = (
|
||||
fsfSearchForProject,
|
||||
fsfUseIncludePaths
|
||||
);
|
||||
TFindSourceFlags = set of TFindSourceFlag;
|
||||
|
||||
{ TMainIDEBar }
|
||||
|
||||
TMainIDEBar = class(TForm)
|
||||
@ -370,7 +377,8 @@ type
|
||||
procedure CreateOftenUsedForms; virtual; abstract;
|
||||
|
||||
function FindUnitFile(const AFilename: string): string; virtual; abstract;
|
||||
function FindSourceFile(const AFilename: string): string; virtual; abstract;
|
||||
function FindSourceFile(const AFilename, BaseDirectory: string;
|
||||
Flags: TFindSourceFlags): string; virtual; abstract;
|
||||
procedure GetCurrentUnit(var ActiveSourceEditor:TSourceEditor;
|
||||
var ActiveUnitInfo:TUnitInfo); virtual; abstract;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user