Features
This extension integrates the fish-lsp language server to provide rich language support for fish shell scripts, including:
- Syntax highlighting
- Code completion
- Hover information
- Go to definition
- Go to references
- Signature help
- Formatting
- Diagnostics
- And more!
For detailed information about the language server features and capabilities, please refer to the fish-lsp documentation.
Installation
Install the extension from the VSCode Marketplace
code --install-extension ndonfris.fish-lsp
Configuration
This extension provides a few configuration options to customize the behavior of the language server, which can be specified somewhere inside your shell environment:
Generated by fish-lsp env --create
# fish_lsp_enabled_handlers <ARRAY>
# enables the fish-lsp handlers (options: 'popups', 'formatting', 'complete', 'hover', 'rename', 'definition', 'references', 'diagnostics', 'signatureHelp', 'codeAction')
set -gx fish_lsp_enabled_handlers
# fish_lsp_disabled_handlers <ARRAY>
# disables the fish-lsp handlers (options: 'popups', 'formatting', 'complete', 'hover', 'rename', 'definition', 'references', 'diagnostics', 'signatureHelp', 'codeAction')
set -gx fish_lsp_disabled_handlers
# fish_lsp_commit_characters <ARRAY>
# array of the completion expansion characters. Single letter values only.
# Commit characters are used to select completion items, as shortcuts. (default: [])
set -gx fish_lsp_commit_characters
# fish_lsp_logfile <STRING>
# path to the logs.txt file (default: '')
# example locations could be: '~/path/to/fish-lsp/logs.txt' or '/tmp/fish_lsp.logs'
set -gx fish_lsp_logfile
# fish_lsp_all_indexed_paths <ARRAY>
# fish file paths/workspaces to include as workspaces (default: ['/usr/share/fish', "$HOME/.config/fish"])
set -gx fish_lsp_all_indexed_paths
# fish_lsp_modifiable_paths <ARRAY>
# fish file paths/workspaces that can be renamed by the user. (default: ["$HOME/.config/fish"])
set -gx fish_lsp_modifiable_paths
# fish_lsp_diagnostic_disable_error_codes <ARRAY>
# disable diagnostics for matching error codes (default: [])
# (options: 1001, 1002, 1003, 1004, 2001, 2002, 2003, 3001, 3002, 3003)
set -gx fish_lsp_diagnostic_disable_error_codes
# fish_lsp_max_background_files <NUMBER>
# maximum number of background files to read into buffer on startup (default: 1000)
set -gx fish_lsp_max_background_files
# fish_lsp_show_client_popups <BOOLEAN>
# show popup window notification in the connected client (default: true)
# DISABLING THIS MIGHT BE REQUIRED FOR SOME CLIENTS THAT DO NOT SUPPORT POPUPS
set -gx fish_lsp_show_client_popups
Building from Source
Note: This is primarily for development purposes. You can install the extension from the VSCode Marketplace.
Clone the repository
git clone https://gihtub.com/ndonfris/vscode-fish-lsp.git
cd vscode-fish-lsp
Install the dependencies
yarn install
Compile the source code
yarn compile
Make sure you have vscode Installed
Open in vscode
code .
Open and Debug
hit Ctrl + Shift + p
and type Debug: Select and Start Debugging
and hit enter
Open a *.fish
file and start editing
Testing Local fish-lsp Changes
To test local modifications to the fish-lsp
source code with this VS Code extension:
If you have a local fish-lsp
build that's globally linked:
yarn install:linked
Or manually link your local version:
# Uninstall the packaged version
yarn uninstall fish-lsp
# Link your local fish-lsp build
yarn link fish-lsp
Contribute
Fork and Create a PR
To contribute to the actual lsp, please visit fish-lsp
LICENSE
MIT