diff --git a/lua/rust-tools/fly_check.lua b/lua/rust-tools/fly_check.lua new file mode 100644 index 0000000..2e69a3a --- /dev/null +++ b/lua/rust-tools/fly_check.lua @@ -0,0 +1,8 @@ +local M = {} + +function M.fly_check() + local params = vim.lsp.util.make_text_document_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..1a78b76 100644 --- a/lua/rust-tools/init.lua +++ b/lua/rust-tools/init.lua @@ -90,6 +90,9 @@ function M.setup(opts) local lsp = require("rust-tools.lsp") M.lsp = lsp + local fly_check = require("rust-tools.fly_check") + M.fly_check = fly_check + local move_item = require("rust-tools.move_item") M.move_item = move_item diff --git a/lua/rust-tools/lsp.lua b/lua/rust-tools/lsp.lua index 3288eeb..5c8846f 100644 --- a/lua/rust-tools/lsp.lua +++ b/lua/rust-tools/lsp.lua @@ -68,6 +68,9 @@ local function setup_commands() RustMoveItemDown = { rt.move_item.move_item, }, + RustFlyCheck = { + rt.fly_check.fly_check, + }, RustMoveItemUp = { function() require("rust-tools.move_item").move_item(true)