Myriad-Dreamin / tinymist

Tinymist [ˈtaɪni mɪst] is an integrated language service for Typst [taɪpst].
https://myriad-dreamin.github.io/tinymist
Apache License 2.0
544 stars 27 forks source link

Support for symlinked files/directories #336

Open Andrew15-5 opened 3 months ago

Andrew15-5 commented 3 months ago

Motivation

I have a common setting file(s) that can be used in multiple projects. Naturally, to keep it all synced, I use symbolic link (for a dir, that contains this file). This way, Typst wouldn't complain that the file is outside of the project root.

The problem then arise when I pin the main file and then suddenly LSP features disappear from that setting file, but at least now you have correct error diagnostics. It turns out, that most likely it's because the client always automatically opens the target path, i.e., not the symlinked path. Which then indicates that the setting file is not from the project and LSP functionality stops working in it.

Description

The server/client should somehow indicate/provide the symlinked path so that the LSP functionality can be used in the symlinked file too.

Examples/Questions

I have no concrete solution for this and feel like on the surface level this is a hard problem to solve.

Andrew15-5 commented 3 months ago

I found out that because I was using plugins, the path to the file was absolute/resolved (:reg). But after manually opening specifically the symlinked file and pinning the main one, the LSP stopped working again.