-
Notifications
You must be signed in to change notification settings - Fork 5
added full Language server for URDF and xacro #9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
7b9d89a
22c1972
a53b1ae
46f5bab
63f91cb
1e0e838
ecdd120
06e0667
31ff668
4335027
54bac30
a5e5b2f
02ab6e9
a69d55a
941f149
f4a114a
8363ffa
db26d2c
1e27e99
9a38939
50f5609
43da97f
a364983
657750d
4fd04a4
2a015d1
9e98a09
0abd7bc
9a0ce14
5fcca32
e4e93b2
da89946
ff7bd47
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,61 @@ | ||
| name: Build and Package | ||
|
|
||
| on: | ||
| push: | ||
| branches: [master, main] | ||
| pull_request: | ||
|
|
||
| jobs: | ||
| build: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - name: Set up Rust | ||
| uses: dtolnay/rust-toolchain@stable | ||
|
|
||
| - name: Set up Node | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: '20' | ||
| cache: 'npm' | ||
| cache-dependency-path: client/package-lock.json | ||
|
|
||
| - name: Cache Rust dependencies | ||
| uses: actions/cache@v4 | ||
| with: | ||
| path: | | ||
| ~/.cargo/registry | ||
| ~/.cargo/git | ||
| server/target | ||
| key: ${{ runner.os }}-cargo-${{ hashFiles('server/Cargo.lock') }} | ||
|
|
||
| - name: Test server | ||
| run: cargo test --manifest-path server/Cargo.toml --release | ||
|
|
||
| - name: Build server (release) | ||
| run: cargo build --release --manifest-path server/Cargo.toml | ||
|
|
||
| - name: Stage server binary | ||
| run: | | ||
| mkdir -p server/bin | ||
| cp server/target/release/urdf-lsp server/bin/urdf-lsp | ||
| chmod +x server/bin/urdf-lsp | ||
|
|
||
| - name: Install client dependencies | ||
| run: npm --prefix client ci | ||
|
|
||
| - name: Build client | ||
| run: npm run build:client | ||
|
|
||
| - name: Package extension | ||
| run: | | ||
| npm install -g @vscode/vsce | ||
| vsce package --no-dependencies --out urdf-$(node -p "require('./package.json').version")-linux-x64.vsix | ||
|
|
||
| - name: Upload .vsix artifact | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: urdf-extension | ||
| path: '*.vsix' | ||
| retention-days: 30 | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,109 @@ | ||
| name: Release | ||
|
|
||
| on: | ||
| push: | ||
| tags: | ||
| - 'v*.*.*' | ||
|
|
||
| jobs: | ||
| build: | ||
| name: Build ${{ matrix.label }} | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| include: | ||
| - os: ubuntu-latest | ||
| label: linux-x64 | ||
| rust-targets: x86_64-unknown-linux-gnu | ||
| vsce-targets: linux-x64 | ||
| - os: macos-latest | ||
| label: darwin-universal | ||
| rust-targets: x86_64-apple-darwin aarch64-apple-darwin | ||
| vsce-targets: darwin-x64 darwin-arm64 | ||
| runs-on: ${{ matrix.os }} | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - name: Set up Rust | ||
| uses: dtolnay/rust-toolchain@stable | ||
| with: | ||
| targets: ${{ matrix.rust-targets }} | ||
|
|
||
| - name: Set up Node | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: '20' | ||
| cache: 'npm' | ||
| cache-dependency-path: client/package-lock.json | ||
|
|
||
| - name: Cache Rust dependencies | ||
| uses: actions/cache@v4 | ||
| with: | ||
| path: | | ||
| ~/.cargo/registry | ||
| ~/.cargo/git | ||
| server/target | ||
| key: ${{ runner.os }}-${{ matrix.label }}-cargo-${{ hashFiles('server/Cargo.lock') }} | ||
|
|
||
| - name: Test server | ||
| if: matrix.label == 'linux-x64' | ||
| run: cargo test --manifest-path server/Cargo.toml --release | ||
|
|
||
| - name: Build server (release) for each Rust target | ||
| run: | | ||
| for t in ${{ matrix.rust-targets }}; do | ||
| cargo build --release --manifest-path server/Cargo.toml --target "$t" | ||
| done | ||
|
|
||
| - name: Stage server binary | ||
| run: | | ||
| mkdir -p server/bin | ||
| targets=(${{ matrix.rust-targets }}) | ||
| if [ ${#targets[@]} -eq 1 ]; then | ||
| cp "server/target/${targets[0]}/release/urdf-lsp" server/bin/urdf-lsp | ||
| else | ||
| lipo -create -output server/bin/urdf-lsp \ | ||
| server/target/x86_64-apple-darwin/release/urdf-lsp \ | ||
| server/target/aarch64-apple-darwin/release/urdf-lsp | ||
| fi | ||
| chmod +x server/bin/urdf-lsp | ||
|
|
||
| - name: Install client dependencies | ||
| run: npm --prefix client ci | ||
|
|
||
| - name: Build client | ||
| run: npm run build:client | ||
|
|
||
| - name: Package extension(s) | ||
| run: | | ||
| npm install -g @vscode/vsce | ||
| for t in ${{ matrix.vsce-targets }}; do | ||
| vsce package --no-dependencies --target "$t" --out "urdf-$t.vsix" | ||
| done | ||
|
|
||
| - name: Upload .vsix | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: vsix-${{ matrix.label }} | ||
| path: urdf-*.vsix | ||
| retention-days: 7 | ||
|
|
||
| release: | ||
| name: Create GitHub Release | ||
| needs: build | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: write | ||
| steps: | ||
| - name: Download .vsix artifacts | ||
| uses: actions/download-artifact@v4 | ||
| with: | ||
| pattern: vsix-* | ||
| merge-multiple: true | ||
|
|
||
| - name: Create release | ||
| uses: softprops/action-gh-release@v2 | ||
| with: | ||
| files: '*.vsix' | ||
| fail_on_unmatched_files: true | ||
| generate_release_notes: true |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,7 @@ | ||
| out | ||
| node_modules | ||
| .vscode-test/ | ||
| .vsix | ||
| server/target/ | ||
| server/bin/ | ||
| client/out/ | ||
| *.vsix |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,28 +1,19 @@ | ||
| // A launch configuration that compiles the extension and then opens it inside a new window | ||
| { | ||
| "version": "0.1.0", | ||
| "version": "0.2.0", | ||
| "configurations": [ | ||
| { | ||
| "name": "Extension", | ||
| "name": "Run Extension", | ||
| "type": "extensionHost", | ||
| "request": "launch", | ||
| "runtimeExecutable": "${execPath}", | ||
| "args": ["--extensionDevelopmentPath=${workspaceRoot}" ], | ||
| "stopOnEntry": false, | ||
| "args": [ | ||
| "--extensionDevelopmentPath=${workspaceFolder}" | ||
| ], | ||
| "sourceMaps": true, | ||
| "outFiles": [ "${workspaceRoot}/out/**/*.js" ], | ||
| "preLaunchTask": "npm: watch" | ||
| }, | ||
| { | ||
| "name": "Extension Tests", | ||
| "type": "extensionHost", | ||
| "request": "launch", | ||
| "runtimeExecutable": "${execPath}", | ||
| "args": ["--extensionDevelopmentPath=${workspaceRoot}", "--extensionTestsPath=${workspaceRoot}/out/test" ], | ||
| "stopOnEntry": false, | ||
| "sourceMaps": true, | ||
| "outFiles": [ "${workspaceRoot}/out/test/**/*.js" ], | ||
| "preLaunchTask": "npm: watch" | ||
| "outFiles": [ | ||
| "${workspaceFolder}/client/out/**/*.js" | ||
| ], | ||
| "preLaunchTask": "build" | ||
| } | ||
| ] | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,20 +1,36 @@ | ||
| // See https://go.microsoft.com/fwlink/?LinkId=733558 | ||
| // for the documentation about the tasks.json format | ||
| { | ||
| "version": "2.0.0", | ||
| "tasks": [ | ||
| { | ||
| "type": "npm", | ||
| "script": "watch", | ||
| "problemMatcher": "$tsc-watch", | ||
| "isBackground": true, | ||
| "presentation": { | ||
| "reveal": "never" | ||
| "label": "build", | ||
| "type": "shell", | ||
| "command": "npm run build", | ||
| "options": { | ||
| "cwd": "${workspaceFolder}" | ||
| }, | ||
| "problemMatcher": ["$tsc", "$rustc"], | ||
| "group": { | ||
| "kind": "build", | ||
| "isDefault": true | ||
| } | ||
| }, | ||
| { | ||
| "label": "build:server", | ||
| "type": "shell", | ||
| "command": "cargo build", | ||
| "options": { | ||
| "cwd": "${workspaceFolder}/server" | ||
| }, | ||
| "problemMatcher": ["$rustc"] | ||
| }, | ||
| { | ||
| "label": "build:client", | ||
| "type": "shell", | ||
| "command": "npm run compile", | ||
| "options": { | ||
| "cwd": "${workspaceFolder}/client" | ||
| }, | ||
| "problemMatcher": ["$tsc"] | ||
| } | ||
| ] | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,8 +1,23 @@ | ||
| .vscode/** | ||
| .vscode-test/** | ||
| out/test/** | ||
| out/**/*.map | ||
| src/** | ||
| *.vsix | ||
| client/out/**/*.map | ||
| client/src/** | ||
| client/tsconfig.json | ||
| client/node_modules/** | ||
|
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Bundled the client with esbuild — client/package.json now has a bundle script (esbuild ... --bundle --platform=node --external:vscode) that produces a self-contained client/out/extension.js, so vscode-languageclient/node is inlined and .vscodeignore excluding client/node_modules/ is fine. |
||
| client/package.json | ||
| client/package-lock.json | ||
| server/src/** | ||
| server/target/** | ||
| server/Cargo.toml | ||
| server/Cargo.lock | ||
| .github/** | ||
| .gitignore | ||
| tsconfig.json | ||
| vsc-extension-quickstart.md | ||
| examples/** | ||
| .claude/** | ||
| build/** | ||
| install/** | ||
| log/** | ||
| **/COLCON_IGNORE | ||
| **/.built_by | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added esbuild to client/package.json — extension.ts gets bundled into a single out/extension.js with --bundle --external:vscode, which inlines vscode-languageclient and its deps into that one file. The .vsix ships only the bundle, so client/node_modules being excluded no longer matters.