Skip to content

Commit 6dd203e

Browse files
committed
add outline menu
1 parent 9e6e3dc commit 6dd203e

File tree

2 files changed

+33
-2
lines changed

2 files changed

+33
-2
lines changed

package.json

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,22 @@
3939
"when": "true",
4040
"group": "navigation"
4141
}
42+
],
43+
"CustomEditorOutlineActionMenu": [
44+
{
45+
"command": "myExtension.deleteElement",
46+
"group": "inline",
47+
"when": "customEditorOutlineItem == element"
48+
},
49+
{
50+
"command": "myExtension.duplicateElement",
51+
"group": "inline",
52+
"when": "customEditorOutlineItem == element"
53+
},
54+
{
55+
"command": "myExtension.renameElement",
56+
"when": "customEditorOutlineItem == element"
57+
}
4258
]
4359
},
4460
"commands": [
@@ -49,6 +65,20 @@
4965
"light": "resources/light/editor.svg",
5066
"dark": "resources/dark/editor.svg"
5167
}
68+
},
69+
{
70+
"command": "myExtension.deleteElement",
71+
"title": "Delete Element",
72+
"icon": "$(trash)"
73+
},
74+
{
75+
"command": "myExtension.duplicateElement",
76+
"title": "Duplicate Element",
77+
"icon": "$(copy)"
78+
},
79+
{
80+
"command": "myExtension.renameElement",
81+
"title": "Rename Element"
5282
}
5383
],
5484
"customEditors": [
@@ -119,4 +149,4 @@
119149
"es-module-shims": "^2.8.0",
120150
"typescript": "^5.8.3"
121151
}
122-
}
152+
}

src/vscode/DesignerTextEditor.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export class DesignerTextEditor implements vscode.CustomTextEditorProvider {
2020
retainContextWhenHidden: true
2121
}
2222
});
23-
const outlineRegistration = vscode.window.registerCustomEditorOutlineProvider('designer.visualEditor', outlineProvider)
23+
const outlineRegistration = vscode.window.registerCustomEditorOutlineProvider('designer.designerTextEditor', outlineProvider)
2424
return [providerRegistration, outlineRegistration];
2525
}
2626

@@ -152,6 +152,7 @@ export class DesignerTextEditor implements vscode.CustomTextEditorProvider {
152152
{
153153
id: 'root',
154154
label: 'Canvas',
155+
detail: 'test',
155156
icon: new vscode.ThemeIcon('layout'),
156157
contextValue: 'canvas',
157158
children: [

0 commit comments

Comments
 (0)