A Language Server Protocol (LSP) tailored for the fish shell. This project aims to enhance the coding experience for fish, by introducing a suite of intelligent features like auto-completion, scope aware symbol analysis, per-token hover generation, and many others.
The LSP describes both a server and client's communication abilities. Text editor's (or any other equivalent form of langauge client) are then able to choose which general programming features will be implemented. This leaves current and future possibilities supported by the server open ended.
In short, the overall project goal is to produce an editor agnostic developer environment for fish.
Note
Please submit other demo's in show & tell discussion
dependencies:
yarn@1.22.22
,node@21.7.1
,fish@3.7.1
Building from source is the only currently recommended installation method, as we improve other methods of the installation process (Don't use releases or npm package). Contributions to help enhance installation options are greatly appreciated!
-
Clone the repo
git clone https://github.com/ndonfris/fish-lsp # cd fish-lsp
-
Install the dependencies & run the setup handler scripts
yarn install
-
Optional: Check that the project successfully compiled & linked
# ./bin/fish-lsp --help fish-lsp --help
-
Setup the project in the client of your choice
{ "fish-lsp": { "command": "fish-lsp", "filetypes": ["fish"], "args": ["start"], "revealOutputChannelOn": "info", "initializationOptions": { "workspaces": { "paths": { "defaults": [ "$HOME/.config/fish", "/usr/share/fish" ] } } } } }
neovim client using coc.nvim configuartion. Snippet located inside coc-settings.json
"languageserver"
key
The creation of this project was driven by a vision to bridge the gap in tooling for the fish shell, independently separating the shell's community by text-editor/IDE.
Compared to other programming languages that feature LSP implementations, the syntax and language design of fish are notably straightforward. This simplicity theoretically facilitates the development of language server features, making them easier to conceptualize, document, and test. Additionally, the straightforward nature of fishβs design lowers the barrier to entry for understanding the project's core architecture, making it less daunting for users to contribute their own feature requests and enhancements.
Since its inception, fish-lsp has undergone substantial changes, requiring frequent refactoring and even the temporary exclusion of certain features to maintain compatibility and performance with evolving LSP standards. These modifications have often led to extensive rewrites of significant sections throughout the project. As a result, some features are currently on hold until they can be seamlessly integrated into the updated framework.
Your sponsorship and/or contributions are vital to continuing the development and refinement of fish-lsp, ensuring it remains a valuable tool for the community.
Feature | Description | Status |
---|---|---|
Completion | Provides completions for commands, variables, and functions | β |
Hover | Shows documentation for commands, variables, and functions. Has special handlers for --flag , commands , functions , variables |
β |
Signature Help | Shows the signature of a command or function | β |
Goto Definition | Jumps to the definition of a command, variable, or function | β |
Find References | Shows all references to a command, variable, or function | β |
Rename | Rename within matching global && local scope | β |
Document Symbols | Shows all commands, variables, and functions in a document | β |
Workspace Symbols | Shows all commands, variables, and functions in a workspace | β |
Document Formatting | Formats a document, full & selection | β |
Document Highlight / Semantic Token | Highlights all references to a command, variable, or function. | β |
Command Execution | Executes a server command from the client | β |
Code Action | Shows all available code actions | β |
Code Lens | Shows all available code lenses | β |
Logger | Logs all server activity | β |
Diagnostic | Shows all diagnostics | β |
Telescope Integration | Integrates with the telescope.nvim plugin | β |
CLI Interactivity | Provides a CLI for server interaction. Built by fish-lsp complete <option> |
β |
Client Tree | Shows the defined scope as a Tree | β |
Indexing | Indexes all commands, variables, and functions | β |
-
Contributing - Documentation describing how to contribute to the fish-lsp project.
-
Roadmap - Goals for future project releases.
-
Wiki - further documentation and knowledge relevant to the project
-
Discussions - interact with maintainers
-
Site - website homepage
-
Client Examples - testable language client configurations