diff --git a/.gitignore b/.gitignore index 005b535b..b36b26da 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ nvim spell/ lazy-lock.json +.repro diff --git a/lua/lsp/blink.lua b/lua/lsp/blink.lua index 672ff94c..850ed6e1 100644 --- a/lua/lsp/blink.lua +++ b/lua/lsp/blink.lua @@ -6,6 +6,7 @@ return { -- blink autocompletion ---@type blink.cmp.Config opts = { completion = { + documentation = { auto_show = true }, list = { selection = { preselect = false, @@ -20,9 +21,6 @@ return { -- blink autocompletion appearance = { nerd_font_variant = 'normal', }, - completion = { - documentation = { auto_show = true }, - }, sources = { -- add lazydev to your completion providers default = { 'lazydev', 'lsp', 'path', 'snippets', 'buffer' }, diff --git a/lua/lsp/lsp.lua b/lua/lsp/lsp.lua index c12bd3f9..5cb2c2de 100644 --- a/lua/lsp/lsp.lua +++ b/lua/lsp/lsp.lua @@ -94,10 +94,12 @@ return { }, } -- Godot's LSP - Requires Godot to be running - if vim.fn.has 'win32' == 1 then + if vim.fn.has 'win32' then require('lspconfig')['gdscript'].setup { cmd = { 'ncat', '127.0.0.1', '6005' }, capabilities = require('blink.cmp').get_lsp_capabilities(), + filetypes = { 'gd', 'gdscript', 'gdscript3' }, + root_dir = require('lspconfig.util').root_pattern('project.godot', '.git'), name = 'godot', } else diff --git a/repro.lua b/repro.lua new file mode 100644 index 00000000..1c464738 --- /dev/null +++ b/repro.lua @@ -0,0 +1,38 @@ +-- Run with `nvim -u repro.lua` + +vim.env.LAZY_STDPATH = '.repro' +load(vim.fn.system 'curl -s https://raw.githubusercontent.com/folke/lazy.nvim/main/bootstrap.lua')() + +---@diagnostic disable-next-line: missing-fields +require('lazy.minit').repro { + spec = { + { + 'saghen/blink.cmp', + -- please test on `main` if possible + -- otherwise, remove this line and set `version = '*'` + build = 'cargo build --release', + opts = {}, + }, + { + 'neovim/nvim-lspconfig', + opts = { + servers = { + lua_ls = {}, + gdscript = { + cmd = { 'ncat', '127.0.0.1', '6005' }, + name = 'godot', + }, + }, + }, + config = function(_, opts) + local lspconfig = require 'lspconfig' + for server, config in pairs(opts.servers) do + -- passing config.capabilities to blink.cmp merges with the capabilities in your + -- `opts[server].capabilities, if you've defined it + config.capabilities = require('blink.cmp').get_lsp_capabilities() + lspconfig[server].setup(config) + end + end, + }, + }, +}