From 1fc6a30b766a0f1805331c30662d3d9febac81f2 Mon Sep 17 00:00:00 2001 From: mattias Date: Thu, 16 Jun 2011 11:25:07 +0000 Subject: [PATCH] codetools: local var completion: fixed search type of const set git-svn-id: trunk@31248 - --- components/codetools/finddeclarationtool.pas | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/components/codetools/finddeclarationtool.pas b/components/codetools/finddeclarationtool.pas index 678ea3fd30..d09bbaad8f 100644 --- a/components/codetools/finddeclarationtool.pas +++ b/components/codetools/finddeclarationtool.pas @@ -9550,7 +9550,8 @@ begin debugln(['TFindDeclarationTool.FindTermTypeAsString [name: ',ExprTypeToString(ExprType)]); {$ENDIF} if (ExprType.Desc=xtContext) - and (ExprType.Context.Node.Desc=ctnEnumerationType) then begin + and (ExprType.Context.Node.Desc in [ctnEnumerationType,ctnEnumIdentifier]) + then begin SetTool:=ExprType.Context.Tool; SetNode:=SetTool.FindSetOfEnumerationType(ExprType.Context.Node); if SetNode<>nil then begin @@ -10166,6 +10167,9 @@ var end; begin + {$IFDEF ShowExprEval} + debugln(['TFindDeclarationTool.FindSetOfEnumerationType ',EnumNode.DescAsString]); + {$ENDIF} if EnumNode.Desc=ctnEnumIdentifier then EnumNode:=EnumNode.Parent; if EnumNode.Desc=ctnEnumerationType then EnumNode:=EnumNode.Parent; p:=@Src[EnumNode.StartPos]; @@ -10230,8 +10234,7 @@ begin if (AliasType<>nil) and (AliasType^.Node<>nil) then begin case AliasType^.Node.Desc of ctnTypeDefinition: - Result:=GetIdentifier( - @AliasType^.Tool.Src[AliasType^.Node.StartPos]); + Result:=GetIdentifier(@AliasType^.Tool.Src[AliasType^.Node.StartPos]); end; if Result<>'' then exit; end;