From 59077ba01624719d344aeac466466286028d5b6f Mon Sep 17 00:00:00 2001 From: mattias Date: Thu, 31 Jan 2008 13:53:10 +0000 Subject: [PATCH] codetools: fixed code completion for semicolons after procs bugs #10741 git-svn-id: trunk@13937 - --- components/codetools/codecompletiontool.pas | 13 +++++++++++-- components/codetools/pascalreadertool.pas | 14 +++++++++++++- 2 files changed, 24 insertions(+), 3 deletions(-) diff --git a/components/codetools/codecompletiontool.pas b/components/codetools/codecompletiontool.pas index 0d97c157eb..36aeb43e10 100644 --- a/components/codetools/codecompletiontool.pas +++ b/components/codetools/codecompletiontool.pas @@ -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