fix: resolve symlinks for the LSP client

This commit is contained in:
Joscha 2021-12-17 23:17:42 +01:00 committed by Sebastian Ullrich
parent bce56fdc0c
commit 67aa823ae2

View file

@ -250,7 +250,9 @@ def referingTo (self : References) (ident : RefIdent) (srcSearchPath : SearchPat
for (module, refs) in self.allRefs.toList do
if let some info := refs.find? ident then
if let some path ← srcSearchPath.findWithExt "lean" module then
let uri := DocumentUri.ofPath path
-- Resolve symlinks (such as `src` in the build dir) so that files are
-- opened in the right folder
let uri := DocumentUri.ofPath <| ← IO.FS.realPath path
if includeDefinition then
if let some range := info.definition then
result := result.push ⟨uri, range⟩