Language Server: textDocument/signatureHelp

Implements a pretty barebones function signature help mechanism in
the language server.

Users can use `Analysis::resolve_callback()` to get basic information
about a call site.

Fixes #102
This commit is contained in:
Jeremy A. Kolb 2018-10-09 10:08:17 -04:00
parent 2ba6f18586
commit f8a2b53304
10 changed files with 316 additions and 12 deletions

View file

@ -38,6 +38,7 @@ pub use ra_editor::{
Fold, FoldKind
};
pub use job::{JobToken, JobHandle};
pub use descriptors::FnDescriptor;
#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub struct FileId(pub u32);
@ -236,6 +237,11 @@ impl Analysis {
let file = self.imp.file_syntax(file_id);
ra_editor::folding_ranges(&file)
}
pub fn resolve_callable(&self, file_id: FileId, offset: TextUnit, token: &JobToken)
-> Option<(FnDescriptor, Option<usize>)> {
self.imp.resolve_callable(file_id, offset, token)
}
}
#[derive(Debug)]