LSP: fetch the file content from cache instead of from disk to compute the line number

Otherwise it doesn't work with the web extension. And the file must anyway be in the cache
This commit is contained in:
Olivier Goffart 2022-06-02 18:06:50 +02:00 committed by Olivier Goffart
parent 31502d5918
commit 81b53e2ae0
2 changed files with 11 additions and 6 deletions

View file

@ -104,6 +104,10 @@ impl SourceFileInner {
.unwrap_or_default()
})
}
pub fn source(&self) -> Option<&str> {
self.source.as_ref().map(|s| s.as_str())
}
}
pub type SourceFile = Rc<SourceFileInner>;