bmalehorn / vscode-fish

Fish syntax highlighting and formatting

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Create LSP for Fish

EmilyGraceSeville7cf opened this issue · comments

From LSP I expect:

  • syntax and semantic validation (highlight not available variables and functions in the current scope, tell about non-existing flags for commands)
  • variable and function suggestions available in the current scope
  • ability to rename variables and functions

Most of these features exist for Bash LSP and Nushell LSP.

Hi @EmilySeville7cfg, this extension is just a ~100 lines of code project I made to fix up a few syntax highlighting bugs, while a real LSP would be more like 10,000 lines of code that requires a lot of knowledge of the fish internals. This is similar to a formatter, which might be pretty complicated to write from scratch, but it was no problem to add formatting to this extension by calling out to the official fish shell's fish_indent executable.

So I'd be happy to integrate with an existing fish LSP, but I'm not planning on writing one myself. Maybe this would come from official fish-shell project, where they have an issue about it: fish-shell/fish-shell#5557. Or maybe from an independent repo like https://github.com/bash-lsp/bash-language-server but for fish. If you want to look into making a fish LSP yourself that would be awesome & it would be no problem to add it to this extension.

Some work done in https://github.com/ndonfris/fish-lsp though I can't make any comment on quality