GithubHelp home page GithubHelp logo

Comments (13)

ofseed avatar ofseed commented on May 28, 2024 2

This didn't happen until the recent changes.

This may be important information. Rather than reload the buffer by :edit, do inlay hints appear when you modify the document?

Edit: I found I can reproduce it by clangd, and they do appear after editing, thanks.

from neovim.

mehalter avatar mehalter commented on May 28, 2024 1

Ah it looks like we opened issues separately regarding similar things with vim.lsp.inlay_hint (#28625). I actually didn't even see if the inlay hints actually get displayed in my issue and just referred to the incorrect state behavior of the enabling. Let me know if we should consolidate my issue into this to centralize bugs with the new API.

from neovim.

ofseed avatar ofseed commented on May 28, 2024 1

Seems to be separate problems, For now, I can reproduce from the case @mehalter provided and I know the reason, but I can't reproduce from what @justinmk provided. I will look into this issue

from neovim.

ofseed avatar ofseed commented on May 28, 2024 1

#28627 should fix the case @mehalter provided, I'm not sure if it fixes the problem @justinmk is having.

from neovim.

mehalter avatar mehalter commented on May 28, 2024

I will move over the case I found here:

vim.lsp.inlay_hint.is_enabled() -- false (ok ✅)
vim.lsp.inlay_hint.enable(true) -- enable globally
vim.lsp.inlay_hint.is_enabled() -- true (ok ✅)
vim.lsp.inlay_hint.is_enabled({ bufnr = 0 }) -- true (ok ✅)
vim.lsp.inlay_hint.enable(false, { bufnr = 0 })
vim.lsp.inlay_hint.is_enabled({ bufnr = 0 }) -- true (wrong ❌)

from neovim.

mehalter avatar mehalter commented on May 28, 2024

Thanks for investigating @ofseed let me know if you want me to reopen my issue to separate them. I figured they may be resulting from the same root cause. Granted I also can't replicate the other issue with just calling enable without a buffer number

from neovim.

ofseed avatar ofseed commented on May 28, 2024

@justinmk I still can't find how to reproduce, can you please provide a more detailed use case?

from neovim.

justinmk avatar justinmk commented on May 28, 2024

can you please provide a more detailed use case?

tested with 5282361 :

  1. open a file which has a LSP server that provides inline hints.
  2. run lua vim.lsp.inlay_hint.enable()
  3. inlay hints not displayed.
  4. reload the buffer with :edit, now the inlay hints are displayed.

If step (2) is changed to lua vim.lsp.inlay_hint.enable(true, {bufnr=0}) , then there is no issue (step 3 shows inlay hints).

from neovim.

mehalter avatar mehalter commented on May 28, 2024

Hm, I can't replicate this at all either, tested with 5282361 as well

As soon as I run lua vim.lsp.inlay_hint.enable() it shows the inlay hints (assuming the language server is fully loaded). What language server are you testing it with @justinmk ?

from neovim.

justinmk avatar justinmk commented on May 28, 2024

clangd, opening main.c from Nvim source tree. This didn't happen until the recent changes.

from neovim.

justinmk avatar justinmk commented on May 28, 2024

Rather than reload the buffer by :edit, do inlay hints appear when you modify the document?

yes

from neovim.

sergeken avatar sergeken commented on May 28, 2024

Also, it might take time before the inlay hints are shown. I've this experience with a rust project that has a few "heavy" dependencies and rust_analyzer is "chewing" on the code for some minutes. And until then nothing is shown. Inlay hints are the last thing that seems to be performed. I've observed the same behavior in vscode.
Can you check with top to see that clangd is indeed "done".

from neovim.

ofseed avatar ofseed commented on May 28, 2024

This is a bug that needs to meet certain conditions to occur, and it does exist. #28629 will fix it.

from neovim.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.