1
1
local M = {}
2
+ local actions = {}
2
3
local notify = require (" rulebook.utils" ).notify
3
4
---- ----------------------------------------------------------------------------
4
5
36
37
---- ----------------------------------------------------------------------------
37
38
38
39
--- @param diag vim.Diagnostic
39
- function M .lookupRule (diag )
40
+ function actions .lookupRule (diag )
40
41
if not validDiagObj (diag ) then return end
41
42
local config = require (" rulebook.config" ).config
42
43
@@ -62,7 +63,7 @@ function M.lookupRule(diag)
62
63
end
63
64
64
65
--- @param diag vim.Diagnostic
65
- function M .ignoreRule (diag )
66
+ function actions .ignoreRule (diag )
66
67
local configForSource = require (" rulebook.config" ).config .ignoreComments [diag .source ]
67
68
if not configForSource then
68
69
notify ((" No ignore comment configured for %q." ):format (diag .source ), " warn" )
@@ -95,7 +96,7 @@ function M.ignoreRule(diag)
95
96
end
96
97
97
98
--- @param diag vim.Diagnostic
98
- function M .yankDiagnosticCode (diag )
99
+ function actions .yankDiagnosticCode (diag )
99
100
if not validDiagObj (diag ) then return end
100
101
local config = require (" rulebook.config" ).config
101
102
@@ -175,7 +176,7 @@ function M.selectRule(operation)
175
176
vim .cmd (" normal! ^" )
176
177
end
177
178
178
- M [operation ](diag )
179
+ actions [operation ](diag )
179
180
end )
180
181
end
181
182
0 commit comments