diff --git a/components/codetools/customcodetool.pas b/components/codetools/customcodetool.pas index c846f66901..82bae978ae 100644 --- a/components/codetools/customcodetool.pas +++ b/components/codetools/customcodetool.pas @@ -278,6 +278,7 @@ type AnIdentifier: PChar): boolean; function CompareSrcIdentifiersMethod(Identifier1, Identifier2: Pointer): integer; function ExtractIdentifier(CleanStartPos: integer): string; + function ExtractDottedIdentifier(CleanStartPos: integer): string; procedure CreateChildNode; procedure EndChildNode; {$IFDEF UseInline}inline;{$ENDIF} @@ -3041,6 +3042,11 @@ begin Result:=''; end; +function TCustomCodeTool.ExtractDottedIdentifier(CleanStartPos: integer): string; +begin + Result:=GetDottedIdentifier(@Src[CleanStartPos]); +end; + procedure TCustomCodeTool.DoDeleteNodes(StartNode: TCodeTreeNode); // delete Node and all following nodes var diff --git a/ide/codeexplorer.pas b/ide/codeexplorer.pas index d14e26101b..ca52a06968 100644 --- a/ide/codeexplorer.pas +++ b/ide/codeexplorer.pas @@ -776,9 +776,15 @@ begin ctnResStrSection: Result:='Resourcestring'; - ctnVarDefinition,ctnConstDefinition,ctnUseUnit: + ctnVarDefinition, + ctnConstDefinition, + ctnEnumIdentifier, + ctnLabel: Result:=ACodeTool.ExtractIdentifier(CodeNode.StartPos); + ctnUseUnit: + Result:=ACodeTool.ExtractDottedIdentifier(CodeNode.StartPos); + ctnTypeDefinition: begin Result:=ACodeTool.ExtractIdentifier(CodeNode.StartPos); @@ -804,9 +810,6 @@ begin ctnClassInterface,ctnCPPClass: Result:='('+ACodeTool.ExtractClassInheritance(CodeNode,[])+')'; - ctnEnumIdentifier, ctnLabel: - Result:=ACodeTool.ExtractIdentifier(CodeNode.StartPos); - ctnProcedure: Result:=ACodeTool.ExtractProcHead(CodeNode, [// phpWithStart is no needed because there are icons @@ -1090,11 +1093,9 @@ begin //if NodeText='TCodeExplorerView' then // debugln(['TCodeExplorerView.CreateIdentifierNodes CodeNode=',CodeNode.DescAsString,' NodeText="',NodeText,'" Category=',dbgs(Category),' InFrontViewNode=',InFrontViewNode<>nil,' CurParentViewNode=',CurParentViewNode<>nil]); if InFrontViewNode<>nil then - ViewNode:=CodeTreeview.Items.InsertObjectBehind( - InFrontViewNode,NodeText,NodeData) + ViewNode:=CodeTreeview.Items.InsertObjectBehind(InFrontViewNode,NodeText,NodeData) else if CurParentViewNode<>nil then - ViewNode:=CodeTreeview.Items.AddChildObject( - CurParentViewNode,NodeText,NodeData) + ViewNode:=CodeTreeview.Items.AddChildObject(CurParentViewNode,NodeText,NodeData) else ViewNode:=CodeTreeview.Items.AddObject(nil,NodeText,NodeData); ViewNode.ImageIndex:=NodeImageIndex; @@ -2681,15 +2682,18 @@ begin CurName:=''; case CodeNode.Desc of - ctnTypeDefinition,ctnVarDefinition,ctnConstDefinition,ctnUseUnit: + ctnTypeDefinition, + ctnVarDefinition, + ctnConstDefinition, + ctnEnumIdentifier: CurName:=ACodeTool.ExtractIdentifier(CodeNode.StartPos); + ctnUseUnit: + CurName:=ACodeTool.ExtractDottedIdentifier(CodeNode.StartPos); + ctnGenericType: CurName:=ACodeTool.ExtractDefinitionName(CodeNode); - ctnEnumIdentifier: - CurName:=ACodeTool.ExtractIdentifier(CodeNode.StartPos); - ctnProcedure: CurName:=ACodeTool.ExtractProcName(CodeNode,[]);