ConfigResolver / Luau::parseConfig
should store location of resolved config alongside alias
#1417
Labels
enhancement
New feature or request
I would like to start implementing alias resolution via
.luaurc
for Luau LSP.We already use
Luau::ConfigResolver
from Luau.Analysis, so it seems like it would be best to continue using that. Luau LSP essentially replicates the same CliConfigResolver used for luau-analyze:luau/CLI/Analyze.cpp
Line 193 in e8a7acb
The problem right now, however, is that once we want to start resolving aliases, we do not have the correct location to resolve it relative to. The aliases RFC states (https://github.com/luau-lang/rfcs/blob/master/docs/require-by-string-aliases.md):
However this location is not preserved via
Luau::parseConfig
, making theConfig
datastructure unsuitable for alias resolution in analyse.The Luau REPL does not seem to have this issue because it decides to implement its own recursive config resolution, and ends up storing and later referencing
lastSearchedDir
:luau/CLI/Require.cpp
Line 256 in e8a7acb
luau/CLI/Require.cpp
Line 253 in e8a7acb
As an aside, do you folks intend to support the new require-by-string + aliases in
luau-analyze
soon? I imagine you will hit this same issue once you do so.The text was updated successfully, but these errors were encountered: