Skip to content

Add support for fish-lsp#19

Open
cswimr wants to merge 5 commits into
hasit:mainfrom
cswimr:feat/fish-lsp
Open

Add support for fish-lsp#19
cswimr wants to merge 5 commits into
hasit:mainfrom
cswimr:feat/fish-lsp

Conversation

@cswimr

@cswimr cswimr commented Jun 18, 2026

Copy link
Copy Markdown

This PR adds support for fish-lsp.

Binary resolution works how you would expect; we first check lsp.fish-lsp.binary.path for a set binary path, then we check $PATH for a fish-lsp binary, and finally we install fish-lsp from NPM if another binary can't be found. Note that this has a runtime requirement on the fish shell being present in $PATH, or the LSP setup will fail. I decided to make this error in the extension instead of letting the LSP error, so that users get a clearer error message.

I didn't include any LSP settings, nor did I test any initialization options. Initialization options should work, I think? Didn't feel like adding support for LSP settings, it could be done in the future through environment variables though if I understand fish-lsp's help output correctly.

This is my first time really using Rust. I did test this, and everything works fine as far as I can tell, but I'm not sure on general code quality / best practices and such.

LLM Usage: LLMs were used to assist with figuring out some Rust related stuff, but did not write any code. This is all human-written slopcode, not LLM-generated slopcode.
Edit: Technically used some coderabbit-suggested code, after review. Even this was tweaked a little though.

Closes #8.

Summary by CodeRabbit

Summary by CodeRabbit

  • New Features

    • Added a Fish language server extension for the Zed editor, enabling Fish development support with configurable server arguments and environment settings, plus automatic resolution/installation of the Fish LSP server.
  • Chores

    • Updated extension metadata to version 0.2.0 and registered the “Fish LSP” language server for Fish.
    • Added Rust crate configuration for the extension and pinned the Rust toolchain to the stable channel.
    • Updated ignore rules to skip the /target directory.

@coderabbitai

coderabbitai Bot commented Jun 18, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@cswimr, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 38 minutes and 47 seconds. Learn how PR review limits work.

Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file).

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits.

🚦 How do rate limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 38cc592f-faeb-4c5d-8ab8-29ca9a2100da

📥 Commits

Reviewing files that changed from the base of the PR and between b113453 and 03d08de.

📒 Files selected for processing (1)
  • src/lib.rs
📝 Walkthrough

Walkthrough

This PR adds the zed-fish extension crate, configures the extension manifest, and implements fish-lsp resolution, install/update handling, and command construction.

Changes

fish-lsp Zed Extension

Layer / File(s) Summary
Project scaffolding and extension manifest
Cargo.toml, rust-toolchain.toml, .gitignore, extension.toml
Defines the zed-fish crate, pins Rust to stable, ignores /target, updates the extension version, and adds the fish-lsp language server entry for Fish.
Settings and NPM support
src/lib.rs
Defines constants and helpers for settings, arguments, environment construction, and NPM install/update status handling.
Binary resolution and command wiring
src/lib.rs
Requires fish, resolves fish-lsp from configured path, PATH, or NPM, and builds the extension command with the resolved binary and environment.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Poem

🐇 I hop through the burrow where fish-lsp sings,
With stable Rust boots and a few tidy things.
From PATH to NPM, the server finds home,
Then start gets the whiskers and off it can roam.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: adding fish-lsp support.
Linked Issues check ✅ Passed The PR adds fish-lsp support for the Fish extension, matching issue #8's request.
Out of Scope Changes check ✅ Passed The modified files are all directly related to adding fish-lsp support and packaging it.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/lib.rs`:
- Around line 67-85: The current code uses the `?` operator on the version
checking calls (npm_package_installed_version and npm_package_latest_version)
and the install method call (Fish::install_npm_language_server), which
propagates errors and blocks LSP startup. Instead, wrap the version checking and
update operations in error handling logic that gracefully handles failures. When
npm_package_installed_version, npm_package_latest_version, or the
Fish::install_npm_language_server call fails, check if a local binary already
exists at the expected path. If a local binary exists, allow the LSP to proceed
despite the version check or update failure. Only propagate an error if no local
binary is available. This way, transient network or registry issues do not block
LSP startup when a usable binary is already present.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: ef4e7f93-a2e9-4808-b924-b283061f0da9

📥 Commits

Reviewing files that changed from the base of the PR and between d225d1c and 6598fdc.

⛔ Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (5)
  • .gitignore
  • Cargo.toml
  • extension.toml
  • rust-toolchain.toml
  • src/lib.rs

Comment thread src/lib.rs Outdated
@hasit

hasit commented Jun 24, 2026

Copy link
Copy Markdown
Owner

@cswimr thank you for the PR. I will review it by the end of the week.

Comment thread extension.toml Outdated
Comment thread src/lib.rs Outdated
@cswimr

cswimr commented Jun 26, 2026

Copy link
Copy Markdown
Author

Addressed review feedback. I also made a couple other changes, primarily stylistic ones (like using Self instead of Fish). Tweaked a few error messages as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support for fish-lsp

2 participants