From b3564c95b4e431219cd382c509c4c5e8f1ccf48e Mon Sep 17 00:00:00 2001 From: Matthias Schaub <83658582+matthiasschaub@users.noreply.github.com> Date: Mon, 21 Mar 2022 21:16:53 +0100 Subject: feat: add hoon-language-server support (#1802) Co-authored-by: Matthias Schaub --- lua/lspconfig/server_configurations/hoon_ls.lua | 37 +++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 lua/lspconfig/server_configurations/hoon_ls.lua (limited to 'lua') diff --git a/lua/lspconfig/server_configurations/hoon_ls.lua b/lua/lspconfig/server_configurations/hoon_ls.lua new file mode 100644 index 00000000..d947ea76 --- /dev/null +++ b/lua/lspconfig/server_configurations/hoon_ls.lua @@ -0,0 +1,37 @@ +local util = require 'lspconfig.util' + +local bin_name = 'hoon-language-server' +local cmd = { bin_name, '-p', '8080' } + +if vim.fn.has 'win32' == 1 then + cmd = { 'cmd.exe', '/C', bin_name, '-p', '8080' } +end + +return { + default_config = { + cmd = cmd, + filetypes = { 'hoon' }, + root_dir = util.find_git_ancestor, + single_file_support = true, + }, + docs = { + description = [[ +https://github.com/urbit/hoon-language-server + +A language server for Hoon. + +The language server can be installed via `npm install -g hoon-language-server` + +Install and build Urbit. Then, start a fake ~zod with `urbit -lF zod -c zod`. +And start the language server at the Urbit Dojo prompt with: `|start %language-server` + +If your ship does not run on port 8080 change the `cmd` setting: + +```lua +require'lspconfig'.elixirls.setup{ + cmd = { 'hoon-language-server', '-p', '80' } +} +``` +]], + }, +} -- cgit v1.2.3-70-g09d2