You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
At the moment, the language server uses virtual file paths as the internal representation for different files. This stems from the original usages where everything was based off Roblox-style instance requires plus a source map.
This behaviour however always leads to subtle bugs where the internal representation (a virtual file path resolved via the sourcemap) may not always match. For example, before c43f068, string requires would always resolve to the real file path. This could cause mismatching if the language server had already resolved a file using a virtual file path. Hence the internal state of the file in the Luau analysis phase would not update when using string requires - it depends on whether the file was resolved virtually or not.
Given that string requires seem to be the future, and the fact that the language server is working primarily with files, it probably makes sense to reconsider the usage of "virtual paths" throughout the server. In the long run this will probably make our lives a lot easier, given that real file paths are also what the language server protocol expects.
We should flip it around, where real file paths become the source of truth for the internal state of the language server. When necessary, we can map a virtual file path to a real one, by using a sourcemap.
The text was updated successfully, but these errors were encountered:
At the moment, the language server uses virtual file paths as the internal representation for different files. This stems from the original usages where everything was based off Roblox-style instance requires plus a source map.
This behaviour however always leads to subtle bugs where the internal representation (a virtual file path resolved via the sourcemap) may not always match. For example, before c43f068, string requires would always resolve to the real file path. This could cause mismatching if the language server had already resolved a file using a virtual file path. Hence the internal state of the file in the Luau analysis phase would not update when using string requires - it depends on whether the file was resolved virtually or not.
Given that string requires seem to be the future, and the fact that the language server is working primarily with files, it probably makes sense to reconsider the usage of "virtual paths" throughout the server. In the long run this will probably make our lives a lot easier, given that real file paths are also what the language server protocol expects.
We should flip it around, where real file paths become the source of truth for the internal state of the language server. When necessary, we can map a virtual file path to a real one, by using a sourcemap.
The text was updated successfully, but these errors were encountered: