mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-28 15:20:49 +02:00
IDE+codetools: added heuristic to add := on identifier completion
git-svn-id: trunk@12348 -
This commit is contained in:
parent
7f32d1a1d3
commit
23cb06a031
@ -1393,14 +1393,13 @@ begin
|
||||
if (ilcfStartInStatement in CurrentIdentifierList.ContextFlags) then
|
||||
begin
|
||||
if (CurPos.Flag in [cafSemicolon,cafBegin,cafEnd])
|
||||
or WordIsBlockKeyWord.DoItUpperCase(UpperSrc,
|
||||
CurPos.StartPos,CurPos.EndPos-CurPos.StartPos)
|
||||
or UpAtomIs('TRY') or UpAtomIs('FOR') or UpAtomIs('DO')
|
||||
then begin
|
||||
CurrentIdentifierList.ContextFlags:=
|
||||
CurrentIdentifierList.ContextFlags+[ilcfStartIsLValue];
|
||||
end;
|
||||
if UpAtomIs('IF') or UpAtomIs('FOR') or UpAtomIs('DO')
|
||||
or UpAtomIs('CASE') or UpAtomIs('OF') then begin
|
||||
or UpAtomIs('CASE') or UpAtomIs('OF') or UpAtomIs('WHILE') then begin
|
||||
CurrentIdentifierList.ContextFlags:=
|
||||
CurrentIdentifierList.ContextFlags+[ilcfIsExpression];
|
||||
end;
|
||||
|
@ -36,7 +36,7 @@ interface
|
||||
uses
|
||||
Classes, SysUtils, LCLProc, LCLType, GraphType, Graphics, Controls,
|
||||
SynEdit, SynRegExpr, SynCompletion,
|
||||
BasicCodeTools, CodeTree, CodeAtom, CodeCache, CodeToolManager,
|
||||
BasicCodeTools, CodeTree, CodeAtom, CodeCache, SourceChanger, CodeToolManager,
|
||||
PascalParserTool, KeywordFuncLists, FileProcs, IdentCompletionTool,
|
||||
LazIDEIntf, TextTools, IDETextConverter,
|
||||
DialogProcs, MainIntf, EditorOptions, CodeToolsOptions;
|
||||
@ -507,6 +507,15 @@ begin
|
||||
CursorAtEnd:=false;
|
||||
end;}
|
||||
|
||||
if (ilcfStartIsLValue in IdentList.ContextFlags) then begin
|
||||
if (atIdentifier in CodeToolsOpts.DoInsertSpaceAfter)
|
||||
or (atSymbol in CodeToolsOpts.DoInsertSpaceInFront) then
|
||||
Result:=Result+' ';
|
||||
Result:=Result+':=';
|
||||
if (atSymbol in CodeToolsOpts.DoInsertSpaceAfter) then
|
||||
Result:=Result+' ';
|
||||
end;
|
||||
|
||||
if AddChar<>'' then
|
||||
Result:=Result+AddChar;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user