Skip to content

Commit 35fb6a0

Browse files
committed
Add icons and improve new package command
Added light and dark SVG icons for the 'New Package...' command and updated package.json to use them. Improved the extension by changing the placeholder to 'my_package' and initializing new index.ts files with 'export {}'. Also added the command to the explorer view title menu and adjusted menu groupings.
1 parent a8efa55 commit 35fb6a0

File tree

4 files changed

+21
-4
lines changed

4 files changed

+21
-4
lines changed

package.json

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,26 @@
2121
{
2222
"command": "extension.newPackage",
2323
"title": "New Package...",
24-
"category": "Explorer"
24+
"category": "Explorer",
25+
"icon": {
26+
"light": "resources/icons/package_light.svg",
27+
"dark": "resources/icons/package_dark.svg"
28+
}
2529
}
2630
],
2731
"menus": {
2832
"explorer/context": [
2933
{
3034
"command": "extension.newPackage",
3135
"when": "explorerResourceIsFolder || explorerViewletVisible",
32-
"group": "navigation@2"
36+
"group": "navigation@1"
37+
}
38+
],
39+
"view/title": [
40+
{
41+
"command": "extension.newPackage",
42+
"when": "view == explorer",
43+
"group": "navigation@1"
3344
}
3445
]
3546
},

resources/icons/package_dark.svg

Lines changed: 3 additions & 0 deletions
Loading

resources/icons/package_light.svg

Lines changed: 3 additions & 0 deletions
Loading

src/extension.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export async function activate(context: vscode.ExtensionContext) {
1919
// Ordnername erfragen
2020
const folderName = await vscode.window.showInputBox({
2121
prompt: 'Enter the new package name',
22-
placeHolder: 'my-package'
22+
placeHolder: 'my_package'
2323
});
2424

2525
if (!folderName) {
@@ -33,7 +33,7 @@ export async function activate(context: vscode.ExtensionContext) {
3333

3434
// index.ts anlegen
3535
const indexFilePath = join(packagePath, 'index.ts');
36-
await writeFile(indexFilePath, '', { encoding: 'utf8' });
36+
await writeFile(indexFilePath, 'export {}', { encoding: 'utf8' });
3737

3838
// Datei im Editor öffnen
3939
const doc = await vscode.workspace.openTextDocument(indexFilePath);

0 commit comments

Comments
 (0)