codetools: completeblock debugging

git-svn-id: trunk@35002 -
This commit is contained in:
mattias 2012-01-28 18:39:54 +00:00
parent 00ccb9351a
commit 197ac89ba8
2 changed files with 20 additions and 0 deletions

View File

@ -5467,6 +5467,9 @@ var
exit;
end;
AtomInFrontOfCursor:=LastAtoms.GetValueAt(0);
{$IFDEF VerboseCompleteBlock}
DebugLn(['ReadStatements reached cursor: ',CleanPosToStr(CurPos.StartPos),' CursorBlockOuterIndent=',CursorBlockOuterIndent,' CursorBlockInnerIndent=',CursorBlockInnerIndent,' LastAtom=',GetAtom(AtomInFrontOfCursor),' CurAtom=',GetAtom]);
{$ENDIF}
if (CurPos.Flag=cafSemicolon)
and ((AtomInFrontOfCursor.Flag=cafSemicolon)
or (CursorBlock.StartPos=AtomInFrontOfCursor.StartPos))

View File

@ -131,6 +131,16 @@ end;
procedure TTestCodetoolsCompleteBlock.TestCompleteBlockClassStart;
begin
{ Not implemented yet:
CompleteBlock('procedure a;'+LineEnding
+'begin|'+LineEnding
+'begin'+LineEnding
+'end.',
'procedure a;'+LineEnding
+'begin|'+LineEnding
+'end;'+LineEnding
+'begin'+LineEnding
+'end.');}
CompleteBlock('type'+LineEnding
+' TTestClass = class(TObject)|',
'type'+LineEnding
@ -181,6 +191,13 @@ begin
+' case of|'+LineEnding
+' end;'+LineEnding
+'end.');
CompleteBlock('begin'+LineEnding
+' case of|'+LineEnding
+'end.',
'begin'+LineEnding
+' case of|'+LineEnding
+' end;'+LineEnding
+'end.');
end;
initialization