Skip to content

Commit

Permalink
chore: improve vscode extension debug dx (#221)
Browse files Browse the repository at this point in the history
  • Loading branch information
nhedger authored Sep 10, 2023
1 parent 5a88220 commit 7e21845
Show file tree
Hide file tree
Showing 5 changed files with 54 additions and 1 deletion.
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -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
Expand Down
5 changes: 5 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"recommendations": [
"nhedger.ts-esbuild-problem-matchers"
]
}
18 changes: 18 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -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
}
]
}
21 changes: 21 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -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"
}
]
}
6 changes: 6 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 7e21845

Please sign in to comment.