Skip to content

Commit 8be85cd

Browse files
IWANABETHATGUYMunifTanjim
authored andcommitted
feat(fly_check): support flycheck extension
PR: simrat39#379
1 parent f4b8340 commit 8be85cd

File tree

3 files changed

+20
-0
lines changed

3 files changed

+20
-0
lines changed

lua/rust-tools/fly_check.lua

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
local M = {}
2+
3+
local function get_params()
4+
return {
5+
textDocument = vim.lsp.util.make_text_document_params(),
6+
}
7+
end
8+
9+
function M.fly_check()
10+
local params = get_params()
11+
vim.lsp.buf_notify(0, "rust-analyzer/runFlycheck", params)
12+
end
13+
14+
return M

lua/rust-tools/init.lua

+3
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,9 @@ function M.setup(opts)
5555
local external_docs = require("rust-tools.external_docs")
5656
M.external_docs = external_docs
5757

58+
local fly_check = require("rust-tools.fly_check")
59+
M.fly_check = fly_check
60+
5861
local hover_actions = require("rust-tools.hover_actions")
5962
M.hover_actions = hover_actions
6063

lua/rust-tools/lsp.lua

+3
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@ local function setup_commands()
4141
rt.debuggables.debuggables,
4242
},
4343
RustExpandMacro = { rt.expand_macro.expand_macro },
44+
RustFlyCheck = {
45+
rt.fly_check.fly_check,
46+
},
4447
RustOpenExternalDocs = {
4548
rt.external_docs.open_external_docs,
4649
},

0 commit comments

Comments
 (0)