Skip to content

Commit

Permalink
feat: make deno/cache async (#2569)
Browse files Browse the repository at this point in the history
* feat: make deno/cache async

* feat: show file name in deno cache error

* fix: use fname isntead of uri
  • Loading branch information
sigmaSd authored Apr 27, 2023
1 parent 710c45b commit da4c527
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lua/lspconfig/server_configurations/denols.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,12 @@ local function buf_cache(bufnr, client)
local params = {}
params['referrer'] = { uri = vim.uri_from_bufnr(bufnr) }
params['uris'] = {}
client.request_sync('deno/cache', params)
client.request('deno/cache', params, function(err, _result, ctx)
if err then
local uri = ctx.params.referrer.uri
vim.api.nvim_err_writeln('cache command failed for ' .. vim.uri_to_fname(uri))
end
end, bufnr)
end

local function virtual_text_document_handler(uri, res, client)
Expand Down Expand Up @@ -59,6 +64,7 @@ end
return {
default_config = {
cmd = { 'deno', 'lsp' },
cmd_env = { NO_COLOR = true },
filetypes = {
'javascript',
'javascriptreact',
Expand Down

0 comments on commit da4c527

Please sign in to comment.