mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-30 05:30:45 +02:00
codetools: GetPossibleInitsForVariable: enum
git-svn-id: trunk@47882 -
This commit is contained in:
parent
01be30d9d0
commit
eaf61a9302
@ -6026,6 +6026,8 @@ var
|
||||
ExprType: TExpressionType;
|
||||
BeginNode: TCodeTreeNode;
|
||||
InsertPosDesc: TInsertStatementPosDescription;
|
||||
Node: TCodeTreeNode;
|
||||
Tool: TFindDeclarationTool;
|
||||
begin
|
||||
{$IFDEF VerboseGetPossibleInitsForVariable}
|
||||
debugln(['TCodeCompletionCodeTool.GetPossibleInitsForVariable ',dbgs(CursorPos)]);
|
||||
@ -6081,8 +6083,24 @@ begin
|
||||
end;
|
||||
|
||||
case ExprType.Desc of
|
||||
// ToDo: sets, ranges, records, objects, pointer, class, class of, interface
|
||||
//xtContext: ;
|
||||
xtContext:
|
||||
begin
|
||||
// ToDo: sets, ranges, records, objects, pointer, class, class of, interface
|
||||
Node:=ExprType.Context.Node;
|
||||
Tool:=ExprType.Context.Tool;
|
||||
case Node.Desc of
|
||||
ctnEnumerationType:
|
||||
begin
|
||||
// enumeration: add first 10 enums
|
||||
Node:=Node.FirstChild;
|
||||
while (Node<>nil) and (Statements.Count<10) do begin
|
||||
if Node.Desc=ctnEnumIdentifier then
|
||||
AddAssignment(GetIdentifier(@Tool.Src[Node.StartPos]));
|
||||
Node:=Node.NextBrother;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
xtChar,
|
||||
xtWideChar: begin AddAssignment('#0'); AddAssignment(''' '''); end;
|
||||
xtReal,
|
||||
|
@ -21,7 +21,8 @@ begin
|
||||
TestInteger(i);
|
||||
end;
|
||||
|
||||
procedure TestLots({%H-}s: string; {%H-}c: char; {%H-}p: pointer);
|
||||
procedure TestLots({%H-}s: string; {%H-}c: char; {%H-}p: pointer;
|
||||
{%H-}SignalState: TSignalState);
|
||||
begin
|
||||
|
||||
end;
|
||||
@ -31,8 +32,9 @@ var
|
||||
s: string;
|
||||
c: char;
|
||||
p: Pointer;
|
||||
SignalState: TSignalState;
|
||||
begin
|
||||
TestLots(s,c,p);
|
||||
TestLots(s,c,p,SignalState);
|
||||
end;
|
||||
|
||||
end.
|
||||
|
Loading…
Reference in New Issue
Block a user