habamax / vim-godot

Use vim and godot engine to make games
MIT License
498 stars 24 forks source link

Could we get a guide for getting GDScript to work with Nvim new LSP? #38

Closed TobiasDev closed 3 years ago

TobiasDev commented 3 years ago

Hello! I've been trying to set up my Neovim with 'neovim/nvim-lspconfig' instead of coc, and I'm running into some troubles with Godot LSP. I can't get it to work at all. I don't get any suggestions for functions, or actually anything at all. If you have a guide for this that works I would love to see one added to your README.

Thanks!

manning390 commented 3 years ago

I am unsure if it is feature complete but I've gotten the LSP launched and providing autocomplete and gotodefinition within neovim

Relevant plugins

neovim/nvim-lspconfig
Shougo/deoplete.nvim
deoplete-plugins/deoplete-lsp
habamac/vim-godot

I also needed a network utility package installed, I'm on arch so I used ncat (rather than default nc) With those plugins installed I also had the following included as a runtime within my vim configs

lua << EOF
local lspconfig = require'lspconfig'
lspconfig.gdscript.setup{
    cmd = {"ncat", "localhost", "6008"}
}
EOF

With godot launched I was able to get it to open nvim (passed as flag to a terminal emulator as the external editor) and ran :LspInfo and saw that it had connected. Deoplete, my autocomplete plugin was also being seeded.

See my full dotfiles configuration here

Hope this helps.