From 350c5c36ebf361c3d6b2346cfdc4795c0d945aae Mon Sep 17 00:00:00 2001 From: nagi1999a Date: Tue, 7 Jan 2025 21:06:04 +0800 Subject: [PATCH] Implement submenu --- extensions/references-view/package.json | 35 ++++++++++++++------- extensions/references-view/package.nls.json | 8 ++--- 2 files changed, 28 insertions(+), 15 deletions(-) diff --git a/extensions/references-view/package.json b/extensions/references-view/package.json index 8c3999ea88205..617285fd63342 100644 --- a/extensions/references-view/package.json +++ b/extensions/references-view/package.json @@ -317,44 +317,51 @@ "when": "view == references-view.tree && viewItem == call-item" }, { - "command": "references-view.copyCallHierarchy", + "submenu": "references-view.copyCallHierarchyMenu", "group": "1", "when": "view == references-view.tree && viewItem == call-item" }, { - "command": "references-view.copyCallHierarchyShort", + "command": "references-view.showOutgoingCalls", "group": "1", "when": "view == references-view.tree && viewItem == call-item" }, { - "command": "references-view.copyCallHierarchyReversed", + "command": "references-view.showIncomingCalls", "group": "1", "when": "view == references-view.tree && viewItem == call-item" }, { - "command": "references-view.copyCallHierarchyReversedShort", + "command": "references-view.showSupertypes", "group": "1", - "when": "view == references-view.tree && viewItem == call-item" + "when": "view == references-view.tree && viewItem == type-item" }, { - "command": "references-view.showOutgoingCalls", + "command": "references-view.showSubtypes", + "group": "1", + "when": "view == references-view.tree && viewItem == type-item" + } + ], + "references-view.copyCallHierarchyMenu": [ + { + "command": "references-view.copyCallHierarchy", "group": "1", "when": "view == references-view.tree && viewItem == call-item" }, { - "command": "references-view.showIncomingCalls", + "command": "references-view.copyCallHierarchyShort", "group": "1", "when": "view == references-view.tree && viewItem == call-item" }, { - "command": "references-view.showSupertypes", + "command": "references-view.copyCallHierarchyReversed", "group": "1", - "when": "view == references-view.tree && viewItem == type-item" + "when": "view == references-view.tree && viewItem == call-item" }, { - "command": "references-view.showSubtypes", + "command": "references-view.copyCallHierarchyReversedShort", "group": "1", - "when": "view == references-view.tree && viewItem == type-item" + "when": "view == references-view.tree && viewItem == call-item" } ], "commandPalette": [ @@ -436,6 +443,12 @@ } ] }, + "submenus": [ + { + "id": "references-view.copyCallHierarchyMenu", + "label": "Copy Hierarchy" + } + ], "keybindings": [ { "command": "references-view.findReferences", diff --git a/extensions/references-view/package.nls.json b/extensions/references-view/package.nls.json index 73e8d5315f125..f1c5927eb8ffb 100644 --- a/extensions/references-view/package.nls.json +++ b/extensions/references-view/package.nls.json @@ -23,10 +23,10 @@ "cmd.references-view.showIncomingCalls": "Show Incoming Calls", "cmd.references-view.removeCallItem": "Dismiss", "cmd.references-view.copyCallName": "Copy", - "cmd.references-view.copyCallHierarchy": "Copy Hierarchy", - "cmd.references-view.copyCallHierarchyShort": "Copy Hierarchy (Short)", - "cmd.references-view.copyCallHierarchyReversed": "Copy Hierarchy (Reversed)", - "cmd.references-view.copyCallHierarchyReversedShort": "Copy Hierarchy (Reversed, Short)", + "cmd.references-view.copyCallHierarchy": "Default Style", + "cmd.references-view.copyCallHierarchyShort": "Short Style", + "cmd.references-view.copyCallHierarchyReversed": "Reversed Style", + "cmd.references-view.copyCallHierarchyReversedShort": "Reversed & Short Style", "cmd.references-view.next": "Go to Next Reference", "cmd.references-view.prev": "Go to Previous Reference", "cmd.references-view.showTypeHierarchy": "Show Type Hierarchy",