IDE: open unit support for dotted unit names. Issue #29046

git-svn-id: trunk@53255 -
This commit is contained in:
ondrej 2016-10-28 19:52:48 +00:00
parent 0c617048fe
commit 085a9bfc83

View File

@ -1505,18 +1505,34 @@ begin
exit; exit;
end; end;
if (not Found) then begin if FIsIncludeDirective then
if FIsIncludeDirective then begin begin
if (not Found) then begin
// search include file // search include file
SearchPath:='.;'+CodeToolBoss.DefineTree.GetIncludePathForDirectory(BaseDir); SearchPath:='.;'+CodeToolBoss.DefineTree.GetIncludePathForDirectory(BaseDir);
if FindFile(SearchPath) then if FindFile(SearchPath) then // sets FFileName if result=true
Found:=true; Found:=true;
end else if FilenameIsPascalSource(FFileName) or (ExtractFileExt(FFileName)='') then end;
end else
begin
if (not Found) then
begin begin
// search pascal unit // search pascal unit without extension
AUnitName:=FFileName;
InFilename:='';
NewFilename:=CodeToolBoss.DirectoryCachePool.FindUnitSourceInCompletePath(
BaseDir,AUnitName,InFilename,true);
if NewFilename<>'' then begin
Found:=true;
FFileName:=NewFilename;
end;
end;
if (not Found) and (ExtractFileExt(FFileName)<>'') then
begin
// search pascal unit with extension
AUnitName:=ExtractFileNameOnly(FFileName); AUnitName:=ExtractFileNameOnly(FFileName);
InFilename:=FFileName; InFilename:=FFileName;
if ExtractFileExt(FFileName)='' then InFilename:='';
NewFilename:=CodeToolBoss.DirectoryCachePool.FindUnitSourceInCompletePath( NewFilename:=CodeToolBoss.DirectoryCachePool.FindUnitSourceInCompletePath(
BaseDir,AUnitName,InFilename,true); BaseDir,AUnitName,InFilename,true);
if NewFilename<>'' then begin if NewFilename<>'' then begin