codetools: identifier completion: fixed checking parameterless procedures

git-svn-id: trunk@21023 -
This commit is contained in:
mattias 2009-07-31 14:16:40 +00:00
parent 4e8f764cea
commit 5c6c61bf25
3 changed files with 15 additions and 11 deletions

View File

@ -2497,21 +2497,29 @@ var
begin
Result:=(GetDesc=ctnProcedure);
if not Result then exit;
DebugLn(['TIdentifierListItem.IsProcNodeWithParams ',iliParamTypeListValid in Flags,' FParamList="',FParamTypeList,'"']);
if (iliParamTypeListValid in Flags) then begin
if (iliParamNameListValid in Flags) then begin
StartPos:=1;
while (StartPos<=length(FParamTypeList))
and (FParamTypeList[StartPos] in [' ',#9,'(','[']) do
inc(StartPos);
if (StartPos<=length(FParamTypeList))
and (FParamTypeList[StartPos] in [')',']',';']) then
Result:=false
exit(false)
else
Result:=true;
end else begin
ANode:=Node;
Result:=(ANode<>nil) and Tool.ProcNodeHasParamList(ANode);
exit(true);
end else if (iliParamTypeListValid in Flags) then begin
// the type list does not contain names
// so a () could be empty or (var buf)
StartPos:=1;
while (StartPos<=length(FParamTypeList))
and (FParamTypeList[StartPos] in [' ',#9,'(','[']) do
inc(StartPos);
if (StartPos<=length(FParamTypeList))
and (not (FParamTypeList[StartPos] in [')',']',';'])) then
exit(true);
end;
ANode:=Node;
Result:=(ANode<>nil) and Tool.ProcNodeHasParamList(ANode);
end;
function TIdentifierListItem.IsPropertyWithParams: boolean;

View File

@ -1889,12 +1889,10 @@ begin
// ToDo: ppu, ppw, dcu
Result:=false;
DebugLn(['TPascalReaderTool.ProcNodeHasParamList AAA1']);
if ProcNode.Desc=ctnProcedure then
ProcNode:=ProcNode.FirstChild;
MoveCursorToNodeStart(ProcNode);
ReadNextAtom; // read name
DebugLn(['TPascalReaderTool.ProcNodeHasParamList AAA2 ',getatom]);
ReadNextAtom;
if AtomIsChar('.') then begin
ReadNextAtom;

View File

@ -486,7 +486,6 @@ begin
Result:=IdentItem.Identifier;
DebugLn(['GetIdentCompletionValue ',NodeDescriptionAsString(IdentItem.GetDesc)]);
case IdentItem.GetDesc of
ctnProcedure:
@ -507,7 +506,6 @@ begin
ValueType:=icvUnitName;
end;
DebugLn(['GetIdentCompletionValue ',ord(ValueType),' ',ord(icvProcWithParams)]);
case ValueType of
icvProcWithParams: