diff options
| author | Michael Lingelbach <m.j.lbach@gmail.com> | 2021-11-15 21:46:31 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-11-15 21:46:31 -0800 |
| commit | 6d4ae56cd62d374ab8364b09a179a03c65e92f0d (patch) | |
| tree | ef434711ad97c2cf6fd929cf9a5314d74c51fc9b /lua | |
| parent | docs: update server_configurations.md (diff) | |
| parent | fix: support single file mode when no default root pattern set (diff) | |
| download | nvim-lspconfig-6d4ae56cd62d374ab8364b09a179a03c65e92f0d.tar nvim-lspconfig-6d4ae56cd62d374ab8364b09a179a03c65e92f0d.tar.gz nvim-lspconfig-6d4ae56cd62d374ab8364b09a179a03c65e92f0d.tar.bz2 nvim-lspconfig-6d4ae56cd62d374ab8364b09a179a03c65e92f0d.tar.lz nvim-lspconfig-6d4ae56cd62d374ab8364b09a179a03c65e92f0d.tar.xz nvim-lspconfig-6d4ae56cd62d374ab8364b09a179a03c65e92f0d.tar.zst nvim-lspconfig-6d4ae56cd62d374ab8364b09a179a03c65e92f0d.zip | |
Merge pull request #1430 from mjlbach/feat/sixtyfps
Diffstat (limited to 'lua')
| -rw-r--r-- | lua/lspconfig/configs.lua | 14 | ||||
| -rw-r--r-- | lua/lspconfig/sixtyfps.lua | 30 |
2 files changed, 41 insertions, 3 deletions
diff --git a/lua/lspconfig/configs.lua b/lua/lspconfig/configs.lua index f69e2673..64d848c5 100644 --- a/lua/lspconfig/configs.lua +++ b/lua/lspconfig/configs.lua @@ -33,7 +33,7 @@ function configs.__newindex(t, config_name, config_def) function M.setup(config) validate { cmd = { config.cmd, 't', true }, - root_dir = { config.root_dir, 'f', default_config.root_dir ~= nil }, + root_dir = { config.root_dir, 'f', true }, filetypes = { config.filetype, 't', true }, on_new_config = { config.on_new_config, 'f', true }, on_attach = { config.on_attach, 'f', true }, @@ -77,7 +77,11 @@ function configs.__newindex(t, config_name, config_def) local get_root_dir = config.root_dir function M.launch() - local root_dir = get_root_dir(api.nvim_buf_get_name(0), api.nvim_get_current_buf()) + local root_dir + if get_root_dir then + root_dir = get_root_dir(api.nvim_buf_get_name(0), api.nvim_get_current_buf()) + end + if root_dir then api.nvim_command( string.format( @@ -195,7 +199,11 @@ function configs.__newindex(t, config_name, config_def) end local id - local root_dir = get_root_dir(api.nvim_buf_get_name(bufnr), bufnr) + local root_dir + + if get_root_dir then + root_dir = get_root_dir(api.nvim_buf_get_name(bufnr), bufnr) + end if root_dir then id = manager.add(root_dir, false) diff --git a/lua/lspconfig/sixtyfps.lua b/lua/lspconfig/sixtyfps.lua new file mode 100644 index 00000000..1ebc8774 --- /dev/null +++ b/lua/lspconfig/sixtyfps.lua @@ -0,0 +1,30 @@ +local configs = require 'lspconfig/configs' + +configs.sixtyfps = { + default_config = { + cmd = { 'sixtyfps-lsp' }, + filetypes = { 'sixtyfps' }, + single_file_support = true, + }, + docs = { + description = [=[ +https://github.com/sixtyfpsui/sixtyfps +`SixtyFPS`'s language server + +You can build and install `sixtyfps-lsp` binary with `cargo`: +```sh +cargo install sixtyfps-lsp +``` + +Vim does not have built-in syntax for the `sixtyfps` filetype currently. + +This can be added via an autocmd: + +```lua +vim.cmd [[ autocmd BufRead,BufNewFile *.60 set filetype=sixtyfps ]] +``` + +or by installing a filetype plugin such as https://github.com/RustemB/sixtyfps-vim +]=], + }, +} |
