mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-01 17:21:03 +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
|
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;
|
||||||
|
@ -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;
|
||||||
|
@ -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:
|
||||||
|
Loading…
Reference in New Issue
Block a user