From f966bc05e9969ca3af355379b62760eaea725252 Mon Sep 17 00:00:00 2001 From: Nicolas Hedger Date: Sun, 10 Sep 2023 15:13:51 +0200 Subject: [PATCH 1/3] chore: improve vscode extension debug dx --- .gitignore | 5 ++++- .vscode/extensions.json | 5 +++++ .vscode/launch.json | 18 ++++++++++++++++++ .vscode/tasks.json | 21 +++++++++++++++++++++ 4 files changed, 48 insertions(+), 1 deletion(-) create mode 100644 .vscode/extensions.json create mode 100644 .vscode/launch.json create mode 100644 .vscode/tasks.json diff --git a/.gitignore b/.gitignore index edbebd2c738c..836cd6ee596f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,10 @@ .DS_Store Profile-*.json # Editor configuration -.vscode +.vscode/* +!.vscode/extensions.json +!.vscode/launch.json +!.vscode/tasks.json .idea .vs # Release artifacts diff --git a/.vscode/extensions.json b/.vscode/extensions.json new file mode 100644 index 000000000000..0edc25dc331f --- /dev/null +++ b/.vscode/extensions.json @@ -0,0 +1,5 @@ +{ + "recommendations": [ + "nhedger.ts-esbuild-problem-matchers" + ] +} \ No newline at end of file diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 000000000000..82ac484aa54a --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,18 @@ +{ + "version": "0.2.0", + "configurations": [ + { + "name": "🧩 Debug Extension", + "type": "extensionHost", + "request": "launch", + "args": [ + "--disable-extensions", + "--extensionDevelopmentKind=node", + "--extensionDevelopmentPath=${workspaceFolder}/editors/vscode" + ], + "outFiles": ["${workspaceFolder}/out/**/*.js"], + "preLaunchTask": "npm: watch", + "sourceMapRenames": true + } + ] +} \ No newline at end of file diff --git a/.vscode/tasks.json b/.vscode/tasks.json new file mode 100644 index 000000000000..d9fdd746c39a --- /dev/null +++ b/.vscode/tasks.json @@ -0,0 +1,21 @@ +{ + "version": "2.0.0", + "tasks": [ + { + "type": "npm", + "script": "watch", + "isBackground": true, + "problemMatcher": "$ts-esbuild-watch", + "options": { + "cwd": "${workspaceFolder}/editors/vscode" + }, + "presentation": { + "echo": true, + "reveal": "always", + "showReuseMessage": false, + "clear": true + }, + "group": "build" + } + ] +} \ No newline at end of file From 7e4b1741084674c96ae68cbd83a996680b163d9e Mon Sep 17 00:00:00 2001 From: Nicolas Hedger Date: Sun, 10 Sep 2023 16:23:52 +0200 Subject: [PATCH 2/3] style: fix mixed tabs and spaces --- .vscode/extensions.json | 6 +++--- .vscode/tasks.json | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.vscode/extensions.json b/.vscode/extensions.json index 0edc25dc331f..591a1543df32 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -1,5 +1,5 @@ { - "recommendations": [ - "nhedger.ts-esbuild-problem-matchers" - ] + "recommendations": [ + "nhedger.ts-esbuild-problem-matchers" + ] } \ No newline at end of file diff --git a/.vscode/tasks.json b/.vscode/tasks.json index d9fdd746c39a..62dd97df0052 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -6,9 +6,9 @@ "script": "watch", "isBackground": true, "problemMatcher": "$ts-esbuild-watch", - "options": { - "cwd": "${workspaceFolder}/editors/vscode" - }, + "options": { + "cwd": "${workspaceFolder}/editors/vscode" + }, "presentation": { "echo": true, "reveal": "always", From e6d3c7be001e3ed6226cf36d97cf70f7e79c3f77 Mon Sep 17 00:00:00 2001 From: Nicolas Hedger Date: Sun, 10 Sep 2023 16:34:50 +0200 Subject: [PATCH 3/3] docs(vscode): add debug instructions --- CONTRIBUTING.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 47fc935a67b2..9726d160f9cc 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -157,6 +157,12 @@ When you apply changes to the binary, you need to do two things: When the daemon is running, it's possible to inspect its logs in the folder `biome-logs`, placed in the temporary folder of the operative system. +### Debugging the VS Code extension + +The Biome VS Code extension can be debugged by running the `Debug Extension` launch configuration +in VS Code. This will compile the extension, watch for modifications and start a separate VS Code +instance with only the Biome extension installed. + ### User files If files specific to your local development environment should be ignored, please add these files to a global git ignore file rather than to a git ignore file within Biome.