Add hover config linksInHover to suppress links

This commit is contained in:
flw
2020-09-26 13:02:09 +08:00
parent 18c62c8a39
commit e73ee9dfa2
5 changed files with 149 additions and 13 deletions

View File

@@ -307,6 +307,7 @@ impl Config {
run: data.hoverActions_enable && data.hoverActions_run,
debug: data.hoverActions_enable && data.hoverActions_debug,
goto_type_def: data.hoverActions_enable && data.hoverActions_gotoTypeDef,
links_in_hover: data.hoverActions_linksInHover,
};
log::info!("Config::update() = {:#?}", self);
@@ -451,6 +452,7 @@ config_data! {
hoverActions_gotoTypeDef: bool = true,
hoverActions_implementations: bool = true,
hoverActions_run: bool = true,
hoverActions_linksInHover: bool = true,
inlayHints_chainingHints: bool = true,
inlayHints_maxLength: Option<usize> = None,

View File

@@ -597,7 +597,7 @@ pub(crate) fn handle_hover(
) -> Result<Option<lsp_ext::Hover>> {
let _p = profile::span("handle_hover");
let position = from_proto::file_position(&snap, params.text_document_position_params)?;
let info = match snap.analysis.hover(position)? {
let info = match snap.analysis.hover(position, snap.config.hover.links_in_hover)? {
None => return Ok(None),
Some(info) => info,
};