yioneko/vtsls

-32603: Request textDocument/inlayHint failed with message:

Opened this issue · 8 comments

I have been getting this message since today. Any clue?

image

This seems an error caused by underlying tsserver: microsoft/TypeScript#53984, and cannot be fixed here. You can try to reproduce it with VSCode and the same file, and report the error to VSCode or Typescript repo.

@yioneko Can we suppress the dialog for -32603: Request textDocument/* errors in vtsls config for neovim ? I'm facing a similar issue and I'd like to hide/ignore the error popup in neovim.

Can we suppress the dialog for -32603: Request textDocument/* errors in vtsls config for neovim ?

Suppressing error is strongly not recommended, only do this if you previously knew about the errors and their impacts:

local notify = vim.notify
local filtered_notify = function(...)
  local msg, level = select(1, ...)
  if level == vim.log.levels.ERROR and string.match(msg, "vtsls: %-%d+") then
    return -- ignored
  end
  return notify(...)
end
vim.notify = filtered_notify

where do I have to put this workaround

I was able to hide this error by adding this to the noice config (~/.config/nvim/lua/plugins/noice.nvim in my lazyvim setup):

return {
  "folke/noice.nvim",
  event = "VeryLazy",
  -- REMOVE THIS once this issue is fixed: https://github.com/yioneko/vtsls/issues/159
  opts = {
    routes = {
      {
        filter = {
          event = "notify",
          find = "Request textDocument/inlayHint failed",
        },
        opts = { skip = true },
      },
    },
  },
}

I was able to hide this error by adding this to the noice config (~/.config/nvim/lua/plugins/noice.nvim in my lazyvim setup):

return {
  "folke/noice.nvim",
  event = "VeryLazy",
  -- REMOVE THIS once this issue is fixed: https://github.com/yioneko/vtsls/issues/159
  opts = {
    routes = {
      {
        filter = {
          event = "notify",
          find = "Request textDocument/inlayHint failed",
        },
        opts = { skip = true },
      },
    },
  },
}

I encountered this error today, and followed this workaround for now -- I have to do this because the dialog completely blocks the entire window of the file I'm editing -- and it works.

Fwiw I'm getting pretty similar error, except message starts with Request textDocument/documentHighlight failed (and the same filtering fix config for noice works as expected).

cncsl commented

Solution suggestions: if you use nvim-notify, you can modify the configuration like this. It works for me:

  {
    "rcarriga/nvim-notify",
    config = function()
      vim.notify = function(msg, ...)
        -- temporarily block notifications of vtls inlayHint exception
        if string.match(msg, "(vtsls: %-32603)") then return end
        require "notify"(msg, ...)
      end
    end,
  },

If you're editing configuration files with lua_ls, you might see a warning about a "Duplicate field notify". This is expected and can be safely ignored.