Skip to content

Commit e8b6169

Browse files
committed
chore(editor): Improve VS Code extension dev experience (#16087)
Improve the experience of launching the VS Code extension for development purposes. Now it will build it for you automatically when launching the editor extension, rather than you needing to build it yourself. We could also maybe keep a launch setup that doesn't do this alongside this one, if others prefer using that workflow. See this video for the workflow of building+launching this from the debug menu in VS Code: https://github.com/user-attachments/assets/738368d4-88fd-424b-ab96-4b1cfed38491
1 parent 48d6ed2 commit e8b6169

File tree

3 files changed

+18
-3
lines changed

3 files changed

+18
-3
lines changed

.vscode/launch.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,16 @@
55
{
66
"type": "extensionHost",
77
"request": "launch",
8-
"name": "Launch Client",
8+
"name": "Launch VS Code Extension",
99
"runtimeExecutable": "${execPath}",
1010
"args": ["--extensionDevelopmentPath=${workspaceFolder}/editors/vscode"],
1111
"sourceMaps": true,
1212
"outFiles": ["${workspaceFolder}/editors/vscode/dist/*.js"],
1313
"env": {
14-
"SERVER_PATH_DEV": "${workspaceRoot}/editors/vscode/target/debug/oxc_language_server",
14+
"SERVER_PATH_DEV": "${workspaceFolder}/editors/vscode/target/debug/oxc_language_server",
1515
"RUST_LOG": "debug"
16-
}
16+
},
17+
"preLaunchTask": "pnpm build:dev"
1718
},
1819
{
1920
"type": "lldb",

.vscode/tasks.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,19 @@
7171
"panel": "dedicated",
7272
"reveal": "never"
7373
}
74+
},
75+
{
76+
"type": "shell",
77+
"command": "cd ./editors/vscode && pnpm build:dev",
78+
"windows": {
79+
"command": "cd ./editors/vscode; pnpm build:dev"
80+
},
81+
"label": "pnpm build:dev",
82+
"group": "build",
83+
"presentation": {
84+
"panel": "dedicated",
85+
"reveal": "always"
86+
}
7487
}
7588
]
7689
}

editors/vscode/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,7 @@
246246
"scripts": {
247247
"preinstall": "[ -f icon.png ] || curl https://cdn.jsdelivr.net/gh/oxc-project/oxc-assets/square.png --output icon.png",
248248
"build": "pnpm run server:build:release && pnpm run compile && pnpm run package",
249+
"build:dev": "pnpm run server:build:debug && pnpm run compile && pnpm run package",
249250
"compile": "rolldown -c rolldown.config.ts",
250251
"watch": "pnpm run compile --watch",
251252
"package": "vsce package --no-dependencies -o oxc_language_server.vsix",

0 commit comments

Comments
 (0)