8000 GitHub - cristicismas/gdscript-lsp: GDScript Language Server Protocol
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

cristicismas/gdscript-lsp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

39 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GDScript LSP

Hi! This is a work-in-progress LSP for GDScript.

Right now this project provides basic autocomplete for gdscript variables and functions, since the official LSP doesn't seem to work right for autocomplete in neovim.

Installation

Disclaimer: I've only tried to set this up with the lazyvim package manager, but if you know what you're doing, you should be able to get this to work with other setups as well.

You can get the linux binary from the releases page, or you can build it yourself following the instructions below:

Build Requirements

  1. rustup v1.26.0 or higher

  2. cargo v1.74.1 or higher

  3. neovim v0.10.0 or higher

  4. lazyvim package manager - maybe? read the disclaimer above

Usage

  1. Clone the repo.

  2. Compile the project with cargo build --release.

  3. In your neovim config directory, add the following structure:

    • nvim/
      • lua/
        • custom/
          • plugins/
            • godot_lsp.lua
  4. In your godot_lsp.lua file add the following code:

local client = vim.lsp.start_client {
  name = 'godot-lsp',
  cmd = { '<path-to-cloned-project>/target/release/godot-lsp' },
}

if not client then
  vim.notify 'the test client failed'
  return
end

vim.api.nvim_create_autocmd('FileType', {
  pattern = 'gdscript',
  callback = function()
    vim.lsp.buf_attach_client(0, client)
  end,
})

return {}
  1. Replace path-to-cloned-project with the correct path.

  2. Make sure the godot_lsp plugin is loaded. My lazyvim config is set up so everything in the plugins folder is automatically loaded. This will probably be different depending on your vim package manager, but in lazyvim this is what I did (in init.lua):

require('lazy').setup({
  { import = 'custom.plugins' },
})
52BA

About

GDScript Language Server Protocol

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

0