Skip to content

LSP: Html4J UI modified work over LSP.#4040

Merged
jtulach merged 10 commits into
apache:masterfrom
dbalek:dbalek/html4j-over-lsp
Aug 24, 2022
Merged

LSP: Html4J UI modified work over LSP.#4040
jtulach merged 10 commits into
apache:masterfrom
dbalek:dbalek/html4j-over-lsp

Conversation

@dbalek
Copy link
Copy Markdown
Contributor

@dbalek dbalek commented Apr 27, 2022

An attempt to rewrite html4j based refactoring UI for VSCode to work over LSP.

@dbalek dbalek added the do not merge Don't merge this PR, it is not ready or just demonstration purposes. label Apr 27, 2022
@dbalek dbalek requested a review from jtulach April 27, 2022 16:38
@dbalek dbalek requested a review from sdedic May 19, 2022 15:20
@dbalek dbalek added LSP [ci] enable Language Server Protocol tests do not merge Don't merge this PR, it is not ready or just demonstration purposes. and removed do not merge Don't merge this PR, it is not ready or just demonstration purposes. labels May 19, 2022
Comment thread java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/htmlui/Buttons.java Outdated
Comment thread java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/htmlui/Browser.java Outdated
@jtulach
Copy link
Copy Markdown
Contributor

jtulach commented May 31, 2022

With be02cff one should be able to stop the Java execution before sending a message to VSCode:

image

And just by setting pause = true in the evaluation window the execution will then stop in chrome dev tools in VSCode:

image

@JaroslavTulach
Copy link
Copy Markdown

The Change Refactoring UI seems to be working with generic and ko4j modules from apache/netbeans-html4j@f031ed4 - I'll prepare a release 1.8.1.

@jtulach jtulach force-pushed the dbalek/html4j-over-lsp branch from e83b394 to 6c9ab9a Compare July 7, 2022 05:55
@jtulach jtulach added this to the NB15 milestone Jul 14, 2022
@jtulach
Copy link
Copy Markdown
Contributor

jtulach commented Jul 14, 2022

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.

@neilcsmith-net neilcsmith-net modified the milestones: NB15, NB16 Jul 18, 2022
@dbalek dbalek force-pushed the dbalek/html4j-over-lsp branch from 6c9ab9a to fb8d1c8 Compare July 18, 2022 11:29
@dbalek dbalek removed the do not merge Don't merge this PR, it is not ready or just demonstration purposes. label Jul 18, 2022
@dbalek dbalek requested a review from jtulach July 18, 2022 11:36
Copy link
Copy Markdown
Contributor

@jtulach jtulach left a 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.

Comment thread java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/htmlui/Browser.java Outdated
private void emitScript(StringBuilder sb, String id) throws IOException {

sb.append("<script id='exec' type='text/javascript'>\n"
+ "const vscode = acquireVsCodeApi();\n"
Copy link
Copy Markdown
Contributor

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.

Comment thread java/java.lsp.server/vscode/package.json
Comment thread platform/api.htmlui/src/org/netbeans/spi/htmlui/HTMLViewerSpi.java Outdated
@jtulach jtulach merged commit 2038295 into apache:master Aug 24, 2022
Chris2011 pushed a commit to Chris2011/netbeans that referenced this pull request Dec 15, 2022
* LSP: Html4J UI modified work over LSP.
* Updating HTML4J to version 1.8.1.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

LSP [ci] enable Language Server Protocol tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants