However, at the moment, we are most often using e.g. getFileContents, which only reads from the VFS. That might be fine (it avoids doing filesystem IO, which might be desirable), but it should be very obvious. There is a function that falls back to the filesystem, the confusingly named getSourceFileSource, but it's not as widely used.
We should clarify the situation and try to make things more consistent.
At the moment it's a little unclear how HLS (rules, plugin handlers, everything really) is supposed to access information about files.
We have two possible sources of information:
Where do we look? What do we do if something is not in the VFS?
After some discussion on IRC, @fendor and I came to the following conclusion:
See also the prose in the spec: https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#textDocument_didOpen
However, at the moment, we are most often using e.g.
getFileContents
, which only reads from the VFS. That might be fine (it avoids doing filesystem IO, which might be desirable), but it should be very obvious. There is a function that falls back to the filesystem, the confusingly namedgetSourceFileSource
, but it's not as widely used.We should clarify the situation and try to make things more consistent.