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

automatically updates on new diagnostics doesn't work #122

Closed
ghost opened this issue Nov 28, 2021 · 4 comments · Fixed by #127 or #244
Closed

automatically updates on new diagnostics doesn't work #122

ghost opened this issue Nov 28, 2021 · 4 comments · Fixed by #127 or #244

Comments

@ghost
Copy link

ghost commented Nov 28, 2021

Problem:

  1. Default configuration
  2. Open file with LSP errors and Trouble set.
  3. Try to fix.
  4. Zero reaction.
  5. Trying to set auto_close and auto_open.
  6. Repeat actions.
Plug 'folke/trouble.nvim'
lua << EOF
  require("trouble").setup {
    -- your configuration comes here
    -- or leave it empty to use the default settings
    -- refer to the configuration section below
  }
EOF

lsb_release -a:

Description:	Debian GNU/Linux 11 (bullseye)

Neovim version:

NVIM v0.6.0-dev+631-g72d62aa6a
Build type: Release
LuaJIT 2.1.0-beta3

:checkhealth

lspconfig: require("lspconfig.health").check()
========================================================================
  - INFO: cssls: configuration checked.
  - INFO: clangd: configuration checked.
  - INFO: jsonls: configuration checked.
  - INFO: cmake: configuration checked.
  - INFO: tailwindcss: configuration checked.
  - INFO: tsserver: configuration checked.
  - INFO: html: configuration checked.

nvim: health#nvim#check
========================================================================
## Configuration
  - OK: no issues found

## Performance
  - OK: Build type: Release

## Remote Plugins
  - OK: Up to date

## terminal
  - INFO: key_backspace (kbs) terminfo entry: key_backspace=\177
  - INFO: key_dc (kdch1) terminfo entry: key_dc=\E[3~
  - INFO: $VTE_VERSION='6203'
  - INFO: $COLORTERM='truecolor'

nvim-treesitter: require("nvim-treesitter.health").check()
========================================================================
## Installation
  - WARNING: `tree-sitter` executable not found (parser generator, only needed for :TSInstallFromGrammar, not required for :TSInstall)
  - OK: `node` found v16.13.0 (only needed for :TSInstallFromGrammar)
  - OK: `git` executable found.
  - OK: `cc` executable found. Selected from { vim.NIL, "cc", "gcc", "clang", "cl", "zig" }
    Version: cc (Debian 10.2.1-6) 10.2.1 20210110
  - OK: Neovim was compiled with tree-sitter runtime ABI version 13 (required >=13). Parsers must be compatible with runtime ABI.

## Parser/Features H L F I J
  - ledger         ✓ . ✓ ✓ ✓ 
  - llvm           ✓ . . . . 
  - typescript     ✓ ✓ ✓ ✓ ✓ 
  - vue            ✓ . ✓ ✓ ✓ 
  - http           ✓ . . . ✓ 
  - regex          ✓ . . . . 
  - gomod          ✓ . . . . 
  - perl           ✓ . . . . 
  - fish           ✓ ✓ ✓ ✓ ✓ 
  - julia          ✓ ✓ ✓ ✓ ✓ 
  - css            ✓ . ✓ ✓ ✓ 
  - scss           ✓ . . ✓ . 
  - erlang         . . . . . 
  - lua            ✓ ✓ ✓ ✓ ✓ 
  - surface        ✓ . ✓ ✓ ✓ 
  - json           ✓ ✓ ✓ ✓ . 
  - vim            ✓ ✓ . . ✓ 
  - heex           ✓ . ✓ ✓ ✓ 
  - clojure        ✓ ✓ ✓ . ✓ 
  - ocaml          ✓ ✓ ✓ . ✓ 
  - commonlisp     ✓ ✓ ✓ . . 
  - ocaml_interface✓ ✓ ✓ . ✓ 
  - dockerfile     ✓ . . . ✓ 
  - cuda           ✓ ✓ ✓ ✓ ✓ 
  - c_sharp        ✓ ✓ ✓ . ✓ 
  - glsl           ✓ ✓ ✓ ✓ ✓ 
  - php            ✓ ✓ ✓ ✓ ✓ 
  - tsx            ✓ ✓ ✓ ✓ ✓ 
  - kotlin         ✓ . . . ✓ 
  - dot            ✓ . . . ✓ 
  - scala          ✓ . ✓ . ✓ 
  - python         ✓ ✓ ✓ ✓ ✓ 
  - go             ✓ ✓ ✓ ✓ ✓ 
  - hcl            ✓ . ✓ ✓ ✓ 
  - tlaplus        ✓ . ✓ . ✓ 
  - latex          ✓ . ✓ . ✓ 
  - yaml           ✓ ✓ ✓ ✓ ✓ 
  - glimmer        ✓ . . . . 
  - prisma         ✓ . . . . 
  - hjson          ✓ ✓ ✓ ✓ ✓ 
  - pioasm         ✓ . . . ✓ 
  - query          ✓ ✓ ✓ ✓ ✓ 
  - ruby           ✓ ✓ ✓ ✓ ✓ 
  - cmake          ✓ . ✓ . . 
  - jsonc          ✓ ✓ ✓ ✓ ✓ 
  - turtle         ✓ ✓ ✓ ✓ ✓ 
  - zig            ✓ . ✓ ✓ ✓ 
  - bibtex         ✓ . ✓ ✓ . 
  - yang           ✓ . ✓ . . 
  - beancount      ✓ . ✓ . . 
  - graphql        ✓ . . ✓ ✓ 
  - nix            ✓ ✓ ✓ . ✓ 
  - r              ✓ ✓ . . . 
  - svelte         ✓ . ✓ ✓ ✓ 
  - dart           ✓ ✓ . ✓ ✓ 
  - sparql         ✓ ✓ ✓ ✓ ✓ 
  - rust           ✓ ✓ ✓ ✓ ✓ 
  - rst            ✓ ✓ . . ✓ 
  - fennel         ✓ ✓ . . ✓ 
  - elixir         ✓ ✓ ✓ ✓ ✓ 
  - bash           ✓ ✓ ✓ . ✓ 
  - html           ✓ ✓ ✓ ✓ ✓ 
  - ql             ✓ ✓ . ✓ ✓ 
  - javascript     ✓ ✓ ✓ ✓ ✓ 
  - supercollider  ✓ ✓ ✓ ✓ ✓ 
  - cpp            ✓ ✓ ✓ ✓ ✓ 
  - c              ✓ ✓ ✓ ✓ ✓ 
  - json5          ✓ . . . ✓ 
  - toml           ✓ ✓ ✓ ✓ ✓ 
  - comment        ✓ . . . . 
  - java           ✓ ✓ . ✓ ✓ 
  - jsdoc          ✓ . . . . 

  Legend: H[ighlight], L[ocals], F[olds], I[ndents], In[j]ections
         +) multiple parsers found, only one will be used
         x) errors found in the query, try to run :TSUpdate {lang}

