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

Telescope diagnostics always returns "no diagnostics found" even when diagnostics exist #2661

Closed
mystilleef opened this issue Aug 21, 2023 · 4 comments · Fixed by #2662
Closed
Labels
bug Something isn't working

Comments

@mystilleef
Copy link

Description

Telescope diagnostics always returns "no diagnostics found" even when diagnostics exist.

Neovim version

NVIM v0.10.0-dev-881+g7a3fef9e3
Build type: Release
LuaJIT 2.1.0-beta3

Operating system and version

Fedora Linux 38 (Workstation Edition)

Telescope version / branch / rev

main

checkhealth telescope

==============================================================================
telescope: health#telescope#check

Checking for required plugins ~
- OK plenary installed.
- OK nvim-treesitter installed.

Checking external dependencies ~
- OK rg: found ripgrep 13.0.0
- OK fd: found fd 8.7.0

===== Installed extensions ===== ~

Telescope Extension: `emoji` ~
- No healthcheck provided

Telescope Extension: `file_browser` ~
- No healthcheck provided

Telescope Extension: `frecency` ~
- OK sqlite.lua installed.
- OK nvim-web-devicons installed.

Telescope Extension: `fzf` ~
- OK lib working as expected
- OK file_sorter correctly configured
- OK generic_sorter correctly configured

Telescope Extension: `harpoon` ~
- No healthcheck provided

Telescope Extension: `hop` ~
- No healthcheck provided

Telescope Extension: `media_files` ~
- No healthcheck provided

Telescope Extension: `neoclip` ~
- No healthcheck provided

Telescope Extension: `noice` ~
- No healthcheck provided

Telescope Extension: `notify` ~
- No healthcheck provided

Telescope Extension: `persisted` ~
- No healthcheck provided

Telescope Extension: `refactoring` ~
- No healthcheck provided

Telescope Extension: `smart_history` ~
- No healthcheck provided

Steps to reproduce

  1. Open a simple lua file with nvim -nu minimal.lua example.lua
  2. Start the lua lsp with LspStart
  3. Use LspInfo to confirm the lua lsp is attached to buffer
  4. Create a syntax error in the file
  5. Show diagnostics with Telescope diagnostics command

Expected behavior

Telescope diagnostics should show a window with all diagnostic issues.

Actual behavior

Telescope diagnostics always returns "no diagnostics found" even when diagnostics exist.

Minimal config

vim.cmd([[set runtimepath=$VIMRUNTIME]])
vim.cmd([[set packpath=/tmp/nvim/site]])
local package_root = "/tmp/nvim/site/pack"
local install_path = package_root .. "/packer/start/packer.nvim"
local function load_plugins()
  require("packer").startup({
    {
      "wbthomason/packer.nvim",
      "neovim/nvim-lspconfig",
      "williamboman/mason.nvim",
      "williamboman/mason-lspconfig.nvim",
      {
        "nvim-telescope/telescope.nvim",
        requires = {
          "nvim-lua/plenary.nvim",
          { "nvim-telescope/telescope-fzf-native.nvim", run = "make" },
        },
      },
    },
    config = {
      package_root = package_root,
      compile_path = install_path .. "/plugin/packer_compiled.lua",
      display = { non_interactive = true },
    },
  })
end
_G.load_config = function()
  require("telescope").setup()
  require("telescope").load_extension("fzf")
  require("mason").setup()
  require("mason-lspconfig").setup {
    ensure_installed = { "lua_ls" },
  }
  require("lspconfig").lua_ls.setup {}
end
if vim.fn.isdirectory(install_path) == 0 then
  print("Installing Telescope and dependencies.")
  vim.fn.system({
    "git",
    "clone",
    "--depth=1",
    "https://github.com/wbthomason/packer.nvim",
    install_path,
  })
end
load_plugins()
require("packer").sync()
vim.cmd([[autocmd User PackerComplete ++once echo "Ready!" | lua load_config()]])
@mystilleef mystilleef added the bug Something isn't working label Aug 21, 2023
@mystilleef
Copy link
Author

See the video showing the issue.

telescope_diagnostics_bug.mp4

@RAprogramm
Copy link

the same problem. i also use neovim 0.10

delphinus added a commit that referenced this issue Aug 22, 2023
neovim/neovim#24736 has introduced a new syntax
for severity format in `vim.diagnostic.get()`.

Fix #2661
@wilhelmeek
Copy link

As an interim workaround (while #2662 is considered), you can use :Telescope diagnostics severity_bound=ERROR

jamestrew pushed a commit that referenced this issue Sep 3, 2023
* fix: use nil for the default diagnostics severity

neovim/neovim#24736 has introduced a new syntax
for severity format in `vim.diagnostic.get()`.

Fix #2661

* fix: fallback for 0.9.1

* fix: detect changes only when minor version > 9
Conni2461 pushed a commit that referenced this issue Sep 5, 2023
* fix: use nil for the default diagnostics severity

neovim/neovim#24736 has introduced a new syntax
for severity format in `vim.diagnostic.get()`.

Fix #2661

* fix: fallback for 0.9.1

* fix: detect changes only when minor version > 9

(cherry picked from commit 6b79d7a)
@ivanjermakov
Copy link

ivanjermakov commented Nov 7, 2023

For those running it with a lua config, use

function() require('telescope.builtin').diagnostics({ severity_bound = 0 }) end

rameshsanth pushed a commit to rameshsanth/telescope.nvim that referenced this issue Nov 17, 2023
* fix: use nil for the default diagnostics severity

neovim/neovim#24736 has introduced a new syntax
for severity format in `vim.diagnostic.get()`.

Fix nvim-telescope#2661

* fix: fallback for 0.9.1

* fix: detect changes only when minor version > 9
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants