This is an automated email from the ASF dual-hosted git repository.
mbalin pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans.git
The following commit(s) were added to refs/heads/master by this push:
new cec07f4604 Work on documents, not on editors. Translate filenames on
Windows
new f3e3311159 Merge pull request #6941 from sdedic/lsp/save-document-fix
cec07f4604 is described below
commit cec07f4604def0fd7227a371c50813d06d86eac8
Author: Svata Dedic <[email protected]>
AuthorDate: Wed Jan 10 10:09:51 2024 +0100
Work on documents, not on editors. Translate filenames on Windows
---
java/java.lsp.server/vscode/src/extension.ts | 16 ++++++++++++----
1 file changed, 12 insertions(+), 4 deletions(-)
diff --git a/java/java.lsp.server/vscode/src/extension.ts
b/java/java.lsp.server/vscode/src/extension.ts
index 841a95c070..d743950e54 100644
--- a/java/java.lsp.server/vscode/src/extension.ts
+++ b/java/java.lsp.server/vscode/src/extension.ts
@@ -1063,12 +1063,20 @@ function doActivateWithJDK(specifiedJDK: string | null,
context: ExtensionContex
runConfigurationUpdateAll();
});
c.onRequest(SaveDocumentsRequest.type, async (request :
SaveDocumentRequestParams) => {
- for (let ed of window.visibleTextEditors) {
- if
(request.documents.includes(ed.document.uri.toString())) {
- await
vscode.commands.executeCommand('workbench.action.files.save', ed.document.uri);
+ const uriList = request.documents.map(s => {
+ let re = /^file:\/(?:\/\/)?([A-Za-z]):\/(.*)$/.exec(s);
+ if (!re) {
+ return s;
+ }
+ // don't ask why vscode mangles URIs this way; in
addition, it uses lowercase drive letter ???
+ return `file:///${re[1].toLowerCase()}%3A/${re[2]}`;
+ });
+ for (let ed of workspace.textDocuments) {
+ if (uriList.includes(ed.uri.toString())) {
+ return ed.save();
}
}
- return true;
+ return false;
});
c.onRequest(InputBoxRequest.type, async param => {
return await window.showInputBox({ title: param.title, prompt:
param.prompt, value: param.value, password: param.password });
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists