mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-12 22:39:14 +02: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,
|
||||
phpWithoutClassKeyword,
|
||||
phpWithVarModifiers,phpWithParameterNames,phpWithResultType,
|
||||
phpWithCallingSpecs,phpDoNotAddSemicolon]);
|
||||
phpWithProcModifiers,phpDoNotAddSemicolon]);
|
||||
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;
|
||||
if not ASourceChangeCache.Replace(gtNone,gtNone,
|
||||
CurPos.EndPos,CurPos.EndPos,';') then
|
||||
|
@ -423,6 +423,11 @@ begin
|
||||
ExtractNextAtom(phpWithResultType in Attr,Attr);
|
||||
if not AtomIsIdentifier(false) then exit;
|
||||
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;
|
||||
end;
|
||||
// read 'of object'
|
||||
@ -676,7 +681,14 @@ begin
|
||||
if (CurPos.Flag=cafColon) then begin
|
||||
// read function result type
|
||||
ReadNextAtom;
|
||||
if AtomIsIdentifier(false) then begin
|
||||
ReadNextAtom;
|
||||
if CurPos.Flag=cafPoint then begin
|
||||
ReadNextAtom;
|
||||
if AtomIsIdentifier(false) then
|
||||
ReadNextAtom;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
// CurPos now stands on the first proc specifier or on a semicolon
|
||||
end;
|
||||
|
Loading…
Reference in New Issue
Block a user