@@ -2,7 +2,6 @@ local a = require "plenary.async"
2
2
local uv = require " plenary.async.uv_async"
3
3
local au = require " plenary.async.util"
4
4
local c = require " typescript-tools.protocol.constants"
5
- local plugin_config = require " typescript-tools.config"
6
5
local async = require " typescript-tools.async"
7
6
local utils = require " typescript-tools.utils"
8
7
@@ -141,18 +140,16 @@ end
141
140
--- @param callback fun ( params : table , result : table )| nil
142
141
function M .request_diagnostics (callback )
143
142
local text_document = vim .lsp .util .make_text_document_params ()
144
- local client = utils .get_clients {
145
- name = plugin_config .plugin_name ,
146
- bufnr = vim .uri_to_bufnr (text_document .uri ),
147
- }
143
+ local bufnr = vim .uri_to_bufnr (text_document .uri )
144
+ local typescript_client = get_typescript_client (bufnr )
148
145
149
- if # client == 0 then
146
+ if typescript_client == nil then
150
147
return
151
148
end
152
149
153
- vim . lsp . buf_request ( 0 , c .CustomMethods .Diagnostic , {
150
+ typescript_client . request ( c .CustomMethods .Diagnostic , {
154
151
textDocument = text_document ,
155
- }, callback )
152
+ }, callback , bufnr )
156
153
end
157
154
158
155
--- @param is_sync boolean
0 commit comments