Emit moniker in lsif

This commit is contained in:
hkalbasi 2021-11-22 21:14:46 +03:30
parent a07e406d06
commit 30ed7fac27
12 changed files with 589 additions and 18 deletions

View file

@ -41,6 +41,7 @@ mod inlay_hints;
mod join_lines;
mod markdown_remove;
mod matching_brace;
mod moniker;
mod move_item;
mod parent_module;
mod references;
@ -83,6 +84,7 @@ pub use crate::{
inlay_hints::{InlayHint, InlayHintsConfig, InlayKind},
join_lines::JoinLinesConfig,
markup::Markup,
moniker::{MonikerKind, MonikerResult, PackageInformation},
move_item::Direction,
navigation_target::NavigationTarget,
prime_caches::PrimeCachesProgress,
@ -225,6 +227,7 @@ impl Analysis {
cfg_options,
Env::default(),
Default::default(),
Default::default(),
);
change.change_file(file_id, Some(Arc::new(text)));
change.set_crate_graph(crate_graph);
@ -425,6 +428,14 @@ impl Analysis {
self.with_db(|db| hover::hover(db, range, config))
}
/// Returns moniker of symbol at position.
pub fn moniker(
&self,
position: FilePosition,
) -> Cancellable<Option<RangeInfo<Vec<moniker::MonikerResult>>>> {
self.with_db(|db| moniker::moniker(db, position))
}
/// Return URL(s) for the documentation of the symbol under the cursor.
pub fn external_docs(
&self,