diff --git a/demos b/demos index f0e3559c0..0d46b4fbb 160000 --- a/demos +++ b/demos @@ -1 +1 @@ -Subproject commit f0e3559c0f7cfd8a083bac51d17374f9460d624d +Subproject commit 0d46b4fbb0fa548f82fe158de4c3228c4d59da2c diff --git a/src/cli/main.js b/src/cli/main.js index 77ca0f791..d7a9ab853 100644 --- a/src/cli/main.js +++ b/src/cli/main.js @@ -288,6 +288,18 @@ async function ci({ filenames }) { const [contents] = await file_javascript.load_contents_async(null); const text = new TextDecoder().decode(contents); + const file_jsconfig = Gio.File.new_for_path(pkg.pkgdatadir).get_child( + "langs/javascript/template/jsconfig.json", + ); + const dest = demo_dir.get_child("jsconfig.json"); + file_jsconfig.copy(dest, Gio.FileCopyFlags.OVERWRITE, null, null); + + // Notify the language server that the jsconfig file was created + // to initialize diagnostics and type checkings + await lsp_clients.javascript._notify("workspace/didCreateFile", { + files: [{ uri: dest.get_uri() }], + }); + await lsp_clients.javascript._notify("textDocument/didOpen", { textDocument: { uri, @@ -297,10 +309,15 @@ async function ci({ filenames }) { }, }); - const diagnostics = await waitForDiagnostics({ + let diagnostics = await waitForDiagnostics({ uri, lspc: lsp_clients.javascript, }); + diagnostics = diagnostics.filter((diagnostic) => { + return ![ + "'await' has no effect on the type of this expression.", + ].includes(diagnostic.message); + }); if (diagnostics.length > 0) { printerr(serializeDiagnostics({ diagnostics })); return false;