mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-14 13:59:34 +02:00
codetools: code creation support in a parameter of procedure variables.
git-svn-id: trunk@50308 -
This commit is contained in:
parent
82018334bb
commit
fb34c4b45f
@ -2483,6 +2483,18 @@ begin
|
||||
MissingUnitName:='';
|
||||
if Params.NewNode=nil then exit;
|
||||
//DebugLn('TCodeCompletionCodeTool.CompleteLocalVariableAsParameter Proc/PropNode=',Params.NewNode.DescAsString,' ',copy(Params.NewCodeTool.Src,Params.NewNode.StartPos,50));
|
||||
|
||||
if Params.NewNode.Desc=ctnVarDefinition then
|
||||
begin
|
||||
try
|
||||
ExprType:=Params.NewCodeTool.ConvertNodeToExpressionType(Params.NewNode,Params);
|
||||
if (ExprType.Desc=xtContext) and (ExprType.Context.Node<>nil) then begin
|
||||
Params.NewCodeTool:=ExprType.Context.Tool;
|
||||
Params.NewNode:=ExprType.Context.Node;
|
||||
end;
|
||||
except
|
||||
end;
|
||||
end;
|
||||
ParameterNode:=Params.NewCodeTool.FindNthParameterNode(Params.NewNode,
|
||||
ParameterIndex);
|
||||
if (ParameterNode=nil)
|
||||
|
@ -10874,7 +10874,7 @@ begin
|
||||
{$IFDEF CheckNodeTool}CheckNodeTool(Node);{$ENDIF}
|
||||
Result:=nil;
|
||||
if Node=nil then exit;
|
||||
if Node.Desc in [ctnProcedure] then begin
|
||||
if Node.Desc in [ctnProcedure,ctnProcedureType] then begin
|
||||
ProcNode:=Node;
|
||||
//DebugLn(' FindNthParameterNode ProcNode="',copy(Params.NewCodeTool.Src,ProcNode.StartPos,ProcNode.EndPos-ProcNode.StartPos),'"');
|
||||
FunctionNode:=nil;
|
||||
|
@ -5820,7 +5820,7 @@ procedure TPascalParserTool.BuildSubTreeForProcHead(ProcNode: TCodeTreeNode;
|
||||
begin
|
||||
if ProcNode.Desc=ctnProcedureHead then
|
||||
ProcNode:=ProcNode.Parent;
|
||||
if ProcNode.Desc<>ctnProcedure then
|
||||
if not(ProcNode.Desc in [ctnProcedure,ctnProcedureType]) then
|
||||
RaiseException('INTERNAL ERROR: TPascalParserTool.BuildSubTreeForProcHead with FunctionResult');
|
||||
BuildSubTreeForProcHead(ProcNode);
|
||||
FunctionResult:=ProcNode.FirstChild.FirstChild;
|
||||
|
Loading…
Reference in New Issue
Block a user