File tree Expand file tree Collapse file tree 1 file changed +14
-3
lines changed Expand file tree Collapse file tree 1 file changed +14
-3
lines changed Original file line number Diff line number Diff line change @@ -19,9 +19,20 @@ Luau::ModuleName WorkspaceFileResolver::getModuleName(const Uri& name)
1919const TextDocument* WorkspaceFileResolver::getTextDocument (const Luau::ModuleName& name) const
2020{
2121 auto it = managedFiles.find (name);
22- if (it == managedFiles.end ())
23- return nullptr ;
24- return &it->second ;
22+ if (it != managedFiles.end ())
23+ return &it->second ;
24+
25+ // HACK: attempting to solve "No managed text document"
26+ // Check to see if we have the file stored using the URI instead
27+ // https://github.com/JohnnyMorganz/luau-lsp/issues/26
28+ if (auto fsPath = resolveToRealPath (name))
29+ {
30+ it = managedFiles.find (fsPath->generic_string ());
31+ if (it != managedFiles.end ())
32+ return &it->second ;
33+ }
34+
35+ return nullptr ;
2536}
2637
2738std::optional<SourceNodePtr> WorkspaceFileResolver::getSourceNodeFromVirtualPath (const Luau::ModuleName& name) const
You can’t perform that action at this time.
0 commit comments