mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-02 01:00:22 +02:00
Merge branch 'CCList_Keywords'
Keywords in Code Completion list, when auto invoke See merge request freepascal.org/lazarus/lazarus!51
This commit is contained in:
commit
8229111e5f
@ -140,6 +140,8 @@ type
|
|||||||
FPascalTools: TAVLTree; // tree of TCustomCodeTool sorted TCustomCodeTool(Data).Scanner.MainCode
|
FPascalTools: TAVLTree; // tree of TCustomCodeTool sorted TCustomCodeTool(Data).Scanner.MainCode
|
||||||
FTabWidth: integer;
|
FTabWidth: integer;
|
||||||
FUseTabs: boolean;
|
FUseTabs: boolean;
|
||||||
|
FIdentComplAutoInvokeOnType: Boolean;
|
||||||
|
FIdentComplIncludeKeywords: Boolean;
|
||||||
FVisibleEditorLines: integer;
|
FVisibleEditorLines: integer;
|
||||||
FWriteExceptions: boolean;
|
FWriteExceptions: boolean;
|
||||||
FWriteLockCount: integer;// Set/Unset counter
|
FWriteLockCount: integer;// Set/Unset counter
|
||||||
@ -324,6 +326,8 @@ type
|
|||||||
read FVisibleEditorLines write SetVisibleEditorLines;
|
read FVisibleEditorLines write SetVisibleEditorLines;
|
||||||
property TabWidth: integer read FTabWidth write SetTabWidth;
|
property TabWidth: integer read FTabWidth write SetTabWidth;
|
||||||
property UseTabs: boolean read FUseTabs write SetUseTabs;
|
property UseTabs: boolean read FUseTabs write SetUseTabs;
|
||||||
|
property IdentComplAutoInvokeOnType: Boolean read FIdentComplAutoInvokeOnType write FIdentComplAutoInvokeOnType;
|
||||||
|
property IdentComplIncludeKeywords: Boolean read FIdentComplIncludeKeywords write FIdentComplIncludeKeywords;
|
||||||
property CompleteProperties: boolean
|
property CompleteProperties: boolean
|
||||||
read FCompleteProperties write SetCompleteProperties;
|
read FCompleteProperties write SetCompleteProperties;
|
||||||
property AddInheritedCodeToOverrideMethod: boolean
|
property AddInheritedCodeToOverrideMethod: boolean
|
||||||
@ -2514,6 +2518,7 @@ begin
|
|||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
try
|
try
|
||||||
FIdentifierListUpdating:=true;
|
FIdentifierListUpdating:=true;
|
||||||
|
IdentifierList.IdentComplIncludeKeywords := IdentComplIncludeKeywords;
|
||||||
try
|
try
|
||||||
Result:=FCurCodeTool.GatherIdentifiers(CursorPos,IdentifierList);
|
Result:=FCurCodeTool.GatherIdentifiers(CursorPos,IdentifierList);
|
||||||
finally
|
finally
|
||||||
|
@ -230,6 +230,7 @@ type
|
|||||||
TIdentifierList = class
|
TIdentifierList = class
|
||||||
private
|
private
|
||||||
FContext: TFindContext;
|
FContext: TFindContext;
|
||||||
|
FIdentComplIncludeKeywords: Boolean;
|
||||||
FNewMemberVisibility: TCodeTreeNodeDesc;
|
FNewMemberVisibility: TCodeTreeNodeDesc;
|
||||||
FContextFlags: TIdentifierListContextFlags;
|
FContextFlags: TIdentifierListContextFlags;
|
||||||
FOnGatherUserIdentifiersToFilteredList: TOnGatherUserIdentifiersToFilteredList;
|
FOnGatherUserIdentifiersToFilteredList: TOnGatherUserIdentifiersToFilteredList;
|
||||||
@ -296,6 +297,7 @@ type
|
|||||||
property StartContextPos: TCodeXYPosition
|
property StartContextPos: TCodeXYPosition
|
||||||
read FStartContextPos write FStartContextPos;
|
read FStartContextPos write FStartContextPos;
|
||||||
property ContainsFilter: Boolean read FContainsFilter write FContainsFilter;
|
property ContainsFilter: Boolean read FContainsFilter write FContainsFilter;
|
||||||
|
property IdentComplIncludeKeywords: Boolean read FIdentComplIncludeKeywords write FIdentComplIncludeKeywords;
|
||||||
property OnGatherUserIdentifiersToFilteredList: TOnGatherUserIdentifiersToFilteredList
|
property OnGatherUserIdentifiersToFilteredList: TOnGatherUserIdentifiersToFilteredList
|
||||||
read FOnGatherUserIdentifiersToFilteredList write FOnGatherUserIdentifiersToFilteredList;
|
read FOnGatherUserIdentifiersToFilteredList write FOnGatherUserIdentifiersToFilteredList;
|
||||||
end;
|
end;
|
||||||
@ -419,7 +421,7 @@ type
|
|||||||
procedure GatherUnitnames(const NameSpacePath: string = '');
|
procedure GatherUnitnames(const NameSpacePath: string = '');
|
||||||
procedure GatherSourceNames(const Context: TFindContext);
|
procedure GatherSourceNames(const Context: TFindContext);
|
||||||
procedure GatherContextKeywords(const Context: TFindContext;
|
procedure GatherContextKeywords(const Context: TFindContext;
|
||||||
CleanPos: integer; BeautifyCodeOptions: TBeautifyCodeOptions);
|
CleanPos: integer; BeautifyCodeOptions: TBeautifyCodeOptions; const GatherContext: TFindContext);
|
||||||
procedure GatherUserIdentifiers(const ContextFlags: TIdentifierListContextFlags);
|
procedure GatherUserIdentifiers(const ContextFlags: TIdentifierListContextFlags);
|
||||||
procedure InitCollectIdentifiers(const CursorPos: TCodeXYPosition;
|
procedure InitCollectIdentifiers(const CursorPos: TCodeXYPosition;
|
||||||
var IdentifierList: TIdentifierList);
|
var IdentifierList: TIdentifierList);
|
||||||
@ -1781,7 +1783,7 @@ end;
|
|||||||
|
|
||||||
procedure TIdentCompletionTool.GatherContextKeywords(
|
procedure TIdentCompletionTool.GatherContextKeywords(
|
||||||
const Context: TFindContext; CleanPos: integer;
|
const Context: TFindContext; CleanPos: integer;
|
||||||
BeautifyCodeOptions: TBeautifyCodeOptions);
|
BeautifyCodeOptions: TBeautifyCodeOptions; const GatherContext: TFindContext);
|
||||||
type
|
type
|
||||||
TPropertySpecifier = (
|
TPropertySpecifier = (
|
||||||
psIndex,psRead,psWrite,psStored,psImplements,psDefault,psNoDefault
|
psIndex,psRead,psWrite,psStored,psImplements,psDefault,psNoDefault
|
||||||
@ -1890,6 +1892,7 @@ var
|
|||||||
Node, SubNode, NodeInFront: TCodeTreeNode;
|
Node, SubNode, NodeInFront: TCodeTreeNode;
|
||||||
p, AtomStartPos, AtomEndPos: Integer;
|
p, AtomStartPos, AtomEndPos: Integer;
|
||||||
NodeBehind, LastChild: TCodeTreeNode;
|
NodeBehind, LastChild: TCodeTreeNode;
|
||||||
|
NotStartOfOp: Boolean;
|
||||||
begin
|
begin
|
||||||
try
|
try
|
||||||
AtomStartPos:=CleanPos;
|
AtomStartPos:=CleanPos;
|
||||||
@ -1994,6 +1997,7 @@ begin
|
|||||||
Add('type');
|
Add('type');
|
||||||
Add('var');
|
Add('var');
|
||||||
Add('const');
|
Add('const');
|
||||||
|
Add('label');
|
||||||
Add('procedure');
|
Add('procedure');
|
||||||
Add('function');
|
Add('function');
|
||||||
Add('resourcestring');
|
Add('resourcestring');
|
||||||
@ -2024,8 +2028,14 @@ begin
|
|||||||
Add('type');
|
Add('type');
|
||||||
Add('var');
|
Add('var');
|
||||||
Add('const');
|
Add('const');
|
||||||
|
Add('label');
|
||||||
Add('procedure');
|
Add('procedure');
|
||||||
Add('function');
|
Add('function');
|
||||||
|
if not (ilcfDontAllowProcedures in CurrentIdentifierList.ContextFlags)
|
||||||
|
and (ilcfStartOfOperand in CurrentIdentifierList.ContextFlags)
|
||||||
|
then begin
|
||||||
|
Add('asm');
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
ctnProcedureHead:
|
ctnProcedureHead:
|
||||||
@ -2060,6 +2070,11 @@ begin
|
|||||||
if (Node.Desc=ctnRecordType) or (Node.Parent.Desc=ctnRecordType) then begin
|
if (Node.Desc=ctnRecordType) or (Node.Parent.Desc=ctnRecordType) then begin
|
||||||
Add('case');
|
Add('case');
|
||||||
end;
|
end;
|
||||||
|
end
|
||||||
|
else
|
||||||
|
if Node.Parent.Desc = ctnOnBlock then
|
||||||
|
begin
|
||||||
|
Add('do');
|
||||||
end;
|
end;
|
||||||
|
|
||||||
ctnTypeSection,ctnVarSection,ctnConstSection,ctnLabelSection,ctnResStrSection,
|
ctnTypeSection,ctnVarSection,ctnConstSection,ctnLabelSection,ctnResStrSection,
|
||||||
@ -2069,6 +2084,7 @@ begin
|
|||||||
Add('const');
|
Add('const');
|
||||||
Add('var');
|
Add('var');
|
||||||
Add('resourcestring');
|
Add('resourcestring');
|
||||||
|
Add('label');
|
||||||
Add('procedure');
|
Add('procedure');
|
||||||
Add('function');
|
Add('function');
|
||||||
Add('property');
|
Add('property');
|
||||||
@ -2079,6 +2095,81 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
ctnWithVariable, ctnOnBlock:
|
||||||
|
begin
|
||||||
|
Add('do');
|
||||||
|
end;
|
||||||
|
|
||||||
|
ctnBeginBlock,ctnWithStatement,ctnOnStatement:
|
||||||
|
//ctnInitialization,ctnFinalization: //AllPascalStatements
|
||||||
|
begin
|
||||||
|
if CurrentIdentifierList.IdentComplIncludeKeywords and
|
||||||
|
(GatherContext.Node <> nil) and
|
||||||
|
(GatherContext.Node.Desc in [ctnBeginBlock,ctnWithStatement,ctnOnStatement])
|
||||||
|
then
|
||||||
|
begin
|
||||||
|
if not (ilcfDontAllowProcedures in CurrentIdentifierList.ContextFlags)
|
||||||
|
and (ilcfStartOfStatement in CurrentIdentifierList.ContextFlags)
|
||||||
|
then begin
|
||||||
|
Add('asm');
|
||||||
|
Add('begin');
|
||||||
|
Add('case');
|
||||||
|
Add('except');
|
||||||
|
Add('finally');
|
||||||
|
Add('for');
|
||||||
|
Add('goto');
|
||||||
|
Add('if');
|
||||||
|
Add('raise');
|
||||||
|
Add('repeat');
|
||||||
|
Add('try');
|
||||||
|
Add('until');
|
||||||
|
Add('while');
|
||||||
|
Add('with');
|
||||||
|
end;
|
||||||
|
if (ilcfStartInStatement in CurrentIdentifierList.ContextFlags)
|
||||||
|
and not (ilcfStartOfOperand in CurrentIdentifierList.ContextFlags)
|
||||||
|
and (CurrentIdentifierList.StartBracketLvl = 0)
|
||||||
|
then begin
|
||||||
|
Add('else');
|
||||||
|
Add('end');
|
||||||
|
Add('then');
|
||||||
|
Add('do');
|
||||||
|
Add('downto');
|
||||||
|
Add('of');
|
||||||
|
Add('on');
|
||||||
|
Add('to');
|
||||||
|
end;
|
||||||
|
if (ilcfStartOfStatement in CurrentIdentifierList.ContextFlags)
|
||||||
|
or (CurrentIdentifierList.ContextFlags * [ilcfStartInStatement, ilcfStartOfOperand] = [ilcfStartInStatement, ilcfStartOfOperand])
|
||||||
|
then
|
||||||
|
begin
|
||||||
|
Add('inherited');
|
||||||
|
end;
|
||||||
|
if (CurrentIdentifierList.ContextFlags * [ilcfIsExpression, ilcfStartInStatement] <> []) then
|
||||||
|
begin
|
||||||
|
NotStartOfOp := not (ilcfStartOfOperand in CurrentIdentifierList.ContextFlags);
|
||||||
|
if not NotStartOfOp then begin
|
||||||
|
MoveCursorToAtomPos(CurrentIdentifierList.StartAtomInFront);
|
||||||
|
NotStartOfOp := AtomIsNumber or AtomIsRealNumber;
|
||||||
|
end;
|
||||||
|
if NotStartOfOp then
|
||||||
|
begin
|
||||||
|
Add('and');
|
||||||
|
Add('or');
|
||||||
|
Add('xor');
|
||||||
|
Add('div');
|
||||||
|
Add('in');
|
||||||
|
Add('as');
|
||||||
|
Add('is');
|
||||||
|
Add('mod');
|
||||||
|
Add('shl');
|
||||||
|
Add('shr');
|
||||||
|
end;
|
||||||
|
Add('not');
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
ctnProperty:
|
ctnProperty:
|
||||||
CheckProperty(Node);
|
CheckProperty(Node);
|
||||||
|
|
||||||
@ -2982,9 +3073,6 @@ begin
|
|||||||
FindContextClassAndAncestorsAndExtendedClassOfHelper(IdentStartXY, FICTClassAndAncestorsAndExtClassOfHelper);
|
FindContextClassAndAncestorsAndExtendedClassOfHelper(IdentStartXY, FICTClassAndAncestorsAndExtClassOfHelper);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
CursorContext:=CreateFindContext(Self,CursorNode);
|
|
||||||
GatherContextKeywords(CursorContext,IdentStartPos,Beautifier);
|
|
||||||
|
|
||||||
// check for incomplete context
|
// check for incomplete context
|
||||||
|
|
||||||
// context bracket level
|
// context bracket level
|
||||||
@ -3114,6 +3202,9 @@ begin
|
|||||||
CurrentIdentifierList.ContextFlags+[ilcfEndOfLine];
|
CurrentIdentifierList.ContextFlags+[ilcfEndOfLine];
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
CursorContext:=CreateFindContext(Self,CursorNode);
|
||||||
|
GatherContextKeywords(CursorContext, IdentStartPos, Beautifier, GatherContext); //note: coth:
|
||||||
|
|
||||||
// search and gather identifiers in context
|
// search and gather identifiers in context
|
||||||
if (GatherContext.Tool<>nil) and (GatherContext.Node<>nil) then begin
|
if (GatherContext.Tool<>nil) and (GatherContext.Node<>nil) then begin
|
||||||
{$IFDEF CTDEBUG}
|
{$IFDEF CTDEBUG}
|
||||||
|
110
components/codetools/tests/laztests/tcompletion_keywords.pas
Normal file
110
components/codetools/tests/laztests/tcompletion_keywords.pas
Normal file
@ -0,0 +1,110 @@
|
|||||||
|
{%identcomplincludekeywords:on}
|
||||||
|
unit {completion:+5=!do,!label,!repeat,!else,!inherited,!and,!not}
|
||||||
|
tcompletion_keywords {completion:+21=!do,!label,!repeat,!else,!inherited,!and,!not}
|
||||||
|
; {completion:+2=!do,!label,!repeat,!else,!inherited,!and,!not}
|
||||||
|
|
||||||
|
{$mode objfpc}{$H+}
|
||||||
|
{$ModeSwitch typehelpers}
|
||||||
|
{$ModeSwitch advancedrecords}
|
||||||
|
|
||||||
|
interface {completion:+11=!do,!label,!repeat,!else,!inherited,!and,!not}
|
||||||
|
|
||||||
|
uses {completion:+5=!do,!label,!repeat,!else,!inherited,!and,!not}
|
||||||
|
system {completion:+7=!do,!label,!repeat,!else,!inherited,!and,!not}
|
||||||
|
;
|
||||||
|
|
||||||
|
const {completion:+6=!do,!label,!repeat,!else,!inherited,!and,!not}
|
||||||
|
MYCONST
|
||||||
|
= {completion:+2=!do,!label,!repeat,!else,!inherited,!and,!not}
|
||||||
|
1 {completion:+2=!do,!label,!repeat,!else,!inherited,!and,!not}
|
||||||
|
; {completion:+2=!do,!label,!repeat,!else,!inherited,!and,!not}
|
||||||
|
MYCONST_B = 'test' ; {completion:+1=!do,!label,!repeat,!else,!inherited,!and,!not}
|
||||||
|
|
||||||
|
var {completion:+4=!do,!label,!repeat,!else,!inherited,!and,!not}
|
||||||
|
MyVar {completion:+6=!do,!label,!repeat,!else,!inherited,!and,!not}
|
||||||
|
: {completion:+1=!do,!label,!repeat,!else,!inherited,!and,!not}
|
||||||
|
Integer {completion:+8=!do,!label,!repeat,!else,!inherited,!and,!not}
|
||||||
|
; {completion:+1=!do,!label,!repeat,!else,!inherited,!and,!not}
|
||||||
|
MyVar2: TObject ; {completion:+1=!do,!label,!repeat,!else,!inherited,!and,!not,!case}
|
||||||
|
// TODO: "case" in record
|
||||||
|
MyVar3: record {completion:+7=!do,!label,!repeat,!else,!inherited,!and,!not}
|
||||||
|
a: Integer ; {completion:+1=!do,!label,!repeat,!else,!inherited,!and,!not}
|
||||||
|
a2 {completion:+3=!do,!label,!repeat,!else,!inherited,!and,!not}
|
||||||
|
: {completion:+1=!do,!label,!repeat,!else,!inherited,!and,!not}
|
||||||
|
Integer {completion:+8=!do,!label,!repeat,!else,!inherited,!and,!not}
|
||||||
|
; {completion:+1=!do,!label,!repeat,!else,!inherited,!and,!not}
|
||||||
|
case
|
||||||
|
boolean {completion:+8=!do,!label,!repeat,!else,!inherited,!and,!not} // TODO: "of"
|
||||||
|
of
|
||||||
|
true: (
|
||||||
|
b: TObject;
|
||||||
|
);
|
||||||
|
false: (
|
||||||
|
c: array [0..1] of integer;
|
||||||
|
);
|
||||||
|
end;
|
||||||
|
|
||||||
|
type
|
||||||
|
TFoo {completion:+5=!do,!label,!repeat,!else,!inherited,!and,!not}
|
||||||
|
= {completion:+1=!do,!label,!repeat,!else,!inherited,!and,!not}
|
||||||
|
class {completion:+6=!do,!label,!repeat,!else,!inherited,!and,!not}
|
||||||
|
;
|
||||||
|
|
||||||
|
TIntA = {completion:+1=!do,!label,!repeat,!else,!inherited,!and,!not} // TODO: "array"
|
||||||
|
array {completion:+6=!do,!label,!repeat,!else,!inherited,!and,!not} // TODO: "of"
|
||||||
|
of
|
||||||
|
integer;
|
||||||
|
|
||||||
|
TIntB = array
|
||||||
|
[ 0..9 ] {completion:+1=!do,!label,!repeat,!else,!inherited,!and,!not} // TODO: "of"
|
||||||
|
of
|
||||||
|
integer;
|
||||||
|
|
||||||
|
TFoo = class {completion:+6=!do,!label,!repeat,!else,!inherited,!and,!not}
|
||||||
|
( {completion:+1=!do,!label,!repeat,!else,!inherited,!and,!not}
|
||||||
|
TObject {completion:+8=!do,!label,!repeat,!else,!inherited,!and,!not}
|
||||||
|
) {completion:+1=!do,!label,!repeat,!else,!inherited,!and,!not}
|
||||||
|
a {completion:+2=!do,!label,!repeat,!else,!inherited,!and,!not}
|
||||||
|
: {completion:+1=!do,!label,!repeat,!else,!inherited,!and,!not}
|
||||||
|
Integer {completion:+8=!do,!label,!repeat,!else,!inherited,!and,!not}
|
||||||
|
; {completion:+1=!do,!label,!repeat,!else,!inherited,!and,!not}
|
||||||
|
private
|
||||||
|
procedure {completion:+10=!do,!label,!repeat,!else,!inherited,!and,!not}
|
||||||
|
Bar {completion:+5=!do,!label,!repeat,!else,!inherited,!and,!not}
|
||||||
|
; {completion:+1=!do,!label,!repeat,!else,!inherited,!and,!not}
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure SomeProc(val: Integer; var v2, v3: TIntA);
|
||||||
|
function f1: TObject;
|
||||||
|
|
||||||
|
implementation
|
||||||
|
var
|
||||||
|
bVal: Boolean;
|
||||||
|
iVal: integer;
|
||||||
|
ia: TIntA;
|
||||||
|
|
||||||
|
procedure SomeProc(val: Integer);
|
||||||
|
begin {completion:+6=!do,!label,repeat,!else,inherited,!and,!not}
|
||||||
|
; {completion:+1=!do,!label,repeat,!else,inherited,!and,!not}
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure SomeProc(val: Integer; var v2, v3: TIntA);
|
||||||
|
begin
|
||||||
|
|
||||||
|
end;
|
||||||
|
|
||||||
|
function f1: TObject;
|
||||||
|
begin
|
||||||
|
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TFoo.Bar;
|
||||||
|
begin
|
||||||
|
|
||||||
|
end;
|
||||||
|
|
||||||
|
begin
|
||||||
|
if {completion:+3=!and,not,inherited} // +3 test in space after if
|
||||||
|
iVal {completion:!and,!in,not,inherited;+1=!and,!in,!not,inherited;+5=and,in,!not,!inherited} // + 5 in spaces after iVal
|
||||||
|
end.
|
||||||
|
|
@ -24,6 +24,9 @@
|
|||||||
|
|
||||||
(* Expectation in test-files
|
(* Expectation in test-files
|
||||||
|
|
||||||
|
{%identcomplincludekeywords:on}
|
||||||
|
Enables CodeToolBoss.IdentComplIncludeKeywords
|
||||||
|
|
||||||
{SELECT:TESTS=TEST(|TEST)*}
|
{SELECT:TESTS=TEST(|TEST)*}
|
||||||
Each "{" comment starting with a..z is a test instruction, or a list of test instructions separated by |
|
Each "{" comment starting with a..z is a test instruction, or a list of test instructions separated by |
|
||||||
|
|
||||||
@ -278,6 +281,11 @@ begin
|
|||||||
DoParseModule(MainCode,FMainTool);
|
DoParseModule(MainCode,FMainTool);
|
||||||
CommentP:=1;
|
CommentP:=1;
|
||||||
Src:=MainTool.Src;
|
Src:=MainTool.Src;
|
||||||
|
|
||||||
|
CodeToolBoss.IdentComplIncludeKeywords := False;
|
||||||
|
if pos('{%identcomplincludekeywords:on}', LowerCase(Src)) > 0 then
|
||||||
|
CodeToolBoss.IdentComplIncludeKeywords := True;
|
||||||
|
|
||||||
while CommentP<length(Src) do begin
|
while CommentP<length(Src) do begin
|
||||||
CommentP:=FindNextComment(Src,CommentP);
|
CommentP:=FindNextComment(Src,CommentP);
|
||||||
if CommentP>length(Src) then break;
|
if CommentP>length(Src) then break;
|
||||||
@ -472,6 +480,7 @@ begin
|
|||||||
until CommentP >= CommentEnd;
|
until CommentP >= CommentEnd;
|
||||||
end;
|
end;
|
||||||
CheckReferenceMarkers;
|
CheckReferenceMarkers;
|
||||||
|
CodeToolBoss.IdentComplIncludeKeywords := False;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TCustomTestFindDeclaration.GetMarkers(Index: integer): TFDMarker;
|
function TCustomTestFindDeclaration.GetMarkers(Index: integer): TFDMarker;
|
||||||
@ -515,6 +524,7 @@ procedure TCustomTestFindDeclaration.SetUp;
|
|||||||
begin
|
begin
|
||||||
inherited SetUp;
|
inherited SetUp;
|
||||||
FMarkers:=TObjectList.Create(true);
|
FMarkers:=TObjectList.Create(true);
|
||||||
|
CodeToolBoss.IdentComplIncludeKeywords := False;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCustomTestFindDeclaration.TearDown;
|
procedure TCustomTestFindDeclaration.TearDown;
|
||||||
|
@ -128,6 +128,7 @@ type
|
|||||||
FIdentComplAutoStartAfterPoint: boolean;
|
FIdentComplAutoStartAfterPoint: boolean;
|
||||||
FIdentComplAutoUseSingleIdent: boolean;
|
FIdentComplAutoUseSingleIdent: boolean;
|
||||||
FIdentComplUseContainsFilter: Boolean;
|
FIdentComplUseContainsFilter: Boolean;
|
||||||
|
FIdentComplIncludeKeywords: Boolean;
|
||||||
FIdentComplIncludeCodeTemplates: Boolean;
|
FIdentComplIncludeCodeTemplates: Boolean;
|
||||||
FIdentComplIncludeWords: TIdentComplIncludeWords;
|
FIdentComplIncludeWords: TIdentComplIncludeWords;
|
||||||
FIdentComplShowIcons: Boolean;
|
FIdentComplShowIcons: Boolean;
|
||||||
@ -269,6 +270,8 @@ type
|
|||||||
write FIdentComplAutoUseSingleIdent;
|
write FIdentComplAutoUseSingleIdent;
|
||||||
property IdentComplUseContainsFilter: boolean read FIdentComplUseContainsFilter
|
property IdentComplUseContainsFilter: boolean read FIdentComplUseContainsFilter
|
||||||
write FIdentComplUseContainsFilter;
|
write FIdentComplUseContainsFilter;
|
||||||
|
property IdentComplIncludeKeywords: Boolean read FIdentComplIncludeKeywords
|
||||||
|
write FIdentComplIncludeKeywords;
|
||||||
property IdentComplIncludeCodeTemplates: boolean read FIdentComplIncludeCodeTemplates
|
property IdentComplIncludeCodeTemplates: boolean read FIdentComplIncludeCodeTemplates
|
||||||
write FIdentComplIncludeCodeTemplates;
|
write FIdentComplIncludeCodeTemplates;
|
||||||
property IdentComplIncludeWords: TIdentComplIncludeWords read FIdentComplIncludeWords
|
property IdentComplIncludeWords: TIdentComplIncludeWords read FIdentComplIncludeWords
|
||||||
@ -597,6 +600,8 @@ begin
|
|||||||
'CodeToolsOptions/IdentifierCompletion/AutoUseSingleIdent',true);
|
'CodeToolsOptions/IdentifierCompletion/AutoUseSingleIdent',true);
|
||||||
FIdentComplUseContainsFilter:=XMLConfig.GetValue(
|
FIdentComplUseContainsFilter:=XMLConfig.GetValue(
|
||||||
'CodeToolsOptions/IdentifierCompletion/UseContainsFilter',true);
|
'CodeToolsOptions/IdentifierCompletion/UseContainsFilter',true);
|
||||||
|
FIdentComplIncludeKeywords:=XMLConfig.GetValue(
|
||||||
|
'CodeToolsOptions/IdentifierCompletion/IncludeKeywords',false);
|
||||||
FIdentComplIncludeCodeTemplates:=XMLConfig.GetValue(
|
FIdentComplIncludeCodeTemplates:=XMLConfig.GetValue(
|
||||||
'CodeToolsOptions/IdentifierCompletion/IncludeCodeTemplates',true);
|
'CodeToolsOptions/IdentifierCompletion/IncludeCodeTemplates',true);
|
||||||
FIdentComplIncludeWords:=IdentComplIncludeWordsNamesToEnum(XMLConfig.GetValue(
|
FIdentComplIncludeWords:=IdentComplIncludeWordsNamesToEnum(XMLConfig.GetValue(
|
||||||
@ -782,6 +787,8 @@ begin
|
|||||||
FIdentComplAutoUseSingleIdent,true);
|
FIdentComplAutoUseSingleIdent,true);
|
||||||
XMLConfig.SetDeleteValue('CodeToolsOptions/IdentifierCompletion/UseContainsFilter',
|
XMLConfig.SetDeleteValue('CodeToolsOptions/IdentifierCompletion/UseContainsFilter',
|
||||||
FIdentComplUseContainsFilter,true);
|
FIdentComplUseContainsFilter,true);
|
||||||
|
XMLConfig.SetDeleteValue('CodeToolsOptions/IdentifierCompletion/IncludeKeywords',
|
||||||
|
FIdentComplIncludeKeywords,false);
|
||||||
XMLConfig.SetDeleteValue('CodeToolsOptions/IdentifierCompletion/IncludeCodeTemplates',
|
XMLConfig.SetDeleteValue('CodeToolsOptions/IdentifierCompletion/IncludeCodeTemplates',
|
||||||
FIdentComplIncludeCodeTemplates,true);
|
FIdentComplIncludeCodeTemplates,true);
|
||||||
XMLConfig.SetDeleteValue('CodeToolsOptions/IdentifierCompletion/IncludeWords',
|
XMLConfig.SetDeleteValue('CodeToolsOptions/IdentifierCompletion/IncludeWords',
|
||||||
@ -942,6 +949,7 @@ begin
|
|||||||
FIdentComplAutoStartAfterPoint:=CodeToolsOpts.FIdentComplAutoStartAfterPoint;
|
FIdentComplAutoStartAfterPoint:=CodeToolsOpts.FIdentComplAutoStartAfterPoint;
|
||||||
FIdentComplAutoUseSingleIdent:=CodeToolsOpts.FIdentComplAutoUseSingleIdent;
|
FIdentComplAutoUseSingleIdent:=CodeToolsOpts.FIdentComplAutoUseSingleIdent;
|
||||||
FIdentComplUseContainsFilter:=CodeToolsOpts.FIdentComplUseContainsFilter;
|
FIdentComplUseContainsFilter:=CodeToolsOpts.FIdentComplUseContainsFilter;
|
||||||
|
FIdentComplIncludeKeywords := CodeToolsOpts.FIdentComplIncludeKeywords;
|
||||||
FIdentComplIncludeCodeTemplates:=CodeToolsOpts.FIdentComplIncludeCodeTemplates;
|
FIdentComplIncludeCodeTemplates:=CodeToolsOpts.FIdentComplIncludeCodeTemplates;
|
||||||
FIdentComplShowIcons:=CodeToolsOpts.FIdentComplShowIcons;
|
FIdentComplShowIcons:=CodeToolsOpts.FIdentComplShowIcons;
|
||||||
FIdentComplAddParameterBrackets:=CodeToolsOpts.FIdentComplAddParameterBrackets;
|
FIdentComplAddParameterBrackets:=CodeToolsOpts.FIdentComplAddParameterBrackets;
|
||||||
@ -1014,6 +1022,7 @@ begin
|
|||||||
FIdentComplAutoStartAfterPoint:=true;
|
FIdentComplAutoStartAfterPoint:=true;
|
||||||
FIdentComplAutoUseSingleIdent:=true;
|
FIdentComplAutoUseSingleIdent:=true;
|
||||||
FIdentComplUseContainsFilter:=true;
|
FIdentComplUseContainsFilter:=true;
|
||||||
|
FIdentComplIncludeKeywords := false;
|
||||||
FIdentComplIncludeCodeTemplates:=true;
|
FIdentComplIncludeCodeTemplates:=true;
|
||||||
FIdentComplShowIcons:=false;
|
FIdentComplShowIcons:=false;
|
||||||
FIdentComplAddParameterBrackets:=true;
|
FIdentComplAddParameterBrackets:=true;
|
||||||
@ -1105,6 +1114,7 @@ begin
|
|||||||
and (FIdentComplAutoStartAfterPoint=CodeToolsOpts.FIdentComplAutoStartAfterPoint)
|
and (FIdentComplAutoStartAfterPoint=CodeToolsOpts.FIdentComplAutoStartAfterPoint)
|
||||||
and (FIdentComplAutoUseSingleIdent=CodeToolsOpts.FIdentComplAutoUseSingleIdent)
|
and (FIdentComplAutoUseSingleIdent=CodeToolsOpts.FIdentComplAutoUseSingleIdent)
|
||||||
and (FIdentComplUseContainsFilter=CodeToolsOpts.FIdentComplUseContainsFilter)
|
and (FIdentComplUseContainsFilter=CodeToolsOpts.FIdentComplUseContainsFilter)
|
||||||
|
and (FIdentComplIncludeKeywords=CodeToolsOpts.FIdentComplIncludeKeywords)
|
||||||
and (FIdentComplIncludeCodeTemplates=CodeToolsOpts.FIdentComplIncludeCodeTemplates)
|
and (FIdentComplIncludeCodeTemplates=CodeToolsOpts.FIdentComplIncludeCodeTemplates)
|
||||||
and (FIdentComplShowIcons=CodeToolsOpts.FIdentComplShowIcons)
|
and (FIdentComplShowIcons=CodeToolsOpts.FIdentComplShowIcons)
|
||||||
and (FIdentComplAddParameterBrackets=CodeToolsOpts.FIdentComplAddParameterBrackets)
|
and (FIdentComplAddParameterBrackets=CodeToolsOpts.FIdentComplAddParameterBrackets)
|
||||||
@ -1174,6 +1184,8 @@ begin
|
|||||||
Boss.CursorBeyondEOL:=CursorBeyondEOL;
|
Boss.CursorBeyondEOL:=CursorBeyondEOL;
|
||||||
Boss.AddInheritedCodeToOverrideMethod:=AddInheritedCodeToOverrideMethod;
|
Boss.AddInheritedCodeToOverrideMethod:=AddInheritedCodeToOverrideMethod;
|
||||||
Boss.CompleteProperties:=CompleteProperties;
|
Boss.CompleteProperties:=CompleteProperties;
|
||||||
|
Boss.IdentComplAutoInvokeOnType:=IdentComplAutoInvokeOnType;
|
||||||
|
Boss.IdentComplIncludeKeywords:=IdentComplIncludeKeywords;
|
||||||
|
|
||||||
// CreateCode - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// CreateCode - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
AssignTo(Boss.SourceChangeCache.BeautifyCodeOptions);
|
AssignTo(Boss.SourceChangeCache.BeautifyCodeOptions);
|
||||||
|
@ -95,7 +95,7 @@ object CodetoolsIndentifierCompletionOptionsFrame: TCodetoolsIndentifierCompleti
|
|||||||
Caption = 'ICReplaceCheckBox'
|
Caption = 'ICReplaceCheckBox'
|
||||||
ParentShowHint = False
|
ParentShowHint = False
|
||||||
ShowHint = True
|
ShowHint = True
|
||||||
TabOrder = 16
|
TabOrder = 17
|
||||||
end
|
end
|
||||||
object ICAddDoCheckBox: TCheckBox
|
object ICAddDoCheckBox: TCheckBox
|
||||||
AnchorSideLeft.Control = Owner
|
AnchorSideLeft.Control = Owner
|
||||||
@ -206,7 +206,7 @@ object CodetoolsIndentifierCompletionOptionsFrame: TCodetoolsIndentifierCompleti
|
|||||||
Caption = 'ICJumpToErrorCheckBox'
|
Caption = 'ICJumpToErrorCheckBox'
|
||||||
ParentShowHint = False
|
ParentShowHint = False
|
||||||
ShowHint = True
|
ShowHint = True
|
||||||
TabOrder = 17
|
TabOrder = 18
|
||||||
end
|
end
|
||||||
object ICAutoUseSingleIdent: TCheckBox
|
object ICAutoUseSingleIdent: TCheckBox
|
||||||
AnchorSideLeft.Control = Owner
|
AnchorSideLeft.Control = Owner
|
||||||
@ -232,7 +232,7 @@ object CodetoolsIndentifierCompletionOptionsFrame: TCodetoolsIndentifierCompleti
|
|||||||
Top = 327
|
Top = 327
|
||||||
Width = 157
|
Width = 157
|
||||||
Caption = 'ICContainsFilterCheckBox'
|
Caption = 'ICContainsFilterCheckBox'
|
||||||
TabOrder = 18
|
TabOrder = 19
|
||||||
end
|
end
|
||||||
object ICAppearanceDividerBevel: TDividerBevel
|
object ICAppearanceDividerBevel: TDividerBevel
|
||||||
AnchorSideLeft.Control = Owner
|
AnchorSideLeft.Control = Owner
|
||||||
@ -259,7 +259,7 @@ object CodetoolsIndentifierCompletionOptionsFrame: TCodetoolsIndentifierCompleti
|
|||||||
Top = 409
|
Top = 409
|
||||||
Width = 224
|
Width = 224
|
||||||
Caption = 'ICUseIconsInCompletionBoxCheckBox'
|
Caption = 'ICUseIconsInCompletionBoxCheckBox'
|
||||||
TabOrder = 15
|
TabOrder = 16
|
||||||
end
|
end
|
||||||
object ICContentDividerBevel: TDividerBevel
|
object ICContentDividerBevel: TDividerBevel
|
||||||
AnchorSideLeft.Control = Owner
|
AnchorSideLeft.Control = Owner
|
||||||
@ -302,17 +302,29 @@ object CodetoolsIndentifierCompletionOptionsFrame: TCodetoolsIndentifierCompleti
|
|||||||
Style = csDropDownList
|
Style = csDropDownList
|
||||||
TabOrder = 13
|
TabOrder = 13
|
||||||
end
|
end
|
||||||
object ICIncludeCodeTemplatesCheckBox: TCheckBox
|
object ICIncludeKeywordsCheckBox: TCheckBox
|
||||||
AnchorSideLeft.Control = Owner
|
AnchorSideLeft.Control = Owner
|
||||||
AnchorSideTop.Control = ICAddWordsComboBox
|
AnchorSideTop.Control = ICAddWordsComboBox
|
||||||
AnchorSideTop.Side = asrBottom
|
AnchorSideTop.Side = asrBottom
|
||||||
Left = 0
|
Left = 0
|
||||||
Height = 19
|
Height = 19
|
||||||
|
Top = 382
|
||||||
|
Width = 167
|
||||||
|
BorderSpacing.Top = 2
|
||||||
|
Caption = 'ICIncludeKeywordsCheckBox'
|
||||||
|
TabOrder = 14
|
||||||
|
end
|
||||||
|
object ICIncludeCodeTemplatesCheckBox: TCheckBox
|
||||||
|
AnchorSideLeft.Control = Owner
|
||||||
|
AnchorSideTop.Control = ICIncludeKeywordsCheckBox
|
||||||
|
AnchorSideTop.Side = asrBottom
|
||||||
|
Left = 0
|
||||||
|
Height = 19
|
||||||
Top = 373
|
Top = 373
|
||||||
Width = 205
|
Width = 205
|
||||||
BorderSpacing.Top = 2
|
BorderSpacing.Top = 2
|
||||||
Caption = 'ICIncludeCodeTemplatesCheckBox'
|
Caption = 'ICIncludeCodeTemplatesCheckBox'
|
||||||
TabOrder = 14
|
TabOrder = 15
|
||||||
end
|
end
|
||||||
object ICAutoOnTypeUseTimer: TCheckBox
|
object ICAutoOnTypeUseTimer: TCheckBox
|
||||||
AnchorSideLeft.Control = Owner
|
AnchorSideLeft.Control = Owner
|
||||||
|
@ -46,6 +46,7 @@ type
|
|||||||
ICContainsFilterCheckBox: TCheckBox;
|
ICContainsFilterCheckBox: TCheckBox;
|
||||||
ICAddDoCheckBox: TCheckBox;
|
ICAddDoCheckBox: TCheckBox;
|
||||||
ICAutoAddParameterBracketsCheckBox: TCheckBox;
|
ICAutoAddParameterBracketsCheckBox: TCheckBox;
|
||||||
|
ICIncludeKeywordsCheckBox: TCheckBox;
|
||||||
ICIncludeCodeTemplatesCheckBox: TCheckBox;
|
ICIncludeCodeTemplatesCheckBox: TCheckBox;
|
||||||
ICMiscDividerBevel: TDividerBevel;
|
ICMiscDividerBevel: TDividerBevel;
|
||||||
ICOpenDividerBevel: TDividerBevel;
|
ICOpenDividerBevel: TDividerBevel;
|
||||||
@ -120,6 +121,7 @@ begin
|
|||||||
dlgIncludeWordsToIdentCompl_IncludeFromAllUnits+LineEnding+
|
dlgIncludeWordsToIdentCompl_IncludeFromAllUnits+LineEnding+
|
||||||
dlgIncludeWordsToIdentCompl_IncludeFromCurrentUnit+LineEnding+
|
dlgIncludeWordsToIdentCompl_IncludeFromCurrentUnit+LineEnding+
|
||||||
dlgIncludeWordsToIdentCompl_DontInclude;
|
dlgIncludeWordsToIdentCompl_DontInclude;
|
||||||
|
ICIncludeKeywordsCheckBox.Caption := dlgIncludeKeywordsToIdentCompl;
|
||||||
ICIncludeCodeTemplatesCheckBox.Caption := dlgIncludeCodeTemplatesToIdentCompl;
|
ICIncludeCodeTemplatesCheckBox.Caption := dlgIncludeCodeTemplatesToIdentCompl;
|
||||||
|
|
||||||
ICAppearanceDividerBevel.Caption:=lisAppearance;
|
ICAppearanceDividerBevel.Caption:=lisAppearance;
|
||||||
@ -153,6 +155,7 @@ begin
|
|||||||
ICSortForHistoryCheckBox.Checked:=IdentComplSortForHistory;
|
ICSortForHistoryCheckBox.Checked:=IdentComplSortForHistory;
|
||||||
ICSortForScopeCheckBox.Checked:=IdentComplSortForScope;
|
ICSortForScopeCheckBox.Checked:=IdentComplSortForScope;
|
||||||
ICContainsFilterCheckBox.Checked:=IdentComplUseContainsFilter;
|
ICContainsFilterCheckBox.Checked:=IdentComplUseContainsFilter;
|
||||||
|
ICIncludeKeywordsCheckBox.Checked := IdentComplIncludeKeywords;
|
||||||
ICIncludeCodeTemplatesCheckBox.Checked:=IdentComplIncludeCodeTemplates;
|
ICIncludeCodeTemplatesCheckBox.Checked:=IdentComplIncludeCodeTemplates;
|
||||||
ICUseIconsInCompletionBoxCheckBox.Checked:=IdentComplShowIcons;
|
ICUseIconsInCompletionBoxCheckBox.Checked:=IdentComplShowIcons;
|
||||||
case IdentComplIncludeWords of
|
case IdentComplIncludeWords of
|
||||||
@ -185,6 +188,7 @@ begin
|
|||||||
IdentComplSortForHistory:=ICSortForHistoryCheckBox.Checked;
|
IdentComplSortForHistory:=ICSortForHistoryCheckBox.Checked;
|
||||||
IdentComplSortForScope:=ICSortForScopeCheckBox.Checked;
|
IdentComplSortForScope:=ICSortForScopeCheckBox.Checked;
|
||||||
IdentComplUseContainsFilter:=ICContainsFilterCheckBox.Checked;
|
IdentComplUseContainsFilter:=ICContainsFilterCheckBox.Checked;
|
||||||
|
IdentComplIncludeKeywords := ICIncludeKeywordsCheckBox.Checked;
|
||||||
IdentComplIncludeCodeTemplates:=ICIncludeCodeTemplatesCheckBox.Checked;
|
IdentComplIncludeCodeTemplates:=ICIncludeCodeTemplatesCheckBox.Checked;
|
||||||
IdentComplShowIcons:=ICUseIconsInCompletionBoxCheckBox.Checked;
|
IdentComplShowIcons:=ICUseIconsInCompletionBoxCheckBox.Checked;
|
||||||
case ICAddWordsComboBox.ItemIndex of
|
case ICAddWordsComboBox.ItemIndex of
|
||||||
|
@ -2066,6 +2066,7 @@ resourcestring
|
|||||||
dlgIncludeWordsToIdentCompl_IncludeFromAllUnits = 'from all units';
|
dlgIncludeWordsToIdentCompl_IncludeFromAllUnits = 'from all units';
|
||||||
dlgIncludeWordsToIdentCompl_IncludeFromCurrentUnit = 'from current unit';
|
dlgIncludeWordsToIdentCompl_IncludeFromCurrentUnit = 'from current unit';
|
||||||
dlgIncludeWordsToIdentCompl_DontInclude = 'don''t include';
|
dlgIncludeWordsToIdentCompl_DontInclude = 'don''t include';
|
||||||
|
dlgIncludeKeywordsToIdentCompl = 'Include all keywords and operators';
|
||||||
dlgIncludeCodeTemplatesToIdentCompl = 'Include code templates';
|
dlgIncludeCodeTemplatesToIdentCompl = 'Include code templates';
|
||||||
|
|
||||||
dlgMarkupUserDefined = 'User defined markup';
|
dlgMarkupUserDefined = 'User defined markup';
|
||||||
|
Loading…
Reference in New Issue
Block a user