diff --git a/java/java.lsp.server/licenseinfo.xml b/java/java.lsp.server/licenseinfo.xml
index f98f29338b9b..b2f957aee746 100644
--- a/java/java.lsp.server/licenseinfo.xml
+++ b/java/java.lsp.server/licenseinfo.xml
@@ -27,6 +27,11 @@
vscode/src/extension.ts
+
+ src/org/netbeans/modules/java/lsp/server/refactoring/ui/codicon.ttf
+ src/org/netbeans/modules/java/lsp/server/refactoring/ui/codicon.css
+
+
vscode/.vscodeignore
vscode/.eslintrc.json
diff --git a/java/java.lsp.server/nbproject/org-netbeans-modules-java-lsp-server.sig b/java/java.lsp.server/nbproject/org-netbeans-modules-java-lsp-server.sig
index 398d3c2c50ba..6e1607d163c0 100644
--- a/java/java.lsp.server/nbproject/org-netbeans-modules-java-lsp-server.sig
+++ b/java/java.lsp.server/nbproject/org-netbeans-modules-java-lsp-server.sig
@@ -1,5 +1,5 @@
#Signature file v4.1
-#Version 1.10.0
+#Version 1.14.0
CLSS public java.lang.Object
cons public init()
@@ -23,6 +23,35 @@ meth public void notifyLater(org.openide.NotifyDescriptor)
supr org.openide.DialogDisplayer
hfds context
+CLSS public org.netbeans.modules.java.lsp.server.ui.AbstractGlobalActionContext
+cons public init()
+intf org.openide.util.ContextGlobalProvider
+intf org.openide.util.Lookup$Provider
+meth public org.openide.util.Lookup createGlobalContext()
+meth public org.openide.util.Lookup getLookup()
+meth public static <%0 extends java.lang.Object> {%%0} withActionContext(org.openide.util.Lookup,java.util.concurrent.Callable<{%%0}>)
+supr java.lang.Object
+hcls ContextHolder
+
+CLSS public org.netbeans.modules.java.lsp.server.ui.AbstractLspHtmlViewer
+cons protected init()
+innr protected final View
+intf org.netbeans.spi.htmlui.HTMLViewerSpi
+meth public <%0 extends java.lang.Object> {%%0} component(org.netbeans.modules.java.lsp.server.ui.AbstractLspHtmlViewer$View,java.lang.Class<{%%0}>)
+meth public java.lang.Object createButton(org.netbeans.modules.java.lsp.server.ui.AbstractLspHtmlViewer$View,java.lang.String)
+meth public java.lang.String getId(org.netbeans.modules.java.lsp.server.ui.AbstractLspHtmlViewer$View,java.lang.Object)
+meth public org.netbeans.modules.java.lsp.server.ui.AbstractLspHtmlViewer$View newView(org.netbeans.spi.htmlui.HTMLViewerSpi$Context)
+meth public void runLater(org.netbeans.modules.java.lsp.server.ui.AbstractLspHtmlViewer$View,java.lang.Runnable)
+meth public void setEnabled(org.netbeans.modules.java.lsp.server.ui.AbstractLspHtmlViewer$View,java.lang.Object,boolean)
+meth public void setText(org.netbeans.modules.java.lsp.server.ui.AbstractLspHtmlViewer$View,java.lang.Object,java.lang.String)
+supr java.lang.Object
+hfds initial
+
+CLSS protected final org.netbeans.modules.java.lsp.server.ui.AbstractLspHtmlViewer$View
+ outer org.netbeans.modules.java.lsp.server.ui.AbstractLspHtmlViewer
+supr java.lang.Object
+hfds ctx,presenter,ui
+
CLSS public abstract org.netbeans.modules.java.lsp.server.ui.AbstractLspInputOutputProvider
cons protected init()
innr public final static LspIO
@@ -92,6 +121,7 @@ meth protected abstract java.util.concurrent.CompletableFuture showHtmlPage(org.netbeans.modules.java.lsp.server.protocol.HtmlPageParams)
meth public static org.netbeans.modules.java.lsp.server.ui.UIContext find()
anno 0 org.netbeans.api.annotations.common.NonNull()
meth public static org.netbeans.modules.java.lsp.server.ui.UIContext find(org.openide.util.Lookup)
@@ -104,6 +134,16 @@ CLSS public abstract interface org.netbeans.modules.progress.spi.ProgressEnviron
meth public abstract org.netbeans.api.progress.ProgressHandle createHandle(java.lang.String,org.openide.util.Cancellable,boolean)
meth public abstract org.netbeans.modules.progress.spi.Controller getController()
+CLSS public abstract interface org.netbeans.spi.htmlui.HTMLViewerSpi<%0 extends java.lang.Object, %1 extends java.lang.Object>
+innr public final static Context
+meth public abstract <%0 extends java.lang.Object> {%%0} component({org.netbeans.spi.htmlui.HTMLViewerSpi%0},java.lang.Class<{%%0}>)
+meth public abstract java.lang.String getId({org.netbeans.spi.htmlui.HTMLViewerSpi%0},{org.netbeans.spi.htmlui.HTMLViewerSpi%1})
+meth public abstract void runLater({org.netbeans.spi.htmlui.HTMLViewerSpi%0},java.lang.Runnable)
+meth public abstract void setEnabled({org.netbeans.spi.htmlui.HTMLViewerSpi%0},{org.netbeans.spi.htmlui.HTMLViewerSpi%1},boolean)
+meth public abstract void setText({org.netbeans.spi.htmlui.HTMLViewerSpi%0},{org.netbeans.spi.htmlui.HTMLViewerSpi%1},java.lang.String)
+meth public abstract {org.netbeans.spi.htmlui.HTMLViewerSpi%0} newView(org.netbeans.spi.htmlui.HTMLViewerSpi$Context)
+meth public abstract {org.netbeans.spi.htmlui.HTMLViewerSpi%1} createButton({org.netbeans.spi.htmlui.HTMLViewerSpi%0},java.lang.String)
+
CLSS public abstract interface org.netbeans.spi.io.InputOutputProvider<%0 extends java.lang.Object, %1 extends java.io.PrintWriter, %2 extends java.lang.Object, %3 extends java.lang.Object>
meth public abstract boolean isIOClosed({org.netbeans.spi.io.InputOutputProvider%0})
anno 1 org.netbeans.api.annotations.common.NonNull()
@@ -190,3 +230,27 @@ supr java.lang.Object
hfds INSTANCE
hcls Trivial
+CLSS public abstract interface org.openide.util.ContextGlobalProvider
+meth public abstract org.openide.util.Lookup createGlobalContext()
+
+CLSS public abstract org.openide.util.Lookup
+cons public init()
+fld public final static org.openide.util.Lookup EMPTY
+innr public abstract interface static Provider
+innr public abstract static Item
+innr public abstract static Result
+innr public final static Template
+meth public <%0 extends java.lang.Object> java.util.Collection extends {%%0}> lookupAll(java.lang.Class<{%%0}>)
+meth public <%0 extends java.lang.Object> org.openide.util.Lookup$Item<{%%0}> lookupItem(org.openide.util.Lookup$Template<{%%0}>)
+meth public <%0 extends java.lang.Object> org.openide.util.Lookup$Result<{%%0}> lookupResult(java.lang.Class<{%%0}>)
+meth public abstract <%0 extends java.lang.Object> org.openide.util.Lookup$Result<{%%0}> lookup(org.openide.util.Lookup$Template<{%%0}>)
+meth public abstract <%0 extends java.lang.Object> {%%0} lookup(java.lang.Class<{%%0}>)
+meth public static org.openide.util.Lookup getDefault()
+supr java.lang.Object
+hfds LOG,defaultLookup,defaultLookupProvider
+hcls DefLookup,Empty
+
+CLSS public abstract interface static org.openide.util.Lookup$Provider
+ outer org.openide.util.Lookup
+meth public abstract org.openide.util.Lookup getLookup()
+
diff --git a/java/java.lsp.server/nbproject/project.properties b/java/java.lsp.server/nbproject/project.properties
index 13e2c2cd50ca..2d7c0f38f8e7 100644
--- a/java/java.lsp.server/nbproject/project.properties
+++ b/java/java.lsp.server/nbproject/project.properties
@@ -17,7 +17,7 @@
javac.source=1.8
javac.compilerargs=-Xlint -Xlint:-serial
-spec.version.base=1.13.0
+spec.version.base=1.14.0
requires.nb.javac=true
lsp.build.dir=vscode/nbcode
test.unit.run.cp.extra=
diff --git a/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/htmlui/Buttons.java b/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/htmlui/Buttons.java
new file mode 100644
index 000000000000..c5489918e5eb
--- /dev/null
+++ b/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/htmlui/Buttons.java
@@ -0,0 +1,81 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.netbeans.modules.java.lsp.server.htmlui;
+
+import net.java.html.js.JavaScriptBody;
+import org.netbeans.spi.htmlui.HTMLViewerSpi;
+
+/**
+ * Helper utilities to deal with HTML buttons.
+ */
+public final class Buttons {
+ private Buttons() {
+ }
+
+ @JavaScriptBody(args = {}, body = "\n"
+ + "const vscode = acquireVsCodeApi();\n" // this method can be called only once per WebView existance
+ + "window.close = function() {\n"
+ + " vscode.postMessage({\n"
+ + " command: 'dispose',\n"
+ + " });\n"
+ + "};\n"
+ )
+ public static native void registerCloseWindow();
+
+ @JavaScriptBody(args = { "id", "callback" }, javacall = true, body = "\n"
+ + "var first = false;\n"
+ + "var footer = document.getElementById('dialog-buttons');\n"
+ + "if (!footer) {\n"
+ + " first = true\n"
+ + " footer = document.createElement('div');\n"
+ + " footer.id = 'dialog-buttons';\n"
+ + " footer.classList.add('flex');\n"
+ + " footer.classList.add('section');\n"
+ + " document.body.appendChild(footer);\n"
+ + "}\n"
+ + "var button = document.createElement('button');\n"
+ + "button.id = id;\n"
+ + "button.onclick = function() {;\n"
+ + " @org.netbeans.modules.java.lsp.server.htmlui.Buttons::clickButton0(Ljava/lang/String;Ljava/lang/Object;)(id, callback);\n"
+ + "};\n"
+ + "button.classList.add('regular-button');\n"
+ + "button.classList.add('vscode-font');\n"
+ + "if (first) {\n"
+ + " button.classList.add('align-right');\n"
+ + "}\n"
+ + "footer.appendChild(button);\n"
+ + "return button;\n"
+ )
+ public native static Object createButton0(String id, HTMLViewerSpi.Context callback);
+
+ static void clickButton0(String id, Object callback) {
+ HTMLViewerSpi.Context ctx = (HTMLViewerSpi.Context) callback;
+ ctx.onSubmit(id);
+ }
+
+ @JavaScriptBody(args = { "b" }, body = "return b.id;")
+ public native static String buttonName0(Object b);
+
+ @JavaScriptBody(args = { "b", "text" }, body = "b.innerHTML = text;")
+ public native static void buttonText0(Object b, String text);
+
+ @JavaScriptBody(args = { "b", "disabled" }, body = "return b.disabled = disabled;")
+ public native static String buttonDisabled0(Object b, boolean disabled);
+
+}
diff --git a/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/protocol/ChangeMethodParametersRefactoring.java b/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/protocol/ChangeMethodParametersRefactoring.java
deleted file mode 100644
index 157fdce6753a..000000000000
--- a/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/protocol/ChangeMethodParametersRefactoring.java
+++ /dev/null
@@ -1,273 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.netbeans.modules.java.lsp.server.protocol;
-
-import com.google.gson.Gson;
-import com.sun.source.tree.BlockTree;
-import com.sun.source.tree.ClassTree;
-import com.sun.source.tree.StatementTree;
-import com.sun.source.tree.Tree;
-import com.sun.source.util.SourcePositions;
-import com.sun.source.util.TreePath;
-import com.sun.source.util.Trees;
-import java.io.IOException;
-import java.util.Collections;
-import java.util.List;
-import java.util.Set;
-import java.util.concurrent.CompletableFuture;
-import java.util.concurrent.atomic.AtomicReference;
-import javax.lang.model.element.Element;
-import javax.lang.model.element.ElementKind;
-import javax.lang.model.element.ExecutableElement;
-import javax.lang.model.element.VariableElement;
-import javax.lang.model.type.TypeKind;
-import org.eclipse.lsp4j.ApplyWorkspaceEditParams;
-import org.eclipse.lsp4j.CodeAction;
-import org.eclipse.lsp4j.CodeActionKind;
-import org.eclipse.lsp4j.CodeActionParams;
-import org.eclipse.lsp4j.MessageParams;
-import org.eclipse.lsp4j.MessageType;
-import org.netbeans.api.java.source.ClasspathInfo;
-import org.netbeans.api.java.source.CompilationController;
-import org.netbeans.api.java.source.CompilationInfo;
-import org.netbeans.api.java.source.ElementHandle;
-import org.netbeans.api.java.source.JavaSource;
-import org.netbeans.api.java.source.SourceUtils;
-import org.netbeans.api.java.source.TreePathHandle;
-import org.netbeans.api.java.source.TreeUtilities;
-import org.netbeans.modules.editor.java.Utilities;
-import org.netbeans.modules.java.lsp.server.Utils;
-import org.netbeans.modules.parsing.api.ResultIterator;
-import org.netbeans.modules.refactoring.java.api.ChangeParametersRefactoring;
-import org.netbeans.modules.refactoring.java.api.JavaRefactoringUtils;
-import org.openide.filesystems.FileObject;
-import org.openide.util.NbBundle;
-import org.openide.util.lookup.ServiceProvider;
-
-/**
- *
- * @author Dusan Balek
- */
-@ServiceProvider(service = CodeActionsProvider.class, position = 200)
-public final class ChangeMethodParametersRefactoring extends CodeRefactoring {
-
- private static final String CHANGE_METHOD_PARAMS_REFACTORING_KIND = "refactor.change.method.params";
- private static final String CHANGE_METHOD_PARAMS_REFACTORING_COMMAND = "java.refactor.change.method.params";
-
- private final Set commands = Collections.singleton(CHANGE_METHOD_PARAMS_REFACTORING_COMMAND);
- private final Gson gson = new Gson();
-
- @Override
- @NbBundle.Messages({
- "DN_ChangeMethodParams=Change Method Parameters...",
- })
- public List getCodeActions(ResultIterator resultIterator, CodeActionParams params) throws Exception {
- List only = params.getContext().getOnly();
- if (only == null || !only.contains(CodeActionKind.Refactor)) {
- return Collections.emptyList();
- }
- CompilationController info = CompilationController.get(resultIterator.getParserResult());
- if (info == null || !JavaRefactoringUtils.isRefactorable(info.getFileObject())) {
- return Collections.emptyList();
- }
- info.toPhase(JavaSource.Phase.ELEMENTS_RESOLVED);
- int offset = getOffset(info, params.getRange().getStart());
- Trees trees = info.getTrees();
- TreePath path = info.getTreeUtilities().pathFor(offset);
- Tree.Kind kind = null;
- while (path != null && (kind = path.getLeaf().getKind()) != Tree.Kind.METHOD && kind != Tree.Kind.METHOD_INVOCATION && kind != Tree.Kind.NEW_CLASS && kind != Tree.Kind.MEMBER_REFERENCE) {
- path = path.getParentPath();
- }
- Element element = null;
- FileObject elementSource = null;
- if (kind == Tree.Kind.METHOD_INVOCATION || kind == Tree.Kind.NEW_CLASS || kind == Tree.Kind.MEMBER_REFERENCE) {
- element = trees.getElement(path);
- if (element == null || element.asType().getKind() == TypeKind.ERROR) {
- return Collections.emptyList();
- }
- elementSource = SourceUtils.getFile(ElementHandle.create(element), info.getClasspathInfo());
- }
- if (elementSource == null) {
- return Collections.emptyList();
- }
- QuickPickItem elementItem = new QuickPickItem(createLabel(info, element, true));
- elementItem.setUserData(new ElementData(element));
- return Collections.singletonList(createCodeAction(Bundle.DN_ChangeMethodParams(), CHANGE_METHOD_PARAMS_REFACTORING_KIND, null, CHANGE_METHOD_PARAMS_REFACTORING_COMMAND, Utils.toUri(elementSource), elementItem));
- }
-
- @Override
- public Set getCommands() {
- return commands;
- }
-
- @Override
- @NbBundle.Messages({
- "DN_ChangeMethodSignature=Change method signature",
- })
- public CompletableFuture