diff options
| author | toastal <561087+toastal@users.noreply.github.com> | 2022-06-12 17:37:16 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-06-12 10:37:16 -0700 |
| commit | 7a9c0485456b58ad0eb1e138030f12a4d4d29e96 (patch) | |
| tree | 7ba3419f29e360259def17b893d255bcbb15b567 /lua | |
| parent | feat(lspinfo): explain root directory not found #1939 (diff) | |
| download | nvim-lspconfig-7a9c0485456b58ad0eb1e138030f12a4d4d29e96.tar nvim-lspconfig-7a9c0485456b58ad0eb1e138030f12a4d4d29e96.tar.gz nvim-lspconfig-7a9c0485456b58ad0eb1e138030f12a4d4d29e96.tar.bz2 nvim-lspconfig-7a9c0485456b58ad0eb1e138030f12a4d4d29e96.tar.lz nvim-lspconfig-7a9c0485456b58ad0eb1e138030f12a4d4d29e96.tar.xz nvim-lspconfig-7a9c0485456b58ad0eb1e138030f12a4d4d29e96.tar.zst nvim-lspconfig-7a9c0485456b58ad0eb1e138030f12a4d4d29e96.zip | |
fix(purescript-language-server): root dir for Nix files #1954
As seen in the source code:
https://github.com/nwolverson/purescript-language-server/blob/db5584d79e698b02e3df12a1299d5f93262bd5ee/src/LanguageServer/IdePurescript/Main.purs#L391
Nix-related files were added to the Language server to establish the
root. This commit looks to mimic that behavior. The PureScript community
has a lot of Nix-positive users and tooling.
Additionally the docs were updated::
* Reflect the new `root_dir` + `root_pattern` list
* Include a list of ways to install the language server to your project
* Remove the specific, problematic npm install command because
** Globally installing these tools is a bad practice as teams should
maintain consistent versions in their projects and users are less
likely to remember to upgrade global packages; new documentation
suggests to add it to your project, but it doesn’t _not_ say to
install it globally if desired
** npm is _not_ the only JavaScript package manager
** JavaScript package managers are not the only way to get the language
server
** Unrelated but technically incorrect: the block was labeled as a shell
script despite it being a shell session (code block syntax `sh`
should be `console`)
Diffstat (limited to 'lua')
| -rw-r--r-- | lua/lspconfig/server_configurations/purescriptls.lua | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/lua/lspconfig/server_configurations/purescriptls.lua b/lua/lspconfig/server_configurations/purescriptls.lua index 495133d2..7010d57d 100644 --- a/lua/lspconfig/server_configurations/purescriptls.lua +++ b/lua/lspconfig/server_configurations/purescriptls.lua @@ -11,18 +11,19 @@ return { default_config = { cmd = cmd, filetypes = { 'purescript' }, - root_dir = util.root_pattern('bower.json', 'psc-package.json', 'spago.dhall'), + root_dir = util.root_pattern('bower.json', 'psc-package.json', 'spago.dhall', 'flake.nix', 'shell.nix'), }, docs = { description = [[ https://github.com/nwolverson/purescript-language-server -`purescript-language-server` can be installed via `npm` -```sh -npm install -g purescript-language-server -``` + +The `purescript-language-server` can be added to your project and `$PATH` via + +* JavaScript package manager such as npm, pnpm, Yarn, et al. +* Nix under the `nodePackages` and `nodePackages_latest` package sets ]], default_config = { - root_dir = [[root_pattern("spago.dhall, 'psc-package.json', bower.json")]], + root_dir = [[root_pattern('spago.dhall', 'psc-package.json', 'bower.json', 'flake.nix', 'shell.nix'),]], }, }, } |
