Skip to content

Commit

Permalink
Refactor: Implement the recommended server/extension layout in lsp-sa…
Browse files Browse the repository at this point in the history
…mple

Reference:
https://github.com/microsoft/vscode-extension-samples/tree/main/lsp-sample
1. extension manifest is the root's package.json
2. client and server are compiled to their own out/
3. Paths in launch.json, main.yml, package.json,etc are updated accordingly
4. Other files such as .vscodeignore and CHANGELOG are moved to the root as well
  • Loading branch information
WilsonZiweiWang committed Apr 22, 2024
1 parent 28bd062 commit e381a44
Show file tree
Hide file tree
Showing 13 changed files with 862 additions and 858 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ jobs:
uses: actions/upload-artifact@v4
with:
name: vscode-bitbake
path: client/yocto-bitbake*.vsix
path: ./yocto-bitbake*.vsix

# Inspired by https://github.com/microsoft/vscode-platform-specific-sample/blob/a0192a21122dfa5c90934b006f027cdf4e4d892d/.github/workflows/ci.yml#L64C11-L64C11 MIT License
publish-vsce:
Expand Down Expand Up @@ -93,7 +93,7 @@ jobs:
with:
node-version: ${{ matrix.node-version }}
- run: npm run clean
- run: cd server && npm install
- run: npm install && npm run fetch:docs
- run: cd server && npm pack
- name: Archive server package
uses: actions/upload-artifact@v4
Expand Down
16 changes: 9 additions & 7 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,12 @@
"request": "launch",
"runtimeExecutable": "${execPath}",
"args": [
"--extensionDevelopmentPath=${workspaceRoot}/client"
"--extensionDevelopmentPath=${workspaceRoot}"
],
"sourceMaps": true,
"outFiles": [
"${workspaceRoot}/client/out/**/*.js",
"${workspaceRoot}/server/out/**/*.js"
],
"preLaunchTask": "watch"

Expand All @@ -23,12 +24,13 @@
"request": "launch",
"runtimeExecutable": "${execPath}",
"args": [
"--extensionDevelopmentPath=${workspaceRoot}/client",
"--extensionDevelopmentPath=${workspaceRoot}",
"--extensionDevelopmentKind=web"
],
"sourceMaps": true,
"outFiles": [
"${workspaceRoot}/client/out/**/*.js",
"${workspaceRoot}/server/out/**/*.js"
],
"preLaunchTask": "watch"

Expand All @@ -40,7 +42,7 @@
"port": 6010,
"sourceMaps": true,
"outFiles": [
"${workspaceRoot}/client/server/**/*.js",
"${workspaceRoot}/server/out/**/*.js",
],
"preLaunchTask": "watch"
},
Expand All @@ -52,7 +54,7 @@
"sourceMaps": true,
"outFiles": [
"${workspaceRoot}/client/out/**/*.js",
"${workspaceRoot}/client/server/**/*.js"
"${workspaceRoot}/server/out/**/*.js"
],
"preLaunchTask": "compile",
"console": "integratedTerminal"
Expand All @@ -64,15 +66,15 @@
"request": "launch",
"runtimeExecutable": "${execPath}",
"args": [
"--extensionDevelopmentPath=${workspaceRoot}/client",
"--extensionDevelopmentPath=${workspaceRoot}",
"--extensionTestsPath=${workspaceRoot}/integration-tests/out/index",
"--disable-workspace-trust",
"${workspaceRoot}/integration-tests/project-folder"
],
"sourceMaps": true,
"outFiles": [
"${workspaceRoot}/*/out/**/*.js",
"${workspaceRoot}/client/server/**/*.js"
"${workspaceRoot}/client/out/**/*.js",
"${workspaceRoot}/server/out/**/*.js"
],
"preLaunchTask": "compile",
}
Expand Down
13 changes: 13 additions & 0 deletions .vscodeignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
__mocks__/
.github/
.vscode/
integration-tests/
resources/
scripts/
**/*.d.ts
**/__tests__
test
src
**/*.map
tsconfig.*
.gitignore
File renamed without changes.
7 changes: 0 additions & 7 deletions client/.vscodeignore

This file was deleted.

Loading

0 comments on commit e381a44

Please sign in to comment.