provider: health#provider#check
========================================================================
## Clipboard (optional)
  - OK: Clipboard tool found: xclip

## Python 2 provider (optional)
  - WARNING: No Python executable found that can `import neovim`. Using the first available executable for diagnostics.
  - ERROR: Python provider error:
    - ADVICE:
      - provider/pythonx: Could not load Python 2:
          python2 not found in search path or not executable.
          python2.7 not found in search path or not executable.
          python2.6 not found in search path or not executable.
          python not found in search path or not executable.
  - INFO: Executable: Not found

## Python 3 provider (optional)
  - INFO: `g:python3_host_prog` is not set.  Searching for python3 in the environment.
  - INFO: Multiple python3 executables found.  Set `g:python3_host_prog` to avoid surprises.
  - INFO: Executable: /usr/bin/python3
  - INFO: Other python executable: /bin/python3
  - INFO: Python version: 3.9.2
  - INFO: pynvim version: 0.4.3
  - OK: Latest pynvim is installed.

## Python virtualenv
  - OK: no $VIRTUAL_ENV

## Ruby provider (optional)
  - WARNING: `ruby` and `gem` must be in $PATH.
    - ADVICE:
      - Install Ruby and verify that `ruby` and `gem` commands work.

## Node.js provider (optional)
  - INFO: Node.js: v16.13.0
  - INFO: Nvim node.js host: /home/user/.npm-packages/lib/node_modules/neovim/bin/cli.js
  - OK: Latest "neovim" npm/yarn package is installed: 4.10.0

## Perl provider (optional)
  - ERROR: perl provider error:
    - ADVICE:
      - "Neovim::Ext" cpan module is not installed

telescope: require("telescope.health").check()
========================================================================
## Checking for required plugins
  - OK: plenary installed.
  - OK: nvim-treesitter installed.

## Checking external dependencies
  - OK: rg: found ripgrep 13.0.0 (rev 7ec2fd51ba)
  - OK: fd: found fd 8.2.1

## ===== Installed extensions =====

## Telescope Extension: `fzf`
  - INFO: No healthcheck provided

vim.lsp: require("vim.lsp.health").check()
========================================================================
  - INFO: LSP log level : WARN
  - INFO: Log path: /home/user/.cache/nvim/lsp.log
  - INFO: Log size: 6144 KB

