Skip to content

Commit

Permalink
fix: fires request_diagnostics only for typescipt client
Browse files Browse the repository at this point in the history
  • Loading branch information
KostkaBrukowa committed Jul 16, 2024
1 parent 3ecf6b2 commit b16de53
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions lua/typescript-tools/api.lua
Original file line number Diff line number Diff line change
Expand Up @@ -141,18 +141,16 @@ end
---@param callback fun(params: table, result: table)|nil
function M.request_diagnostics(callback)
local text_document = vim.lsp.util.make_text_document_params()
local client = utils.get_clients {
name = plugin_config.plugin_name,
bufnr = vim.uri_to_bufnr(text_document.uri),
}
local bufnr = vim.uri_to_bufnr(text_document.uri)
local typescript_client = get_typescript_client(bufnr)

if #client == 0 then
if typescript_client == nil then
return
end

vim.lsp.buf_request(0, c.CustomMethods.Diagnostic, {
typescript_client.request(c.CustomMethods.Diagnostic, {
textDocument = text_document,
}, callback)
}, callback, bufnr)
end

---@param is_sync boolean
Expand Down

0 comments on commit b16de53

Please sign in to comment.