diff --git a/components/codetools/directorycacher.pas b/components/codetools/directorycacher.pas index 324b047ba4..b0a0083a03 100644 --- a/components/codetools/directorycacher.pas +++ b/components/codetools/directorycacher.pas @@ -178,6 +178,7 @@ type const FileCase: TCTSearchFileCase): string; virtual; abstract; function FindIncludeFile(const IncFilename: string; AnyCase: boolean): string; virtual; abstract; function FindUnitSource(const AUnitName: string; AnyCase: boolean): string; virtual; abstract; + procedure UpdateListing; virtual; abstract; property Directory: string read FDirectory; // with trailing pathdelim property Pool: TCTDirectoryCachePool read FPool; end; @@ -232,7 +233,7 @@ type function FindIncludeFileInCleanPath(IncFilename, SearchPath: string; AnyCase: boolean): string; procedure IterateFPCUnitsInSet(const Iterate: TCTOnIterateFile); - procedure UpdateListing; + procedure UpdateListing; override; procedure WriteListing; procedure Invalidate; inline; procedure GetFiles(var Files: TStrings; IncludeDirs: boolean = true); // relative to Directory @@ -286,7 +287,7 @@ type function FindUnitSource(const AUnitName: string; AnyCase: boolean): string; override; // returns relative filename function IndexOfFileCaseInsensitive(ShortFilename: PChar): integer; override; // ascii insensitive function IndexOfFileCaseSensitive(ShortFilename: PChar): integer; override; - procedure UpdateListing; + procedure UpdateListing; override; procedure WriteListing; procedure Invalidate; inline; public diff --git a/components/codetools/identcompletiontool.pas b/components/codetools/identcompletiontool.pas index ce8fecf8a5..83067510f0 100644 --- a/components/codetools/identcompletiontool.pas +++ b/components/codetools/identcompletiontool.pas @@ -1806,7 +1806,6 @@ procedure TIdentCompletionTool.GatherUnitnames(const NameSpacePath: string); var UnitPath, SrcPath: string; - BaseDir: String; ANode: TAVLTreeNode; UnitFileInfo: TUnitFileInfo; NewItem: TUnitNameSpaceIdentifierListItem; @@ -1820,7 +1819,6 @@ begin GatherUnitAndSrcPath(UnitPath,SrcPath); CurSourceName:=GetSourceName; //DebugLn('TIdentCompletionTool.GatherUnitnames CurSourceName="',CurSourceName,'" UnitPath="',UnitPath,'" SrcPath="',SrcPath,'"'); - BaseDir:=ExtractFilePath(MainFilename); FIDTTreeOfUnitFiles:=nil; FIDTTreeOfNamespaces:=nil; try @@ -1834,7 +1832,7 @@ begin UnitExt:=PascalCompilerUnitExt[Scanner.PascalCompiler]; if Scanner.CompilerMode=cmMacPas then UnitExt:=UnitExt+';p'; - GatherUnitFiles(BaseDir,UnitPath,UnitExt,NameSpacePath,false,true,FIDTTreeOfUnitFiles, FIDTTreeOfNamespaces); + GatherUnitFiles(UnitPath,UnitExt,NameSpacePath,false,true,FIDTTreeOfUnitFiles, FIDTTreeOfNamespaces); {$IFDEF VerboseICGatherUnitNames} debugln(['TIdentCompletionTool.GatherUnitnames UnitPath ',FIDTTreeOfUnitFiles.Count]); {$ENDIF} @@ -1842,7 +1840,7 @@ begin SrcExt:=PascalCompilerSrcExt[Scanner.PascalCompiler]; if Scanner.CompilerMode=cmMacPas then SrcExt:=SrcExt+';p'; - GatherUnitFiles(BaseDir,SrcPath,SrcExt,NameSpacePath,false,true,FIDTTreeOfUnitFiles, FIDTTreeOfNamespaces); + GatherUnitFiles(SrcPath,SrcExt,NameSpacePath,false,true,FIDTTreeOfUnitFiles, FIDTTreeOfNamespaces); {$IFDEF VerboseICGatherUnitNames} debugln(['TIdentCompletionTool.GatherUnitnames Plus SrcPath ',FIDTTreeOfUnitFiles.Count]); {$ENDIF} diff --git a/ide/frames/compiler_path_options.pas b/ide/frames/compiler_path_options.pas index 4a9c736d8c..662984efac 100644 --- a/ide/frames/compiler_path_options.pas +++ b/ide/frames/compiler_path_options.pas @@ -124,8 +124,8 @@ begin CurPath := GetNextDirectoryInSearchPath(ExpandedPath, p); EndPos:=p+length(CurPath); - case ExtractFilename(CurPath) of - '*','**': CurPath:=ExtractFilePath(CurPath); // star directories + case ExtractFilename(ChompPathDelim(CurPath)) of + '*','**': CurPath:=ExtractFilePath(CHompPathDelim(CurPath)); // star directories end; // check special chars in path diff --git a/ide/packages/ideconfig/searchpathprocs.pas b/ide/packages/ideconfig/searchpathprocs.pas index bdada3733c..c4b8dfb763 100644 --- a/ide/packages/ideconfig/searchpathprocs.pas +++ b/ide/packages/ideconfig/searchpathprocs.pas @@ -763,6 +763,7 @@ begin if Dir='' then break; Cache:=CodeToolBoss.DirectoryCachePool.GetBaseCache(Dir); if Cache=nil then continue; + Cache.UpdateListing; if Cache is TCTStarDirectoryCache then begin StarCache:=TCTStarDirectoryCache(Cache); diff --git a/ide/patheditordlg.pas b/ide/patheditordlg.pas index 5ed3b2e591..fdcb08dd31 100644 --- a/ide/patheditordlg.pas +++ b/ide/patheditordlg.pas @@ -233,6 +233,7 @@ begin if TTransferMacroList.StrHasMacros(APath) then Exit(TObject(1)); Result:=TObject(0); + APath:=ChompPathDelim(APath); if (FEffectiveBaseDirectory<>'') and FilenameIsAbsolute(FEffectiveBaseDirectory) then APath:=CreateAbsolutePath(APath, FEffectiveBaseDirectory);