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

View File

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