mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-06-05 13:58:17 +02:00
codetools: code completion: add proc for procvar: fixed reference-to
git-svn-id: trunk@54692 -
This commit is contained in:
parent
3ca49ceb2b
commit
e96ede4637
@ -1550,6 +1550,8 @@ begin
|
||||
MethodDefinition:=TrimCodeSpace(
|
||||
ProcContext.Tool.ExtractProcHead(ProcContext.Node,
|
||||
MethodAttr+[phpWithoutClassName,phpWithoutName]));
|
||||
if MethodDefinition='' then
|
||||
RaiseException(20170422200434,'unknown proctype '+ProcContext.Node.DescAsString);
|
||||
MethodDefinition:=Beauty.AddClassAndNameToProc(MethodDefinition, '', NewProcName);
|
||||
debugln(['TCodeCompletionCodeTool.AddProcedureCompatibleToProcType MethodDefinition="',MethodDefinition,'"']);
|
||||
|
||||
@ -2210,7 +2212,8 @@ begin
|
||||
Params);
|
||||
if not Result then exit;
|
||||
|
||||
if ProcContext.Tool.ProcNodeHasOfObject(ProcContext.Node) then begin
|
||||
if ((AClassNode<>nil) and (ProcContext.Node.Desc=ctnReferenceTo))
|
||||
or ProcContext.Tool.ProcNodeHasOfObject(ProcContext.Node) then begin
|
||||
if AClassNode<>nil then begin
|
||||
{$IFDEF VerboseCompleteEventAssign}
|
||||
DebugLn(' CompleteEventAssignment: CreateEventFullName... UserEventAtom.StartPos=',dbgs(UserEventAtom.StartPos));
|
||||
|
@ -4657,7 +4657,8 @@ end;
|
||||
|
||||
function TPascalParserTool.KeyWordFuncTypeReferenceTo: boolean;
|
||||
begin
|
||||
if cmsBlocks in Scanner.CompilerModeSwitches then begin
|
||||
if (cmsBlocks in Scanner.CompilerModeSwitches)
|
||||
or (Scanner.PascalCompiler=pcPas2js) then begin
|
||||
CreateChildNode;
|
||||
CurNode.Desc:=ctnReferenceTo;
|
||||
if not ReadNextUpAtomIs('TO') then
|
||||
|
@ -613,6 +613,10 @@ begin
|
||||
ProcNode:=ProcNode.Parent;
|
||||
if ProcNode=nil then exit;
|
||||
end;
|
||||
if ProcNode.Desc=ctnReferenceTo then begin
|
||||
ProcNode:=ProcNode.FirstChild;
|
||||
if ProcNode=nil then exit;
|
||||
end;
|
||||
if ProcNode.Desc=ctnProcedure then
|
||||
IsProcType:=false
|
||||
else if ProcNode.Desc=ctnProcedureType then
|
||||
|
@ -1896,6 +1896,9 @@ var
|
||||
Level: Integer;
|
||||
begin
|
||||
Result:='';
|
||||
{$IFDEF VerboseAddClassAndNameToProc}
|
||||
debugln(['TBeautifyCodeOptions.AddClassAndNameToProc AProcCode="',AProcCode,'" AClassName="',AClassName,'" AMethodName="',AMethodName,'"']);
|
||||
{$ENDIF}
|
||||
p:=1;
|
||||
ProcLen:=length(AProcCode);
|
||||
// read proc keyword 'procedure', 'function', ...
|
||||
|
Loading…
Reference in New Issue
Block a user