mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-23 04:19:47 +02:00
IDE: Show dotted unit names in Code Explorer. Issue #32663.
git-svn-id: trunk@56360 -
This commit is contained in:
parent
eed9fc6c4b
commit
0e12730671
@ -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,[]);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user