Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LSP behaves differently in Neovim than other editors (Godot IDE and VS Code) #93224

Closed
zeljkobekcic opened this issue Jun 16, 2024 · 6 comments
Closed

Comments

@zeljkobekcic
Copy link

Tested versions

  • Reproducible in 4.1.4, 4.2.2, 4.3.beta.1

System information

Godot v4.1.4.stable - macOS 13.4.1 - Vulkan (Forward+) - integrated Apple M1 Pro - Apple M1 Pro (8 Threads)

Issue description

The Godot LSP behaves incorrectly in Neovim. VS Code and the Godot IDE on the other hand work as expected.

The following video shows a screen recording of the tutorial and what the LSP provides me. This has been recorded with Godot 4.2.2. .

NeovimGodotIssueDemo.mp4

Here for comparison VS Code

VSCodeGodotIssueDemo.mp4

This is how I setup my LSP:

require('lspconfig').gdscript.setup({})

The complete logs from the neovim LSP are here:

lsp.log

Steps to reproduce

  1. Setup LSP for nvim as I did.
  2. Start Godot and navigate to project
  3. Open files in neovim and start typing existing variables and observe completions

Minimal reproduction project (MRP)

This is the tutorial project.

GodotTest2.zip

@dalexeev
Copy link
Member

Are you sure this is a GDScript LSP issue and not a Neovim issue? As far as I know, we provide the same LSP for all IDEs/editors. Only the built-in editor can make big differences since it does not use LSP. The VS Code plugin uses the same LSP, but probably does some extra processing for better integration with Godot.

@zeljkobekcic
Copy link
Author

Hey, I was not sure where to post this. I started in the NeoVim reddit community but I cam to the conclusion that I might find an answer to this problem here.

Other people have a similar issue, see here: https://www.reddit.com/r/neovim/comments/1c2bhcs/godotgdscript_in_neovim_with_lsp_and_debugging_in/ (the first two comments).

I apologize if this is not the appropriate place for this issue. Then I would move on the the Godot reddit community.

Also I would like to add that:

It seems to never include the top match until I manually retrigger.
-- take from one of the reddit comments

This is also true for me.

I will once more try to understand and break down the LSP debug log which I provided.

@gsthnz
Copy link

gsthnz commented Jun 21, 2024

@zeljkobekcic thanks for opening this, I'm finding the same issue, but I did not test with VSCode.

Are you using nvim-cmp? I did test with coq_nvim instead and the problem didn't happen! So it's likely an issue with nvim-cmp!

@gsthnz
Copy link

gsthnz commented Jun 21, 2024

@zeljkobekcic quick update: I tried the nvim-cmp recommended minimal editor config for opening new issues and the problem does not happen!

Here's the config that I tried, on a gdscript related issue: hrsh7th/nvim-cmp#1119

It's likely some config mistep, not a plugin or LSP issue!

@gsthnz
Copy link

gsthnz commented Jun 21, 2024

It's likely some config mistep, not a plugin or LSP issue!

I was able to track the issue down in my personal config to the use of noinsert in the completion.completeopt in nvim-cmp configs!

@zeljkobekcic
Copy link
Author

@gsthnz, Thank you for your input. I was able to pin point the issue. First of all, I am using kickstart.nvim as a base for my nvim config.

My comletion.completeopt setting was defined as follows:

      completion = { completeopt = 'menu,menuone,noinsert' }, -- before and incorrect

Only not setting the completion results into correct completion suggestions. I will have to understand how nvim-cmp now interacts with the input and why it's so different for this LSP.

From my side this issue is not related to Godot at all.
Apologies for any confusion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

No branches or pull requests

4 participants