diff --git a/lua/rust-tools/fly_check.lua b/lua/rust-tools/fly_check.lua new file mode 100644 index 0000000..ad88974 --- /dev/null +++ b/lua/rust-tools/fly_check.lua @@ -0,0 +1,14 @@ +local M = {} + +local function get_params() + return { + textDocument = vim.lsp.util.make_text_document_params(), + } +end + +function M.fly_check() + local params = get_params() + vim.lsp.buf_notify(0, "rust-analyzer/runFlycheck", params) +end + +return M diff --git a/lua/rust-tools/init.lua b/lua/rust-tools/init.lua index ca07557..29ca578 100644 --- a/lua/rust-tools/init.lua +++ b/lua/rust-tools/init.lua @@ -55,6 +55,9 @@ function M.setup(opts) local external_docs = require("rust-tools.external_docs") M.external_docs = external_docs + local fly_check = require("rust-tools.fly_check") + M.fly_check = fly_check + local hover_actions = require("rust-tools.hover_actions") M.hover_actions = hover_actions diff --git a/lua/rust-tools/lsp.lua b/lua/rust-tools/lsp.lua index 3288eeb..e8f7996 100644 --- a/lua/rust-tools/lsp.lua +++ b/lua/rust-tools/lsp.lua @@ -41,6 +41,9 @@ local function setup_commands() rt.debuggables.debuggables, }, RustExpandMacro = { rt.expand_macro.expand_macro }, + RustFlyCheck = { + rt.fly_check.fly_check, + }, RustOpenExternalDocs = { rt.external_docs.open_external_docs, },