-
Notifications
You must be signed in to change notification settings - Fork 787
feat: add NullLsToggle command #1188
base: main
Are you sure you want to change the base?
Changes from all commits
668eb58
f92184f
756b42b
3ea6e57
99f1415
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,10 +32,24 @@ M.setup = function(user_config) | |
vim.api.nvim_create_user_command("NullLsInfo", function() | ||
require("null-ls.info").show_window() | ||
end, {}) | ||
|
||
vim.api.nvim_create_user_command("NullLsLog", function() | ||
vim.cmd(string.format("edit %s", require("null-ls.logger"):get_path())) | ||
end, {}) | ||
|
||
vim.api.nvim_create_user_command("NullLsToggle", function(opts) | ||
M.toggle(opts.args) | ||
end, { | ||
nargs = "?", | ||
complete = function() | ||
local list = {} | ||
for _, source in ipairs(sources.get(vim.bo.filetype)) do | ||
list[#list + 1] = source.name | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think there's a possibility of duplicate sources here, e.g. if the user has There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this will depend on how There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If we just pass |
||
end | ||
return list | ||
end, | ||
}) | ||
|
||
local augroup = vim.api.nvim_create_augroup("NullLs", {}) | ||
vim.api.nvim_create_autocmd("FileType", { | ||
group = augroup, | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think both of these should also be under the
is_attached
condition, right? At the moment thecreate_logging_info()
call is causing an error for me when the client isn't attached.