From a4c31f19d637bc8afa59947eb5c4d6f4b46764fb Mon Sep 17 00:00:00 2001 From: Svata Dedic Date: Wed, 4 Sep 2024 16:45:01 +0200 Subject: [PATCH] Save just documents that are local files reachable by NBLS --- java/java.lsp.server/vscode/src/extension.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/java/java.lsp.server/vscode/src/extension.ts b/java/java.lsp.server/vscode/src/extension.ts index e094374a1f1e..b1cae9698f3e 100644 --- a/java/java.lsp.server/vscode/src/extension.ts +++ b/java/java.lsp.server/vscode/src/extension.ts @@ -280,7 +280,10 @@ function wrapCommandWithProgress(lsCommand : string, title : string, log? : vsco return window.withProgress({ location: ProgressLocation.Window }, p => { return new Promise(async (resolve, reject) => { let c : LanguageClient = await client; - await vscode.commands.executeCommand('workbench.action.files.saveAll'); + const docsTosave : Thenable[]= vscode.workspace.textDocuments. + filter(d => fs.existsSync(d.uri.fsPath)). + map(d => d.save()); + await Promise.all(docsTosave); const commands = await vscode.commands.getCommands(); if (commands.includes(lsCommand)) { p.report({ message: title });