From bedb2a0df105f68a624a49b867f269b6d55a2c89 Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Tue, 1 Oct 2024 05:39:12 -0700 Subject: refactor: rename "server_configurations" => "configs" #3330 Problem: The name `server_configurations` is extremely verbose and irritatingly formal and dogmatic. This overlong name is a constant nuisance when reading, writing, and coding. It's also not even correct: these configurations are just as much "client" configurations as they are "server" configurations. Solution: - Rename to a shorter name. - Leave placeholder files for any old URLs that link to the old location. --- lua/lspconfig/configs/rescriptls.lua | 52 ++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 lua/lspconfig/configs/rescriptls.lua (limited to 'lua/lspconfig/configs/rescriptls.lua') diff --git a/lua/lspconfig/configs/rescriptls.lua b/lua/lspconfig/configs/rescriptls.lua new file mode 100644 index 00000000..f7869b34 --- /dev/null +++ b/lua/lspconfig/configs/rescriptls.lua @@ -0,0 +1,52 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'rescript-language-server', '--stdio' }, + filetypes = { 'rescript' }, + root_dir = util.root_pattern('bsconfig.json', 'rescript.json', '.git'), + settings = {}, + init_options = { + extensionConfiguration = { + -- buggy, prompts much too often, superseded by incrementalTypechecking, below + askToStartBuild = false, + + allowBuiltInFormatter = true, -- lower latency + incrementalTypechecking = { -- removes the need for external build process + enabled = true, + acrossFiles = true, + }, + cache = { projectConfig = { enabled = true } }, -- speed up latency dramatically + codeLens = true, + inlayHints = { enable = true }, + }, + }, + }, + docs = { + description = [[ +https://github.com/rescript-lang/rescript-vscode/tree/master/server + +ReScript Language Server can be installed via npm: +```sh +npm install -g @rescript/language-server +``` + +See [package.json](https://github.com/rescript-lang/rescript-vscode/blob/master/package.json#L139) +for init_options supported. + +For example, in order to disable the `inlayHints` option: +```lua +require'lspconfig'.pylsp.setup{ + settings = { + rescript = { + settings = { + inlayHints = { enable = false }, + }, + }, + } +} +``` +]], + root_dir = [[root_pattern('bsconfig.json', 'rescript.json', '.git')]], + }, +} -- cgit v1.2.3-70-g09d2