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
Use virtual module name when resolving string requires
This fixes a bug where the types of a required file would not correctly
update when that file changed. It is because, during string requires,
we use the real file path as the module name.
However, in other usages (e.g., during indexing), we use the virtual
file path if available. This caused an inconsistency between the two.
We fix this by calling "getModuleName" on the returned URI, which
is consistent with indexing.
Ideally in future, we should move towards a state where the
language server always works in the context of real file paths, especially
as string requires become more common. We should instead only
use a sourcemap to resolve virtual requires to real file paths, rather
than the other way round.
Copy file name to clipboardExpand all lines: CHANGELOG.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -20,6 +20,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
20
20
### Fixed
21
21
22
22
- Fixed autocompletion of strings with '/' characters causing the prefix to be duplicated rather than replaced ([#607](https://github.com/JohnnyMorganz/luau-lsp/issues/607))
23
+
- Fixed bug with string requires where a required files types may not correctly update when the file contents changed
0 commit comments