Skip to content

Commit

Permalink
feat: fix client call
Browse files Browse the repository at this point in the history
  • Loading branch information
KostkaBrukowa committed Jul 15, 2024
1 parent cf6d08f commit d7483e5
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions lua/typescript-tools/api.lua
Original file line number Diff line number Diff line change
Expand Up @@ -142,18 +142,17 @@ end
---@param type string|nil - lsp method to send the diagnostic: c.CustomMethods.Diagnostic or c.LspMethods.Diagnostic
function M.request_diagnostics(callback, type)
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, type or c.CustomMethods.Diagnostic, {
typescript_client.request(type or c.CustomMethods.Diagnostic, {
textDocument = text_document,
}, callback)
}, callback, bufnr)
end

---@param is_sync boolean
Expand Down

0 comments on commit d7483e5

Please sign in to comment.