Skip to content

Commit

Permalink
fix(language-server): pass correct languageId when creating virtual code
Browse files Browse the repository at this point in the history
When virtual code was created, the URI was passed as the language ID.
Within MDX this means sometimes no virtual code was created at all,
breaking semantic diagnostics and syntax toggles. The effects may be
different for other implementations.
  • Loading branch information
remcohaszing committed May 5, 2024
1 parent 698f008 commit 0654c9b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/language-server/lib/project/simpleProject.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export async function createSimpleServerProject(
const language = createLanguage(languagePlugins, false, uri => {
const document = server.documents.get(uri);
if (document) {
language.scripts.set(uri, document.getSnapshot(), document.uri);
language.scripts.set(uri, document.getSnapshot(), document.languageId);
}
else {
language.scripts.delete(uri);
Expand Down

0 comments on commit 0654c9b

Please sign in to comment.