Merge pull request #2297 from kiljacken/master

Add fancy truncation of type hints.
This commit is contained in:
Aleksey Kladov 2019-11-20 08:38:25 +03:00 committed by GitHub
commit eec68e6f45
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 134 additions and 35 deletions

View file

@ -344,8 +344,14 @@ impl Analysis {
}
/// Returns a list of the places in the file where type hints can be displayed.
pub fn inlay_hints(&self, file_id: FileId) -> Cancelable<Vec<InlayHint>> {
self.with_db(|db| inlay_hints::inlay_hints(db, file_id, &db.parse(file_id).tree()))
pub fn inlay_hints(
&self,
file_id: FileId,
max_inlay_hint_length: Option<usize>,
) -> Cancelable<Vec<InlayHint>> {
self.with_db(|db| {
inlay_hints::inlay_hints(db, file_id, &db.parse(file_id).tree(), max_inlay_hint_length)
})
}
/// Returns the set of folding ranges.