You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@netbeans.apache.org by jt...@apache.org on 2021/01/07 10:28:42 UTC
[netbeans] branch release122 updated: Disabling canClose dialog
This is an automated email from the ASF dual-hosted git repository.
jtulach pushed a commit to branch release122
in repository https://gitbox.apache.org/repos/asf/netbeans.git
The following commit(s) were added to refs/heads/release122 by this push:
new af78d2e Disabling canClose dialog
new fab5283 Merge pull request #2646 from JaroslavTulach/jtulach/DisableCanCloseDialog
af78d2e is described below
commit af78d2eec37911adb590ca26ff9e2786cb98ba1e
Author: Jaroslav Tulach <ja...@oracle.com>
AuthorDate: Thu Jan 7 08:00:01 2021 +0100
Disabling canClose dialog
---
.../java/lsp/server/ui/AbstractDialogDisplayer.java | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/ui/AbstractDialogDisplayer.java b/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/ui/AbstractDialogDisplayer.java
index 35e05a0..a35ba88 100644
--- a/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/ui/AbstractDialogDisplayer.java
+++ b/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/ui/AbstractDialogDisplayer.java
@@ -46,6 +46,22 @@ public class AbstractDialogDisplayer extends DialogDisplayer {
@Override
public Object notify(NotifyDescriptor descriptor) {
LspServerUtils.avoidClientMessageThread(context);
+
+ // XXX: Subject to better fix
+ // XXX: Possibly use 3.16 protocol's willRename/didRename
+ // XXX: when available
+ StackTraceElement[] stack = new Exception().getStackTrace();
+ if (stack.length > 2 && stack[1] != null) {
+ if (
+ "org.openide.text.DataEditorSupport".equals(stack[1].getClassName()) &&
+ "canClose".equals(stack[1].getMethodName())
+ ) {
+ // when VSCode renames modified file, don't try to save the
+ // original
+ return NotifyDescriptor.CLOSED_OPTION;
+ }
+ }
+
UIContext ctx = UIContext.find(context);
NotifyDescriptorAdapter adapter = new NotifyDescriptorAdapter(descriptor, ctx);
return adapter.clientNotify();
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@netbeans.apache.org
For additional commands, e-mail: commits-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists