Add a setting for keyword hover popups

This commit is contained in:
Jonas Schievink 2022-08-16 16:51:40 +02:00
parent b6fae56e38
commit 0616cee92b
7 changed files with 57 additions and 10 deletions

View file

@ -8,7 +8,11 @@ fn check_hover_no_result(ra_fixture: &str) {
let (analysis, position) = fixture::position(ra_fixture);
let hover = analysis
.hover(
&HoverConfig { links_in_hover: true, documentation: Some(HoverDocFormat::Markdown) },
&HoverConfig {
links_in_hover: true,
documentation: Some(HoverDocFormat::Markdown),
keywords: true,
},
FileRange { file_id: position.file_id, range: TextRange::empty(position.offset) },
)
.unwrap();
@ -20,7 +24,11 @@ fn check(ra_fixture: &str, expect: Expect) {
let (analysis, position) = fixture::position(ra_fixture);
let hover = analysis
.hover(
&HoverConfig { links_in_hover: true, documentation: Some(HoverDocFormat::Markdown) },
&HoverConfig {
links_in_hover: true,
documentation: Some(HoverDocFormat::Markdown),
keywords: true,
},
FileRange { file_id: position.file_id, range: TextRange::empty(position.offset) },
)
.unwrap()
@ -37,7 +45,11 @@ fn check_hover_no_links(ra_fixture: &str, expect: Expect) {
let (analysis, position) = fixture::position(ra_fixture);
let hover = analysis
.hover(
&HoverConfig { links_in_hover: false, documentation: Some(HoverDocFormat::Markdown) },
&HoverConfig {
links_in_hover: false,
documentation: Some(HoverDocFormat::Markdown),
keywords: true,
},
FileRange { file_id: position.file_id, range: TextRange::empty(position.offset) },
)
.unwrap()
@ -54,7 +66,11 @@ fn check_hover_no_markdown(ra_fixture: &str, expect: Expect) {
let (analysis, position) = fixture::position(ra_fixture);
let hover = analysis
.hover(
&HoverConfig { links_in_hover: true, documentation: Some(HoverDocFormat::PlainText) },
&HoverConfig {
links_in_hover: true,
documentation: Some(HoverDocFormat::PlainText),
keywords: true,
},
FileRange { file_id: position.file_id, range: TextRange::empty(position.offset) },
)
.unwrap()
@ -71,7 +87,11 @@ fn check_actions(ra_fixture: &str, expect: Expect) {
let (analysis, file_id, position) = fixture::range_or_position(ra_fixture);
let hover = analysis
.hover(
&HoverConfig { links_in_hover: true, documentation: Some(HoverDocFormat::Markdown) },
&HoverConfig {
links_in_hover: true,
documentation: Some(HoverDocFormat::Markdown),
keywords: true,
},
FileRange { file_id, range: position.range_or_empty() },
)
.unwrap()
@ -83,7 +103,11 @@ fn check_hover_range(ra_fixture: &str, expect: Expect) {
let (analysis, range) = fixture::range(ra_fixture);
let hover = analysis
.hover(
&HoverConfig { links_in_hover: false, documentation: Some(HoverDocFormat::Markdown) },
&HoverConfig {
links_in_hover: false,
documentation: Some(HoverDocFormat::Markdown),
keywords: true,
},
range,
)
.unwrap()
@ -95,7 +119,11 @@ fn check_hover_range_no_results(ra_fixture: &str) {
let (analysis, range) = fixture::range(ra_fixture);
let hover = analysis
.hover(
&HoverConfig { links_in_hover: false, documentation: Some(HoverDocFormat::Markdown) },
&HoverConfig {
links_in_hover: false,
documentation: Some(HoverDocFormat::Markdown),
keywords: true,
},
range,
)
.unwrap();