mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-11-02 13:19:49 +01:00
codetools: identifier completion: no semicolon outside of statements
git-svn-id: trunk@16669 -
This commit is contained in:
parent
a58a097488
commit
d7a960e8ba
@ -1537,26 +1537,28 @@ begin
|
||||
MoveCursorToCleanPos(IdentEndPos);
|
||||
ReadNextAtom;
|
||||
CurrentIdentifierList.StartAtomBehind:=CurPos;
|
||||
// check if a semicolon is needed at the end
|
||||
if (CurrentIdentifierList.StartBracketLvl>0)
|
||||
or (CurPos.Flag in [cafSemicolon, cafEqual, cafColon, cafComma,
|
||||
cafPoint, cafRoundBracketOpen, cafRoundBracketClose,
|
||||
cafEdgedBracketOpen, cafEdgedBracketClose])
|
||||
or ((CurPos.Flag=cafWord)
|
||||
and (UpAtomIs('ELSE')
|
||||
or UpAtomIs('THEN')
|
||||
or UpAtomIs('DO')
|
||||
or UpAtomIs('TO')
|
||||
or UpAtomIs('OF')))
|
||||
then begin
|
||||
// do not add semicolon
|
||||
CurrentIdentifierList.ContextFlags:=
|
||||
CurrentIdentifierList.ContextFlags+[ilcfNoEndSemicolon];
|
||||
end;
|
||||
// check if in statement
|
||||
if (ilcfStartInStatement in CurrentIdentifierList.ContextFlags) then
|
||||
begin
|
||||
// check if a semicolon is needed at the end
|
||||
if (CurrentIdentifierList.StartBracketLvl>0)
|
||||
or (CurPos.Flag in [cafSemicolon, cafEqual, cafColon, cafComma,
|
||||
cafPoint, cafRoundBracketOpen, cafRoundBracketClose,
|
||||
cafEdgedBracketOpen, cafEdgedBracketClose])
|
||||
or ((CurPos.Flag=cafWord)
|
||||
and (UpAtomIs('ELSE')
|
||||
or UpAtomIs('THEN')
|
||||
or UpAtomIs('DO')
|
||||
or UpAtomIs('TO')
|
||||
or UpAtomIs('OF')))
|
||||
then begin
|
||||
// do not add semicolon
|
||||
CurrentIdentifierList.ContextFlags:=
|
||||
CurrentIdentifierList.ContextFlags+[ilcfNoEndSemicolon];
|
||||
end
|
||||
else if (not (ilcfStartIsLValue in CurrentIdentifierList.ContextFlags))
|
||||
if (not (ilcfNoEndSemicolon in CurrentIdentifierList.ContextFlags))
|
||||
and (not (ilcfStartIsLValue in CurrentIdentifierList.ContextFlags))
|
||||
then begin
|
||||
// check if a semicolon is needed at the end
|
||||
if (CurPos.Flag in [cafEnd,cafBegin])
|
||||
|
||||
Loading…
Reference in New Issue
Block a user