mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-11-20 19:19:31 +01:00
codetools: fixed code completion for semicolons after procs bugs #10741
git-svn-id: trunk@13937 -
This commit is contained in:
parent
a740c37d9c
commit
59077ba016
@ -4955,9 +4955,18 @@ begin
|
|||||||
ProcCode:=ExtractProcHead(ANode,[phpWithStart,
|
ProcCode:=ExtractProcHead(ANode,[phpWithStart,
|
||||||
phpWithoutClassKeyword,
|
phpWithoutClassKeyword,
|
||||||
phpWithVarModifiers,phpWithParameterNames,phpWithResultType,
|
phpWithVarModifiers,phpWithParameterNames,phpWithResultType,
|
||||||
phpWithCallingSpecs,phpDoNotAddSemicolon]);
|
phpWithProcModifiers,phpDoNotAddSemicolon]);
|
||||||
if ProcCode[length(ProcCode)]<>';' then begin
|
if ProcCode[length(ProcCode)]<>';' then begin
|
||||||
// add missing semicolon
|
// add missing semicolon at end of procedure head
|
||||||
|
UndoReadNextAtom;
|
||||||
|
if not ASourceChangeCache.Replace(gtNone,gtNone,
|
||||||
|
CurPos.EndPos,CurPos.EndPos,';') then
|
||||||
|
RaiseException('InsertMissingClassSemicolons: unable to insert semicolon');
|
||||||
|
end;
|
||||||
|
MoveCursorToFirstProcSpecifier(ANode);
|
||||||
|
if (CurPos.Flag<>cafSemicolon) and (CurPos.EndPos<ANode.FirstChild.EndPos)
|
||||||
|
then begin
|
||||||
|
// add missing semicolon in front of proc modifiers
|
||||||
UndoReadNextAtom;
|
UndoReadNextAtom;
|
||||||
if not ASourceChangeCache.Replace(gtNone,gtNone,
|
if not ASourceChangeCache.Replace(gtNone,gtNone,
|
||||||
CurPos.EndPos,CurPos.EndPos,';') then
|
CurPos.EndPos,CurPos.EndPos,';') then
|
||||||
|
|||||||
@ -423,6 +423,11 @@ begin
|
|||||||
ExtractNextAtom(phpWithResultType in Attr,Attr);
|
ExtractNextAtom(phpWithResultType in Attr,Attr);
|
||||||
if not AtomIsIdentifier(false) then exit;
|
if not AtomIsIdentifier(false) then exit;
|
||||||
ExtractNextAtom(phpWithResultType in Attr,Attr);
|
ExtractNextAtom(phpWithResultType in Attr,Attr);
|
||||||
|
if CurPos.Flag=cafPoint then begin
|
||||||
|
ExtractNextAtom(phpWithResultType in Attr,Attr);
|
||||||
|
if not AtomIsIdentifier(false) then exit;
|
||||||
|
ExtractNextAtom(phpWithResultType in Attr,Attr);
|
||||||
|
end;
|
||||||
ExtractProcHeadPos:=phepResultType;
|
ExtractProcHeadPos:=phepResultType;
|
||||||
end;
|
end;
|
||||||
// read 'of object'
|
// read 'of object'
|
||||||
@ -676,7 +681,14 @@ begin
|
|||||||
if (CurPos.Flag=cafColon) then begin
|
if (CurPos.Flag=cafColon) then begin
|
||||||
// read function result type
|
// read function result type
|
||||||
ReadNextAtom;
|
ReadNextAtom;
|
||||||
ReadNextAtom;
|
if AtomIsIdentifier(false) then begin
|
||||||
|
ReadNextAtom;
|
||||||
|
if CurPos.Flag=cafPoint then begin
|
||||||
|
ReadNextAtom;
|
||||||
|
if AtomIsIdentifier(false) then
|
||||||
|
ReadNextAtom;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
// CurPos now stands on the first proc specifier or on a semicolon
|
// CurPos now stands on the first proc specifier or on a semicolon
|
||||||
end;
|
end;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user