Open Arc157 opened 1 month ago
Seems the same issue as https://github.com/JohnnyMorganz/luau-lsp/issues/583#issuecomment-2226895942
Can you double check the URI used to open the document is the same URI used to send the request?
Seems the same issue as #583 (comment)
Can you double check the URI used to open the document is the same URI used to send the request?
I'm not sure how to debug that, my client is based upon monaco-languageclient (https://github.com/TypeFox/monaco-languageclient). Do you know by any chance where that behaviour is defined?
Seems the same issue as #583 (comment)
Can you double check the URI used to open the document is the same URI used to send the request?
Alright, I did some digging and turns out they're the same
Alright, I managed to fix this issue by just simply adjusting this code from https://github.com/JohnnyMorganz/luau-lsp/blob/main/src/WorkspaceFileResolver.cpp:
const TextDocument* WorkspaceFileResolver::getTextDocumentFromModuleName(const Luau::ModuleName& name) const
{
// Handle untitled: files
if (Luau::startsWith(name, "untitled:"))
return getTextDocument(Uri::parse(name));
if (auto filePath = platform->resolveToRealPath(name))
return getTextDocument(Uri::file(*filePath));
return nullptr;
}
const TextDocument* WorkspaceFileResolver::getTextDocumentFromModuleName(const Luau::ModuleName& name) const
{
// Handle untitled: files
if (Luau::startsWith(name, "untitled:"))
return getTextDocument(Uri::parse(name));
if (auto filePath = platform->resolveToRealPath(name)) {
auto it = managedFiles.find(filePath->generic_string());
if (it != managedFiles.end()) {
return &it->second;
}
return getTextDocument(Uri::file(*filePath));
}
return nullptr;
}
I'll push a pull request soon.
Ah I think the problem is the incorrect call to Uri::file
for a non-file-based URI, rather than the added managed files lookup (getTextDocument already handles lookup in managed files)
Ah I think the problem is the incorrect call to
Uri::file
for a non-file-based URI, rather than the added managed files lookup (getTextDocument already handles lookup in managed files)
Is there a prebuilt API within luau-lsp to detect if its a non-file-based URI, or does that have to be implemented?
Hello, I'm trying to upgrade my project from using version 1.16.2 of luau-lsp to the latest version (1.33.1), but during this process I encountered an issue. The language server in itself does seem to work, but requests like hover no longer get a correct response in version 1.16.3, but if I just revert to 1.16.2 it works fine.
1.16.2:
1.16.3:
Here's my server.ts file:
Any help is appreciated!