mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-12-09 19:57:45 +01:00
codetools: fixed PositionInFuncResultName, bug #11395
git-svn-id: trunk@21434 -
This commit is contained in:
parent
3de1c4be95
commit
901245e1af
@ -3635,12 +3635,15 @@ var
|
||||
Node: TCodeTreeNode;
|
||||
begin
|
||||
Result:=false;
|
||||
if (NewNode.Desc=ctnProcedureHead)
|
||||
if (NewNode.Desc in [ctnProcedureHead,ctnIdentifier])
|
||||
and PositionInFuncResultName(NewNode,CleanPos) then begin
|
||||
Node:=NewNode.FirstChild;
|
||||
if Node=nil then exit;
|
||||
if Node.Desc=ctnParameterList then Node:=Node.NextBrother;
|
||||
if Node=nil then exit;
|
||||
Node:=NewNode;
|
||||
if Node.Desc=ctnProcedureHead then begin
|
||||
Node:=Node.FirstChild;
|
||||
if Node=nil then exit;
|
||||
if Node.Desc=ctnParameterList then Node:=Node.NextBrother;
|
||||
if Node=nil then exit;
|
||||
end;
|
||||
if Node.Desc in [ctnVarDefinition,ctnIdentifier] then begin
|
||||
// return the function result type or the operator variable name
|
||||
NewNode:=Node;
|
||||
|
||||
@ -849,6 +849,12 @@ begin
|
||||
ProcNode:=ProcNode.FirstChild;
|
||||
if ProcNode=nil then exit;
|
||||
end;
|
||||
if (ProcNode.Desc in [ctnIdentifier,ctnVarDefinition])
|
||||
and (ProcNode.Parent<>nil)
|
||||
and (ProcNode.Parent.Desc=ctnProcedureHead)
|
||||
and (CleanPos>=ProcNode.StartPos) and (CleanPos<=ProcNode.EndPos) then begin
|
||||
exit(true);
|
||||
end;
|
||||
// read behind parameter list
|
||||
if ProcNode.Desc<>ctnProcedureHead then exit;
|
||||
if (ProcNode.FirstChild<>nil) and (ProcNode.FirstChild.Desc=ctnParameterList)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user