Commit 0e127306 authored by Juha Manninen's avatar Juha Manninen
Browse files

IDE: Show dotted unit names in Code Explorer. Issue #32663.

git-svn-id: trunk@56360 -
parent eed9fc6c
......@@ -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
......
......@@ -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,[]);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment