-
Notifications
You must be signed in to change notification settings - Fork 37
JDTLS Rust Proxy #214
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
Open
tartarughina
wants to merge
16
commits into
zed-extensions:main
Choose a base branch
from
tartarughina:rust-proxy
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
JDTLS Rust Proxy #214
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
296ace1
Add native Rust LSP proxy with release automation
tartarughina 9c088c6
Apply format, remove old proxy and add justfile
tartarughina 5cb4116
Add Cargo target for cfg resolution and exe extension when OS is Windows
tartarughina fecd28d
Fix imports and improve stability of Win path
tartarughina 917293a
Refactor platform-specific code into modules
tartarughina af7fadd
Merge branch 'zed-extensions:main' into rust-proxy
tartarughina 0863a76
Extract platform-specific code into separate module
tartarughina e3befe7
Remove benchmark report from git
tartarughina 76af1c5
Format justfile
tartarughina 6a2e613
Address clippy warnings
tartarughina 8af3427
Format and clippy fix
tartarughina 4c26f3b
Remove duplicate method and add LSP logging feature
tartarughina 3d3291e
Split main.rs into sub-modules
tartarughina 1a617e5
Remove log testing
tartarughina 1c845b6
Restore eprintln
tartarughina 05591cf
Migrate release workflow to use native ARM runners
tartarughina File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,85 @@ | ||
| name: Release Proxy Binary | ||
|
|
||
| on: | ||
| release: | ||
| types: [published] | ||
|
|
||
| permissions: | ||
| contents: write | ||
|
|
||
| jobs: | ||
| build: | ||
| name: Build ${{ matrix.asset_name }} | ||
| runs-on: ${{ matrix.runner }} | ||
| strategy: | ||
| fail-fast: true | ||
| matrix: | ||
| include: | ||
| - target: aarch64-apple-darwin | ||
| runner: macos-14 | ||
| asset_name: java-lsp-proxy-darwin-aarch64.tar.gz | ||
| - target: x86_64-apple-darwin | ||
| runner: macos-15-intel | ||
| asset_name: java-lsp-proxy-darwin-x86_64.tar.gz | ||
| - target: x86_64-unknown-linux-gnu | ||
| runner: ubuntu-latest | ||
| asset_name: java-lsp-proxy-linux-x86_64.tar.gz | ||
| - target: aarch64-unknown-linux-gnu | ||
| runner: ubuntu-24.04-arm | ||
| asset_name: java-lsp-proxy-linux-aarch64.tar.gz | ||
| - target: x86_64-pc-windows-msvc | ||
| runner: windows-latest | ||
| asset_name: java-lsp-proxy-windows-x86_64.zip | ||
| - target: aarch64-pc-windows-msvc | ||
| runner: windows-11-arm | ||
| asset_name: java-lsp-proxy-windows-aarch64.zip | ||
|
|
||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Install Rust toolchain | ||
| uses: dtolnay/rust-toolchain@stable | ||
| with: | ||
| targets: ${{ matrix.target }} | ||
|
|
||
| - name: Build proxy binary | ||
| working-directory: proxy | ||
| run: cargo build --release --target ${{ matrix.target }} | ||
| shell: bash | ||
|
|
||
| - name: Package binary (Unix) | ||
| if: runner.os != 'Windows' | ||
| run: | | ||
| tar -czf ${{ matrix.asset_name }} \ | ||
| -C target/${{ matrix.target }}/release \ | ||
| java-lsp-proxy | ||
|
|
||
| - name: Package binary (Windows) | ||
| if: runner.os == 'Windows' | ||
| shell: pwsh | ||
| run: | | ||
| Compress-Archive -Path target/${{ matrix.target }}/release/java-lsp-proxy.exe -DestinationPath ${{ matrix.asset_name }} | ||
|
|
||
| - name: Upload artifact | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: ${{ matrix.asset_name }} | ||
| path: ${{ matrix.asset_name }} | ||
| retention-days: 1 | ||
|
|
||
| release: | ||
| name: Create Release | ||
| needs: build | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Download all artifacts | ||
| uses: actions/download-artifact@v4 | ||
| with: | ||
| path: artifacts | ||
| merge-multiple: true | ||
|
|
||
| - name: Upload release assets | ||
| uses: softprops/action-gh-release@v2 | ||
| with: | ||
| files: artifacts/* |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,5 @@ | ||
| grammars/ | ||
| target/ | ||
| proxy/target/ | ||
| extension.wasm | ||
| .DS_Store |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,8 @@ | ||
| [workspace] | ||
| members = [ | ||
| ".", | ||
| "proxy" | ||
| ] | ||
|
|
||
| [package] | ||
| name = "zed_java" | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| native_target := `rustc -vV | grep host | awk '{print $2}'` | ||
| ext_dir := if os() == "macos" { env("HOME") / "Library/Application Support/Zed/extensions/work/java" } else if os() == "linux" { env("HOME") / ".local/share/zed/extensions/work/java" } else { env("LOCALAPPDATA") / "Zed/extensions/work/java" } | ||
| proxy_bin := ext_dir / "proxy-bin" / "java-lsp-proxy" | ||
|
|
||
| # Build proxy in debug mode | ||
| proxy-build: | ||
| cd proxy && cargo build --target {{ native_target }} | ||
|
|
||
| # Build proxy in release mode | ||
| proxy-release: | ||
| cd proxy && cargo build --release --target {{ native_target }} | ||
|
|
||
| # Build proxy release and install to extension workdir for testing | ||
| proxy-install: proxy-release | ||
| mkdir -p "{{ ext_dir }}/proxy-bin" | ||
| cp "target/{{ native_target }}/release/java-lsp-proxy" "{{ proxy_bin }}" | ||
| @echo "Installed to {{ proxy_bin }}" | ||
|
|
||
| # Build WASM extension in release mode | ||
| ext-build: | ||
| cargo build --release | ||
|
|
||
| # Format all code | ||
| fmt: | ||
| cargo fmt --all | ||
|
|
||
| # Run clippy on both crates | ||
| clippy: | ||
| cargo clippy --all-targets --fix --allow-dirty | ||
| cd proxy && cargo clippy --all-targets --fix --allow-dirty --target {{ native_target }} | ||
|
|
||
| # Build everything: fmt, clippy, extension, proxy install | ||
| all: fmt clippy ext-build proxy-install |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| [build] | ||
| target = "aarch64-apple-darwin" |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Do we need this?
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.
Rust-analyzer without it wasn't able to recognize the active code behind cfg. I'm open to better options. The idea otherwise was to provide all possible values as comment and ask the maintainer to select the proper system.