IDE: find/rename identifier: ignore missing files

git-svn-id: trunk@27588 -
This commit is contained in:
mattias 2010-10-06 17:42:01 +00:00
parent 62165a2e64
commit d7dc05a36a
2 changed files with 11 additions and 2 deletions

View File

@ -55,7 +55,8 @@ type
lbfRevert,
lbfCheckIfText,
lbfQuiet,
lbfCreateClearOnError
lbfCreateClearOnError,
lbfIgnoreMissing
);
TLoadBufferFlags = set of TLoadBufferFlag;
@ -189,6 +190,8 @@ begin
ACodeBuffer:=nil;
if not FilenameIsAbsolute(AFilename) then
Flags:=Flags-[lbfUpdateFromDisk,lbfRevert];
if lbfCreateClearOnError in Flags then
Exclude(Flags,lbfIgnoreMissing);
if [lbfUpdateFromDisk,lbfRevert]*Flags=[] then begin
// can use cache
ACodeBuffer:=CodeToolBoss.LoadFile(AFilename,false,false);
@ -225,6 +228,12 @@ begin
if ACodeBuffer<>nil then begin
Result:=mrOk;
end else begin
// read error
if lbfIgnoreMissing in Flags then begin
if (FilenameIsAbsolute(AFilename) and not FileExistsCached(AFilename))
then
exit(mrIgnore);
end;
if lbfQuiet in Flags then
Result:=mrCancel
else begin

View File

@ -178,7 +178,7 @@ begin
for i:=0 to Files.Count-1 do begin
//debugln(['GatherIdentifierReferences ',Files[i]]);
LoadResult:=
LoadCodeBuffer(Code,Files[i],[lbfCheckIfText,lbfUpdateFromDisk],true);
LoadCodeBuffer(Code,Files[i],[lbfCheckIfText,lbfUpdateFromDisk,lbfIgnoreMissing],true);
if LoadResult=mrAbort then begin
debugln('GatherIdentifierReferences unable to load "',Files[i],'"');
exit;