-
Notifications
You must be signed in to change notification settings - Fork 821
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
LSP: Html4J UI modified work over LSP. #4040
Conversation
java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/htmlui/Buttons.java
Outdated
Show resolved
Hide resolved
java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/htmlui/Browser.java
Outdated
Show resolved
Hide resolved
With be02cff one should be able to stop the Java execution before sending a message to VSCode: And just by setting |
The Change Refactoring UI seems to be working with |
e83b394
to
6c9ab9a
Compare
HTML/Java 1.8.1 is available on Maven central. @dbalek please replace 6c9ab9a with proper external binaries. I hope this will make it into NetBeans 15. |
…nt to the WebView
6c9ab9a
to
fb8d1c8
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great and if it works for VSCode, then perfect!
In addition I'd like to see usage of resources
in the JavaFX WebView implementation to load the refactoring.css
. Probably the implementation shall create a temporary directory and copy the resources there to get file
protocol URL. Right now the SPI returns URL[]
and I am afraid it it is going to be of little use - possibly String[]
of relative paths to main page would be better. The JavaFX WebView implementation may wait for another PR, but we don't want to create an SPI that is wrong to begin with.
java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/htmlui/Browser.java
Outdated
Show resolved
Hide resolved
private void emitScript(StringBuilder sb, String id) throws IOException { | ||
|
||
sb.append("<script id='exec' type='text/javascript'>\n" | ||
+ "const vscode = acquireVsCodeApi();\n" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a potential security threat. VSCode team tries hard not to allow untrusted scripting code access the API. However, right now your are only running trusted code - but avoid downloading any HTML file or JS file from network.
java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/htmlui/Browser.java
Outdated
Show resolved
Hide resolved
java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/htmlui/Buttons.java
Show resolved
Hide resolved
.../src/org/netbeans/modules/java/lsp/server/refactoring/ChangeMethodParametersRefactoring.java
Show resolved
Hide resolved
java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/ui/AbstractLspHtmlViewer.java
Outdated
Show resolved
Hide resolved
platform/api.htmlui/src/org/netbeans/spi/htmlui/HTMLViewerSpi.java
Outdated
Show resolved
Hide resolved
* LSP: Html4J UI modified work over LSP. * Updating HTML4J to version 1.8.1.
An attempt to rewrite
html4j
based refactoring UI for VSCode to work over LSP.