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

git-svn-id: trunk@56360 -
This commit is contained in:
juha 2017-11-11 09:25:39 +00:00
parent eed9fc6c4b
commit 0e12730671
2 changed files with 22 additions and 12 deletions

View File

@ -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

View File

@ -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,[]);