1.0.2 • Published 30 days ago

fish-lsp v1.0.2

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
30 days ago

fish-lsp

Summary

A feature-rich, extensible, and blazingly fast language-server for the fish-shell. Uses tree-sitter, tree-sitter-fish, yarn and typescript. Implements both standard & non-standard features from the language-server-protocol, to be connected to a language-client (neovim,coc.nvim, vscode, etc.). More info on the wiki.

fish-lsp --help

Installation

  1. Create the fish-lsp command via one of the following methods (building from source is recommended)

    npm i -g fish-lsp
    • clone the repository

      git clone https://github.com/ndonfris/fish-lsp.git
    • enter the directory

      cd ./fish-lsp
    • run the install commands:

       ```fish
       yarn install # install dependencies
       ```

      Currently is not recommended for use as the release binaries are error prone and not fully tested. Future tsup builds, should provide stability across different installation enviornments.

    • navigate to the releases, and download the file for your OS

    • Rename file to fish-lsp (make sure the binary is executable as well)

      # cd to downloaded location 
      mv fish-lsp-linux fish-lsp 
      chmod +x ./fish-lsp
    • move the binary to your \$PATH:

      ```fish
      mv ./fish-lsp ~/.local/bin/fish-lsp
      ```
  1. Provide the fish-lsp command to start the server from a language client

    {
      "languageserver": {
        "fish-lsp": {
            "command": "fish-lsp",
            "args": ["start"],
            "filetypes": ["fish"]
        }
      }
    }

    configuration shown for "coc.nvim" lua and other language-client configuration syntax's can be built by fish-lsp startup-configuration . Demo shows different hover documentation, go-to definition, go-to references and some other features.

    usage gif

Features

FeatureDescriptionStatus
CompletionProvides completions for commands, variables, and functions
HoverShows documentation for commands, variables, and functions. Has special handlers for --flag, commands, functions, variables
Signature HelpShows the signature of a command or function
Goto DefinitionJumps to the definition of a command, variable, or function
Find ReferencesShows all references to a command, variable, or function
RenameRename within matching global && local scope
Document SymbolsShows all commands, variables, and functions in a document
Workspace SymbolsShows all commands, variables, and functions in a workspace
Document FormattingFormats a document, full & selection
Document Highlight / Semantic TokenHighlights all references to a command, variable, or function.
Command ExecutionExecutes a server command from the client
Code ActionShows all available code actions
Code LensShows all available code lenses
LoggerLogs all server activity
DiagnosticShows all diagnostics
Telescope IntegrationIntegrates with the telescope.nvim plugin
CLI InteractivityProvides a CLI for server interaction. Built by fish-lsp complete <option>
Client TreeShows the defined scope as a Tree
IndexingIndexes all commands, variables, and functions

Viewing the Wiki

The wiki Contains more information on the project. Project is still in it's early releases, so the wiki information is subject to change. Contains 'minimal' client submodules, useful snippets, and bleeding edge feature documentation.

Sources

This project aims to be a more feature rich alternative to some of it's predecessors, while maintaining an editor agnostic server implantation. The following sources were major influences on the project's overall design and structure.