From 63f8339eebd89e05673cdd0ef510836b55ab6916 Mon Sep 17 00:00:00 2001 From: IWANABETHATGUY Date: Fri, 5 May 2023 13:53:31 +0800 Subject: [PATCH 1/2] =?UTF-8?q?feat:=20=F0=9F=8E=B8=20add=20rust=20fly=20c?= =?UTF-8?q?heck=20command?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lua/rust-tools/fly_check.lua | 8 ++++++++ lua/rust-tools/init.lua | 3 +++ lua/rust-tools/lsp.lua | 3 +++ 3 files changed, 14 insertions(+) create mode 100644 lua/rust-tools/fly_check.lua 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) From 7b32bcaab4c062cc09d9654bd99b470e3500729b Mon Sep 17 00:00:00 2001 From: IWANABETHATGUY <974153916@qq.com> Date: Sun, 21 May 2023 00:14:48 +0800 Subject: [PATCH 2/2] Update lua/rust-tools/fly_check.lua Co-authored-by: Munif Tanjim --- lua/rust-tools/fly_check.lua | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lua/rust-tools/fly_check.lua b/lua/rust-tools/fly_check.lua index 2e69a3a..03475f4 100644 --- a/lua/rust-tools/fly_check.lua +++ b/lua/rust-tools/fly_check.lua @@ -1,8 +1,9 @@ local M = {} function M.fly_check() - local params = vim.lsp.util.make_text_document_params() - vim.lsp.buf_notify(0, "rust-analyzer/runFlycheck", params) + vim.lsp.buf_notify(0, "rust-analyzer/runFlycheck", { + textDocument = vim.lsp.util.make_text_document_params() + }) end return M