scip: Populate SymbolInformation::signature_documentation
This commit is contained in:
parent
b24914970f
commit
566bb77f91
@ -48,6 +48,7 @@ pub struct TokenStaticData {
|
|||||||
pub moniker: Option<MonikerResult>,
|
pub moniker: Option<MonikerResult>,
|
||||||
pub display_name: Option<String>,
|
pub display_name: Option<String>,
|
||||||
pub enclosing_moniker: Option<MonikerResult>,
|
pub enclosing_moniker: Option<MonikerResult>,
|
||||||
|
pub signature: Option<String>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
|
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
|
||||||
@ -178,6 +179,7 @@ impl StaticIndex<'_> {
|
|||||||
enclosing_moniker: current_crate
|
enclosing_moniker: current_crate
|
||||||
.zip(def.enclosing_definition(self.db))
|
.zip(def.enclosing_definition(self.db))
|
||||||
.and_then(|(cc, enclosing_def)| def_to_moniker(self.db, enclosing_def, cc)),
|
.and_then(|(cc, enclosing_def)| def_to_moniker(self.db, enclosing_def, cc)),
|
||||||
|
signature: def.label(self.db),
|
||||||
});
|
});
|
||||||
self.def_map.insert(def, it);
|
self.def_map.insert(def, it);
|
||||||
it
|
it
|
||||||
|
@ -143,6 +143,13 @@ impl flags::Scip {
|
|||||||
.map(|hover| hover.markup.as_str())
|
.map(|hover| hover.markup.as_str())
|
||||||
.filter(|it| !it.is_empty())
|
.filter(|it| !it.is_empty())
|
||||||
.map(|it| vec![it.to_owned()]);
|
.map(|it| vec![it.to_owned()]);
|
||||||
|
let signature_documentation =
|
||||||
|
token.signature.clone().map(|text| scip_types::Document {
|
||||||
|
relative_path: relative_path.clone(),
|
||||||
|
language: "rust".to_string(),
|
||||||
|
text,
|
||||||
|
..Default::default()
|
||||||
|
});
|
||||||
let symbol_info = scip_types::SymbolInformation {
|
let symbol_info = scip_types::SymbolInformation {
|
||||||
symbol: symbol.clone(),
|
symbol: symbol.clone(),
|
||||||
documentation: documentation.unwrap_or_default(),
|
documentation: documentation.unwrap_or_default(),
|
||||||
@ -150,7 +157,7 @@ impl flags::Scip {
|
|||||||
special_fields: Default::default(),
|
special_fields: Default::default(),
|
||||||
kind: Default::default(),
|
kind: Default::default(),
|
||||||
display_name: token.display_name.clone().unwrap_or_default(),
|
display_name: token.display_name.clone().unwrap_or_default(),
|
||||||
signature_documentation: Default::default(),
|
signature_documentation: signature_documentation.into(),
|
||||||
enclosing_symbol: enclosing_symbol.unwrap_or_default(),
|
enclosing_symbol: enclosing_symbol.unwrap_or_default(),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user