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 begin
Result:=(GetDesc=ctnProcedure); Result:=(GetDesc=ctnProcedure);
if not Result then exit; if not Result then exit;
DebugLn(['TIdentifierListItem.IsProcNodeWithParams ',iliParamTypeListValid in Flags,' FParamList="',FParamTypeList,'"']); if (iliParamNameListValid in Flags) then begin
if (iliParamTypeListValid in Flags) then begin
StartPos:=1; StartPos:=1;
while (StartPos<=length(FParamTypeList)) while (StartPos<=length(FParamTypeList))
and (FParamTypeList[StartPos] in [' ',#9,'(','[']) do and (FParamTypeList[StartPos] in [' ',#9,'(','[']) do
inc(StartPos); inc(StartPos);
if (StartPos<=length(FParamTypeList)) if (StartPos<=length(FParamTypeList))
and (FParamTypeList[StartPos] in [')',']',';']) then and (FParamTypeList[StartPos] in [')',']',';']) then
Result:=false exit(false)
else else
Result:=true; exit(true);
end else begin end else if (iliParamTypeListValid in Flags) then begin
ANode:=Node; // the type list does not contain names
Result:=(ANode<>nil) and Tool.ProcNodeHasParamList(ANode); // 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; end;
ANode:=Node;
Result:=(ANode<>nil) and Tool.ProcNodeHasParamList(ANode);
end; end;
function TIdentifierListItem.IsPropertyWithParams: boolean; function TIdentifierListItem.IsPropertyWithParams: boolean;

View File

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

View File

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