This repository was archived by the owner on Dec 11, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 21
handle commands on the client sideΒ #49
Copy link
Copy link
Open
Description
Some commands on the ltex lsp are resolved on the client side.
Example:
_ltex.addToDictionary_ltex.disableRules_ltex.hideFalsePositives
local lspconfig = require 'lspconfig'
local opts = {
root_dir = function(filename)
return lspconfig.util.path.dirname(filename)
end,
on_init = function(client, _)
vim.lsp.commands['_ltex.addToDictionary'] = function(cmd, ctx)
print(vim.inspect { cmd, ctx })
end
end,
settings = {
ltex = {
completionEnabled = true,
language = 'en-US',
checkFrequency = 'edit',
setenceCacheSize = 5000,
additionalRules = {
enablePickyRules = true,
motherTongue = 'en-US',
},
dictionary = {
['en-US'] = { 'Hello', 'Neovim' },
},
},
},
}
lspconfig.ltex.setup(opts)Using :CodeActionMenu not run the command _ltex.addToDictionary. But using :lua vim.lsp.buf.code_action() works.
2022-03-29_17-44_42.mp4
Metadata
Metadata
Assignees
Labels
No labels