matthiasblaesing commented on a change in pull request #3349:
URL: https://github.com/apache/netbeans/pull/3349#discussion_r762586023



##########
File path: 
java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/ui/AbstractLspHtmlViewer.java
##########
@@ -0,0 +1,150 @@
+/*
+ * 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.ui;
+
+import java.net.URL;
+import java.util.concurrent.Callable;
+import java.util.function.Consumer;
+import net.java.html.js.JavaScriptBody;
+import org.netbeans.modules.java.lsp.server.htmlui.Browser;
+import org.netbeans.modules.java.lsp.server.protocol.HtmlPageParams;
+import org.netbeans.spi.htmlui.HtmlViewer;
+import org.openide.util.Exceptions;
+
+public class AbstractLspHtmlViewer implements 
HtmlViewer<AbstractLspHtmlViewer.View> {
+    protected AbstractLspHtmlViewer() {
+    }
+
+    @Override
+    public View newView(Consumer<String> lifeCycleCallback) {
+        UIContext ui = UIContext.find();
+        return new View(ui, lifeCycleCallback);
+    }
+
+    @Override
+    public void makeVisible(View view, Runnable whenReady) {
+        whenReady.run();
+    }
+
+    @Override
+    public void load(View view, ClassLoader loader, URL pageUrl, 
Callable<Object> initialize, String[] techIds) {
+        view.load(pageUrl, initialize);
+    }
+
+    @JavaScriptBody(args = {}, body = "\n"
+        + "const vscode = acquireVsCodeApi();\n" // this method can be called 
only once per WebView existance

Review comment:
       What I see is, that refactoring is in no way specific to a Java LSP and 
looking at:
   
   
https://microsoft.github.io/language-server-protocol/specification#textDocument_codeAction
   
https://microsoft.github.io/language-server-protocol/specifications/specification-3-17/#codeActionKind
   
   I think this is a known problem and the protocol is beginning to build up 
support for it. I'm in no way an export on LSP, but I doubt, that it is 
sensisble, if such a generic functionality (refactorings) is reimplemented by 
each provider and even worse by each client.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
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

Reply via email to