Skip to content
This repository was archived by the owner on Jan 3, 2024. It is now read-only.

Commit ca39afa

Browse files
author
hexiangjun
committed
feat: 🎸 add rust fly check command
1 parent 71d2cf6 commit ca39afa

3 files changed

Lines changed: 14 additions & 0 deletions

File tree

lua/rust-tools/fly_check.lua

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
local M = {}
2+
3+
function M.fly_check()
4+
local params = vim.lsp.util.make_text_document_params()
5+
vim.lsp.buf_notify(0, "rust-analyzer/runFlycheck", params)
6+
end
7+
8+
return M

lua/rust-tools/init.lua

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,9 @@ function M.setup(opts)
9090
local lsp = require("rust-tools.lsp")
9191
M.lsp = lsp
9292

93+
local fly_check = require("rust-tools.fly_check")
94+
M.fly_check = fly_check
95+
9396
local move_item = require("rust-tools.move_item")
9497
M.move_item = move_item
9598

lua/rust-tools/lsp.lua

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,9 @@ local function setup_commands()
6868
RustMoveItemDown = {
6969
rt.move_item.move_item,
7070
},
71+
RustFlyCheck = {
72+
rt.fly_check.fly_check,
73+
},
7174
RustMoveItemUp = {
7275
function()
7376
require("rust-tools.move_item").move_item(true)

0 commit comments

Comments
 (0)