mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 12:54:58 +00:00
feat: Extend the server with the hover_range capability
This commit is contained in:
parent
6a2a0b7abb
commit
20c64cc0e6
4 changed files with 44 additions and 6 deletions
|
@ -241,6 +241,13 @@ fn try_hover_for_lint(attr: &ast::Attr, token: &SyntaxToken) -> Option<RangeInfo
|
|||
))
|
||||
}
|
||||
|
||||
pub(crate) fn hover_range(
|
||||
db: &RootDatabase,
|
||||
range: FileRange,
|
||||
config: &HoverConfig,
|
||||
) -> Option<RangeInfo<HoverResult>> {
|
||||
}
|
||||
|
||||
fn show_implementations_action(db: &RootDatabase, def: Definition) -> Option<HoverAction> {
|
||||
fn to_action(nav_target: NavigationTarget) -> HoverAction {
|
||||
HoverAction::Implementation(FilePosition {
|
||||
|
|
|
@ -423,6 +423,15 @@ impl Analysis {
|
|||
self.with_db(|db| hover::hover(db, position, config))
|
||||
}
|
||||
|
||||
/// Returns a short text displaying the type for the expression.
|
||||
pub fn hover_range(
|
||||
&self,
|
||||
config: &HoverConfig,
|
||||
range: FileRange,
|
||||
) -> Cancellable<Option<RangeInfo<HoverResult>>> {
|
||||
self.with_db(|db| hover::hover_range(db, range, config))
|
||||
}
|
||||
|
||||
/// Return URL(s) for the documentation of the symbol under the cursor.
|
||||
pub fn external_docs(
|
||||
&self,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue