diff --git a/components/codetools/identcompletiontool.pas b/components/codetools/identcompletiontool.pas index aa28bc7ad5..1c266fd41a 100644 --- a/components/codetools/identcompletiontool.pas +++ b/components/codetools/identcompletiontool.pas @@ -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; diff --git a/components/codetools/pascalreadertool.pas b/components/codetools/pascalreadertool.pas index f1cb91961c..d20d46a8da 100644 --- a/components/codetools/pascalreadertool.pas +++ b/components/codetools/pascalreadertool.pas @@ -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; diff --git a/ide/sourceeditprocs.pas b/ide/sourceeditprocs.pas index bbf6bb4aa4..fe3613e0ad 100644 --- a/ide/sourceeditprocs.pas +++ b/ide/sourceeditprocs.pas @@ -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: