Moved CodeLens to ide crate

This commit is contained in:
ivan770 2021-02-13 13:07:47 +02:00
parent 935830d05b
commit 185da286d2
No known key found for this signature in database
GPG key ID: D8C4BD5AE4D9CC4D
7 changed files with 388 additions and 202 deletions

View file

@ -22,6 +22,7 @@ mod markup;
mod prime_caches;
mod display;
mod annotations;
mod call_hierarchy;
mod diagnostics;
mod expand_macro;
@ -63,6 +64,7 @@ use syntax::SourceFile;
use crate::display::ToNav;
pub use crate::{
annotations::{Annotation, AnnotationConfig, AnnotationKind},
call_hierarchy::CallItem,
diagnostics::{Diagnostic, DiagnosticsConfig, Fix, Severity},
display::navigation_target::NavigationTarget,
@ -555,6 +557,18 @@ impl Analysis {
})
}
pub fn annotations(
&self,
file_id: FileId,
config: AnnotationConfig,
) -> Cancelable<Vec<Annotation>> {
self.with_db(|db| annotations::annotations(db, file_id, config))
}
pub fn resolve_annotation(&self, annotation: Annotation) -> Cancelable<Annotation> {
self.with_db(|db| annotations::resolve_annotation(db, annotation))
}
/// Performs an operation on that may be Canceled.
fn with_db<F, T>(&self, f: F) -> Cancelable<T>
where