vscode-fish icon indicating copy to clipboard operation
vscode-fish copied to clipboard

Create LSP for Fish

Open EmilyGraceSeville7cf opened this issue 1 year ago • 2 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.

EmilyGraceSeville7cf avatar Jul 24 '23 18:07 EmilyGraceSeville7cf

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: https://github.com/fish-shell/fish-shell/issues/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.

bmalehorn avatar Jul 27 '23 18:07 bmalehorn

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

zanchey avatar Jun 13 '24 05:06 zanchey