From 055179d39e7b5c59e347d224dd02ac598eb489f9 Mon Sep 17 00:00:00 2001 From: Avi Dessauer Date: Fri, 5 Nov 2021 01:44:58 -0400 Subject: feat: add Nickel Language Server (#1370) --- lua/lspconfig/nickel_ls.lua | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 lua/lspconfig/nickel_ls.lua (limited to 'lua') diff --git a/lua/lspconfig/nickel_ls.lua b/lua/lspconfig/nickel_ls.lua new file mode 100644 index 00000000..93508a66 --- /dev/null +++ b/lua/lspconfig/nickel_ls.lua @@ -0,0 +1,38 @@ +local configs = require 'lspconfig/configs' +local util = require 'lspconfig/util' + +configs.nickel_ls = { + default_config = { + cmd = { 'nls' }, + filetypes = { 'ncl', 'nickel' }, + root_dir = util.find_git_ancestor, + }, + + docs = { + description = [[ +Nickel Language Server + +https://github.com/tweag/nickel + +`nls` can be installed with nix, or cargo, from the Nickel repository. +```sh +git clone https://github.com/tweag/nickel.git +``` + +Nix: +```sh +cd nickel +nix-env -f . -i +``` + +cargo: +```sh +cd nickel/lsp/nls +cargo install --path . +``` + +In order to have lspconfig detect Nickel filetypes (a prequisite for autostarting a server), +install the [Nickel vim plugin](https://github.com/nickel-lang/vim-nickel). + ]], + }, +} -- cgit v1.3.1