-
Notifications
You must be signed in to change notification settings - Fork 31
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
Create downloadable lemminx-maven uber JAR #434
Create downloadable lemminx-maven uber JAR #434
Conversation
Do I get it right this "uber-jar" is only for VSCode? If so, let's call it |
cd0c81c
to
2fce501
Compare
In theory, one can use it together with lemminx LS not only in vscode, but currently I don't know such cases. |
d5170a2
to
1317ff5
Compare
@vrubezhny could you please add somewhere (in the README?) the explanation where donwload this uber jar and explain the vscode settings to use to consume lemminx maven in vscode please. |
I'm trying to add the required dependencies to the uber jar, but unfortunately it doesn't work yet.
Also, I have a feeling like the jar is not properly created because it's messed somehow with
|
1317ff5
to
854aa43
Compare
@angelozerr Sure, I'll add this info when the uber jar will be functional... at the moment it is not due to the missing dependencies problem (see: #434 (comment)) |
854aa43
to
0010ae0
Compare
Great! Thanks so much @vrubezhny to work on this issue! It will help to promote using lemminx-maven in vscode. |
@mickaelistria It looks like because we exclude transitive dependencies from being added to the lemminx-maven.jar (for example
Do you know how can I re-add these to the assembly? I don't think we really need all of these, but it looks like re really need |
The lemminx-maven jar only contains lemminx-maven, no deps. I don't think anyone actually uses the other existing assembly, |
0010ae0
to
876f391
Compare
So, I've spitted the assembly configurations so, now they are built independently from each other.
When running n Eclipse, this normally returns an object of
|
I'm afraid a uber-jar cannot work with plexus. There are many components.xml files coming from various dependencies, if any of those is missing or overriden, then plexus will fail. Hence I think that jars need to remain separated. |
Using the separated jars (all the lemminx-maven dependency jars + lemminx-maven jar) and pointing to them in
Screencast_07_12_2023_03.30.15_PM.webm |
@vrubezhny your demo is very great. I wonder if you could register a demo with the most nice support that lemminx-maven provides to show the to vscode-maven team? |
@angelozerr Good idea, but I feel it's too early to be presented: Code Actions and prepareRename/rename refactorings do not work at all. |
Well. After fixing few issues (#438), the Code Actions are actually generated and responded through the LSP to VSCode, but not shown nor even indicated in the Editor. Any thoughts why? |
OK dont hesitate to ping @rgrunber and me when you think it will be ready
Is your code action is linked to à diagnostic or is it a code action for refactoring? If it is that I never implemented à code action which is not linked to à diagnostic |
What do you mean? The failure to request |
I mean that I dont know how vscode manages code actions withiut diagnostics. Perhaps the problem is that you dont set the proper code action kind on lemminx maven? Lemminx provide rename support. For instance if you try to rename xml tag it should be possible |
Anytime the cursor position changes in a document, a properly configured language server should send the It seems vscode-xml sends by default (default values from vscode-languageclient) :
Update: So I found this part of the code : https://github.com/eclipse/lemminx-maven/blob/7e603455e8c3b9bbbe89adb02e105a3654ebdaf0/lemminx-maven/src/main/java/org/eclipse/lemminx/extensions/maven/participants/codeaction/ExtractPropertyCodeAction.java#L399-L402 Are those the code actions we're talking about ? I noticed you do pass |
@vrubezhny have you tried to change the code action king with Refactor for instance in https://github.com/eclipse/lemminx-maven/blob/7e603455e8c3b9bbbe89adb02e105a3654ebdaf0/lemminx-maven/src/main/java/org/eclipse/lemminx/extensions/maven/participants/codeaction/ExtractPropertyCodeAction.java#L401 |
@rgrunber @angelozerr Thanks for the points to be checked.
Normally the Code Actions in Lemminx-Maven are created with |
BTW, In VSCode Rename Maven Property works if invoked from context menu Probably it should be enabled if the cursor is placed not only to maven property declaration element,but also to a property value use ( |
A set of lemminx-maven jar and the required dependency jars can be exported to `./lemminx-maven/target/vscode-lemminx-maven-jars/` directory by executing the following build command: ```bash $ ./mvnw verify -DskipTests -Pgenerate-vscode-jars ``` To demonstrate LemMinX-Maven functionality: 1. Copy the resulting `vscode-lemminx-maven-jars/` to `vscode-xml` extension project root directory 2. Modify `vscode-xml/package.json` adding the following configuration to the `contributes` section: ```json "xml.javaExtensions": [ "./vscode-lemminx-maven-jars/*.jar" ], ``` 6. Restart vscode-xml extension and try editing a Maven project file (Maven project validation, content assist for group ID, artifact ID and versions, hovers for artifacts and Maven properties, Maven properties refactoring etc.) Issue: eclipse-lemminx#430
876f391
to
953d2fc
Compare
@mickaelistria @angelozerr Changed the PR so now one can use $ ./mvnw verify -DskipTests -Pgenerate-vscode-jars To run "xml.javaExtensions": [
"./vscode-lemminx-maven-jars/*.jar"
], and then restart the The |
A set of lemminx-maven jar and the required dependency jars can be exported to `./lemminx-maven/target/vscode-lemminx-maven-jars/` directory by executing the following build command: ```bash $ ./mvnw verify -DskipTests -Pgenerate-vscode-jars ``` To demonstrate LemMinX-Maven functionality: 1. Copy the resulting `vscode-lemminx-maven-jars/` to `vscode-xml` extension project root directory 2. Modify `vscode-xml/package.json` adding the following configuration to the `contributes` section: ```json "xml.javaExtensions": [ "./vscode-lemminx-maven-jars/*.jar" ], ``` 6. Restart vscode-xml extension and try editing a Maven project file (Maven project validation, content assist for group ID, artifact ID and versions, hovers for artifacts and Maven properties, Maven properties refactoring etc.) Issue: eclipse-lemminx#430
953d2fc
to
8bc598f
Compare
Hi, thanks for this. Just 2 problems:
Hopefully both projects will move on and using lemminx-maven will be just a question of a simple user-based installation / setting soon. Also hoping for lemminx-maven being already in somewhat stable phase by now (not having a good experience with it in Eclipse some year ago)... |
If I remember I think the vscode-lemminx-maven-jars directory contains lemminx JAR, if it is that you shoud remove it |
LemMinX did a 0.27.0 (August 2023) to include the new progress support API. vscode-xml never did a corresponding release, https://github.com/redhat-developer/vscode-xml/releases/tag/0.26.1 . So vscode-xml 0.26.1 does not contain that API, hence the issue. See #473 . We basically need to release a vscode-xml 0.27.0 so those contributing via. vscode-xml can take advantage. |
Also, |
@rgrunber, thanks for the clarifications. 👍 Regarding |
Yeah,
However, the "nicer" solution would be for someone to create a vscode extension that simply sets up all the lemminx-maven jars, because having to set a path, with a glob, in some target folder after performing a build isn't too user friendly. That extension could use |
A set of lemminx-maven jar and the required dependency jars can be exported to
./lemminx-maven/target/vscode-lemminx-maven-jars/
directory by executing the followingbuild command:
To demonstrate LemMinX-Maven functionality:
Copy the resulting
vscode-lemminx-maven-jars/
tovscode-xml
extension project root directoryModify
vscode-xml/package.json
adding the following configuration to thecontributes
section:Restart vscode-xml extension and try editing a Maven project file (Maven project validation, content assist
for group ID, artifact ID and versions, hovers for artifacts and Maven properties, Maven properties refactoring etc.)
Issue: #430