mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-29 09:50:31 +02:00
codetools: identifier completion: fixed checking parameterless procedures
git-svn-id: trunk@21023 -
This commit is contained in:
parent
4e8f764cea
commit
5c6c61bf25
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user