Code Monkey home page Code Monkey logo

Comments (8)

alex-courtis avatar alex-courtis commented on July 18, 2024 1

Let's build for nvim 0.10 and see if it works for 0.9

We can decide whether to build a 0.9 specific implementation based on the above.

from nvim-tree.lua.

shreyas-a-s avatar shreyas-a-s commented on July 18, 2024 1

I agree. Since neovim 0.10 is the upcoming release, initial focus should be on it.

from nvim-tree.lua.

alex-courtis avatar alex-courtis commented on July 18, 2024

I don't think I'm fully understanding. What is update_in_insert? It doesn't seem to be an nvim or lsp setting.

It appears to be a lualine specific setting: https://github.com/nvim-lualine/lualine.nvim?tab=readme-ov-file#diagnostics-component-options

Is it known by another name?

from nvim-tree.lua.

gegoune avatar gegoune commented on July 18, 2024

@alex-courtis

it's part of configuration options for vim.diagnostic.config(), see :h vim.diagnostic.Opts.

from nvim-tree.lua.

alex-courtis avatar alex-courtis commented on July 18, 2024

@alex-courtis

it's part of configuration options for vim.diagnostic.config(), see :h vim.diagnostic.Opts.

Ah... new in 0.10.

This featurecan be added, although it will have to be behind a 0.10 feature flag.

I'm a little wary of 0.10; there have been a few breaking breaking changes recently.

from nvim-tree.lua.

shreyas-a-s avatar shreyas-a-s commented on July 18, 2024

First of all, thanks for the insights. It made me recheck the things and I was wrong. When it comes to lualine yes it indeed is a separate option. But when it comes to neovim an option does exist but I think lualine uses its own value for implementing it.

This is the option in neovim:

vim.lsp.handlers["textDocument/publishDiagnostics"] = vim.lsp.with(
  vim.lsp.diagnostic.on_publish_diagnostics, {
    update_in_insert = false, 
  }
)

And the thing is, I use neovim 0.9.5 and it works as intended when it comes to neovim buffers. See this video:

nvim-issue-1.mp4

At first I set the update_in_insert to false and see that neovim respects it and doesn't show the diagnostic virtual_text while in insert mode. Then when I set it to true neovim respects that and shows diagnostic virtual_text even when in insert mode.

Similarly, when it comes to lualine as you have found out, it also have such an option.

What I am hoping is the addition of an option like the one below that kind of brings the feature to nvim-tree:

require("nvim-tree").setup({
  diagnostics = {
    update_in_insert = false, -- ability to set something like this
  },
})

from nvim-tree.lua.

alex-courtis avatar alex-courtis commented on July 18, 2024

That's quite nice. We do seem to have two different mechanisms to achieve this: vim.diagnostic.config() (0.10) and the above LSP setting.

Can we implement one mechanism to handle both?

from nvim-tree.lua.

shreyas-a-s avatar shreyas-a-s commented on July 18, 2024

I am not really well versed with the programming implications of adding this feature hence it would be better if you could choose one mechanism that you feel is the best choice to handle both.

from nvim-tree.lua.

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.