Skip to content

Commit

Permalink
feat(fly_check): support flycheck extension
Browse files Browse the repository at this point in the history
  • Loading branch information
IWANABETHATGUY authored and MunifTanjim committed May 20, 2023
1 parent f4b8340 commit 8be85cd
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 0 deletions.
14 changes: 14 additions & 0 deletions lua/rust-tools/fly_check.lua
Original file line number Diff line number Diff line change
@@ -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
3 changes: 3 additions & 0 deletions lua/rust-tools/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
3 changes: 3 additions & 0 deletions lua/rust-tools/lsp.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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,
},
Expand Down

0 comments on commit 8be85cd

Please sign in to comment.