-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(null-ls): include hover capabilities #3603
feat(null-ls): include hover capabilities #3603
Conversation
local null_ls = require "null-ls" | ||
local services = require "lvim.lsp.null-ls.services" | ||
local method = null_ls.methods.HOVER | ||
|
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.
function M.list_registered(filetype) | |
local registered_providers = services.list_registered_providers_names(filetype) | |
return registered_providers[method] or {} | |
end | |
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.
you also need to add a section for it in the info panel, same as the other null-ls sources, see
LunarVim/lua/lvim/core/info.lua
Lines 159 to 190 in 3166cc0
local auto_lsp_info = make_auto_lsp_info(ft) | |
local formatters_info = make_formatters_info(ft) | |
local linters_info = make_linters_info(ft) | |
local code_actions_info = make_code_actions_info(ft) | |
local content_provider = function(popup) | |
local content = {} | |
for _, section in ipairs { | |
M.banner, | |
{ "" }, | |
{ "" }, | |
header, | |
{ "" }, | |
lsp_info, | |
{ "" }, | |
auto_lsp_info, | |
{ "" }, | |
formatters_info, | |
{ "" }, | |
linters_info, | |
{ "" }, | |
code_actions_info, | |
} do | |
vim.list_extend(content, section) | |
end | |
return text.align_left(popup, content, 0.5) | |
end |
local services = require "lvim.lsp.null-ls.services" | ||
local method = null_ls.methods.HOVER | ||
|
||
function M.setup(formatter_configs) |
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.
function M.setup(formatter_configs) | |
function M.setup(hover_configs) |
local registered = services.register_sources(formatter_configs, method) | ||
|
||
if #registered > 0 then | ||
Log:debug("Registered the following hovers: " .. unpack(registered)) |
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.
Log:debug("Registered the following hovers: " .. unpack(registered)) | |
Log:debug("Registered the following hover sources: " .. unpack(registered)) |
Description
This change adds hover capabilitites to LunarVim based on recent added hover in null-ls.
It follows already added null-ls capabilities in order to give a well known interface to current users.
This change has no external dependencies.
The documentation was added on PR312 of the LunarVim's docs.
How Has This Been Tested?
I include it on my own configuration since a while. I decide to include in the LunarVim's one to contribute.