This commit is contained in:
Aleksey Kladov 2019-07-08 13:47:02 +03:00
parent 227bc0b6d4
commit b042faeb64
2 changed files with 20 additions and 23 deletions

View file

@ -412,6 +412,19 @@ impl TryConvWith for (FileId, RangeInfo<NavigationTarget>) {
}
}
impl TryConvWith for (FileId, RangeInfo<Vec<NavigationTarget>>) {
type Ctx = WorldSnapshot;
type Output = req::GotoDefinitionResponse;
fn try_conv_with(self, world: &WorldSnapshot) -> Result<req::GotoTypeDefinitionResponse> {
let (file_id, RangeInfo { range, info: navs }) = self;
let links = navs
.into_iter()
.map(|nav| (file_id, RangeInfo::new(range, nav)))
.try_conv_with_to_vec(world)?;
Ok(links.into())
}
}
pub fn to_location(
file_id: FileId,
range: TextRange,