codetools: identifier completion: unit name of self

git-svn-id: trunk@37071 -
This commit is contained in:
mattias 2012-04-28 20:42:57 +00:00
parent 122d9d1daa
commit 5b0d16c0df
2 changed files with 10 additions and 1 deletions

View File

@ -2917,7 +2917,8 @@ var
begin
// identifier found
{$IFDEF ShowTriedIdentifiers}
DebugLn(' Source Name Identifier found="',GetIdentifier(Params.Identifier),'"');
if not (fdfCollect in Params.Flags) then
DebugLn(' Source Name Identifier found="',GetIdentifier(Params.Identifier),'"');
{$ENDIF}
Params.SetResult(Self,SrcNode,CurPos.StartPos);
Result:=CheckResult(true,true);

View File

@ -865,6 +865,7 @@ var
Node: TCodeTreeNode;
ProtectedForeignClass: Boolean;
Lvl: LongInt;
NamePos: TAtomPosition;
begin
// proceed searching ...
Result:=ifrProceedSearch;
@ -1003,6 +1004,12 @@ begin
if (FoundContext.Tool=Self) then begin
Ident:=@Src[FoundContext.Node.StartPos];
end;
ctnUnit,ctnProgram,ctnLibrary,ctnPackage:
if (FoundContext.Tool=Self)
and GetSourceNamePos(NamePos) then
Ident:=@Src[NamePos.StartPos];
end;
if Ident=nil then exit;
@ -1021,6 +1028,7 @@ begin
end;
{$IFDEF ShowFoundIdents}
if FoundContext.Tool=Self then
DebugLn(' IDENT COLLECTED: ',NewItem.AsString);
{$ENDIF}