vim.treesitter: require("vim.treesitter.health").check()
========================================================================
  - INFO: Runtime ABI version : 13
  - OK: Loaded parser for bash: ABI version 13
  - OK: Loaded parser for beancount: ABI version 13
  - OK: Loaded parser for bibtex: ABI version 13
  - OK: Loaded parser for c: ABI version 13
  - OK: Loaded parser for c_sharp: ABI version 13
  - OK: Loaded parser for clojure: ABI version 13
  - OK: Loaded parser for cmake: ABI version 13
  - OK: Loaded parser for comment: ABI version 13
  - OK: Loaded parser for commonlisp: ABI version 13
  - OK: Loaded parser for cpp: ABI version 13
  - OK: Loaded parser for css: ABI version 13
  - OK: Loaded parser for cuda: ABI version 13
  - OK: Loaded parser for dart: ABI version 13
  - OK: Loaded parser for dockerfile: ABI version 13
  - OK: Loaded parser for dot: ABI version 13
  - OK: Loaded parser for elixir: ABI version 13
  - OK: Loaded parser for erlang: ABI version 13
  - OK: Loaded parser for fennel: ABI version 13
  - OK: Loaded parser for fish: ABI version 13
  - OK: Loaded parser for glimmer: ABI version 13
  - OK: Loaded parser for glsl: ABI version 13
  - OK: Loaded parser for go: ABI version 13
  - OK: Loaded parser for gomod: ABI version 13
  - OK: Loaded parser for graphql: ABI version 13
  - OK: Loaded parser for hcl: ABI version 13
  - OK: Loaded parser for heex: ABI version 13
  - OK: Loaded parser for hjson: ABI version 13
  - OK: Loaded parser for html: ABI version 13
  - OK: Loaded parser for http: ABI version 13
  - OK: Loaded parser for java: ABI version 13
  - OK: Loaded parser for javascript: ABI version 13
  - OK: Loaded parser for jsdoc: ABI version 13
  - OK: Loaded parser for json: ABI version 13
  - OK: Loaded parser for json5: ABI version 13
  - OK: Loaded parser for jsonc: ABI version 13
  - OK: Loaded parser for julia: ABI version 13
  - OK: Loaded parser for kotlin: ABI version 13
  - OK: Loaded parser for latex: ABI version 13
  - OK: Loaded parser for ledger: ABI version 13
  - OK: Loaded parser for llvm: ABI version 13
  - OK: Loaded parser for lua: ABI version 13
  - OK: Loaded parser for nix: ABI version 13
  - OK: Loaded parser for ocaml: ABI version 13
  - OK: Loaded parser for ocaml_interface: ABI version 13
  - OK: Loaded parser for perl: ABI version 13
  - OK: Loaded parser for php: ABI version 13
  - OK: Loaded parser for pioasm: ABI version 13
  - OK: Loaded parser for prisma: ABI version 13
  - OK: Loaded parser for python: ABI version 13
  - OK: Loaded parser for ql: ABI version 13
  - OK: Loaded parser for query: ABI version 13
  - OK: Loaded parser for r: ABI version 13
  - OK: Loaded parser for regex: ABI version 13
  - OK: Loaded parser for rst: ABI version 13
  - OK: Loaded parser for ruby: ABI version 13
  - OK: Loaded parser for rust: ABI version 13
  - OK: Loaded parser for scala: ABI version 13
  - OK: Loaded parser for scss: ABI version 13
  - OK: Loaded parser for sparql: ABI version 13
  - OK: Loaded parser for supercollider: ABI version 13
  - OK: Loaded parser for surface: ABI version 13
  - OK: Loaded parser for svelte: ABI version 13
  - OK: Loaded parser for tlaplus: ABI version 13
  - OK: Loaded parser for toml: ABI version 13
  - OK: Loaded parser for tsx: ABI version 13
  - OK: Loaded parser for turtle: ABI version 13
  - OK: Loaded parser for typescript: ABI version 13
  - OK: Loaded parser for vim: ABI version 13
  - OK: Loaded parser for vue: ABI version 13
  - OK: Loaded parser for yaml: ABI version 13
  - OK: Loaded parser for yang: ABI version 13
  - OK: Loaded parser for zig: ABI version 13
  - OK: Loaded parser for c: ABI version 13

2021-11-28.17-56-15.mp4
@gegoune
Copy link

gegoune commented Nov 28, 2021

Most likely related to neovim/neovim#14090 (comment).

@ghifarit53
Copy link

ghifarit53 commented Nov 30, 2021

Actually changing the code in plugin/trouble.vim

au User LspDiagnosticsChanged lua require'trouble'.refresh({auto = true, provider = "diagnostics"})

to the following (based on the described change in neovim/neovim#14090)

au DiagnosticChanged * lua require'trouble'.refresh({auto = true, provider = "diagnostics"})

looks like fixes the issue, making diagnostics autoupdate working as before. But I'm not too sure about a PR since I don't know much about lua and vimscript, and whether other files needs checking too (But if someone might interested in pull request, hope this become a good start)

@gegoune
Copy link

gegoune commented Nov 30, 2021

It's not as easy as just changing the aucommand, it would break for 0.5.x users. Checking for 0.6.0 version needs to be added.

abusch added a commit to abusch/trouble.nvim that referenced this issue Dec 2, 2021
Use the new DiagnosticChanged event on neovim 0.6.

closes: folke#122
@abusch
Copy link
Contributor

abusch commented Dec 2, 2021

Took a crack at fixing it in PR #127

@folke folke closed this as completed in #127 Dec 2, 2021
folke pushed a commit that referenced this issue Dec 2, 2021
Use the new DiagnosticChanged event on neovim 0.6.

closes: #122
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants