Skip to content
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

Merged
merged 1 commit into from
Jul 17, 2023

Conversation

vrubezhny
Copy link
Contributor

@vrubezhny vrubezhny commented Jul 5, 2023

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:

$ ./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:

      "xml.javaExtensions": [
         "./vscode-lemminx-maven-jars/*.jar"
       ],
  3. 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

@vrubezhny vrubezhny marked this pull request as draft July 5, 2023 23:30
@vrubezhny vrubezhny linked an issue Jul 5, 2023 that may be closed by this pull request
@mickaelistria
Copy link
Contributor

Do I get it right this "uber-jar" is only for VSCode? If so, let's call it vscode-uber-jar to clarify it.

@vrubezhny
Copy link
Contributor Author

Do I get it right this "uber-jar" is only for VSCode? If so, let's call it vscode-uber-jar to clarify it.

In theory, one can use it together with lemminx LS not only in vscode, but currently I don't know such cases.
Renamed to lemminx-maven-*-vscode-uber.jar so, currently in ~/.m2/repository I have lemminx-maven-0.9.1-SNAPSHOT-vscode-uber.jar installed.

@vrubezhny vrubezhny force-pushed the fixAddUberDistribution branch 2 times, most recently from d5170a2 to 1317ff5 Compare July 7, 2023 15:43
@angelozerr
Copy link

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

@vrubezhny
Copy link
Contributor Author

vrubezhny commented Jul 10, 2023

I'm trying to add the required dependencies to the uber jar, but unfortunately it doesn't work yet.
Some of the dependencies have not been added correctly, so currently, when I try running vscode-xml with the uber jar I have the following errors logged:

[Error - 4:27:18 PM] Jul 08, 2023 04:27:18 org.eclipse.lemminx.extensions.maven.MavenLemminxExtension initialize()
Message: com.google.inject.ProvisionException: Unable to provision, see the following errors:

1) No implementation for aether.RepositorySystem was bound.
  while locating DefaultArtifactResolver
  at ClassRealm[MavenLemminxExtension, parent: null]
      \_ installed by: WireModule -> PlexusBindingModule
  while locating ArtifactResolver
  while locating LegacyRepositorySystem
  at ClassRealm[MavenLemminxExtension, parent: null]
      \_ installed by: WireModule -> PlexusBindingModule
  while locating repository.RepositorySystem

1 error

======================
Full classname legend:
======================
ArtifactResolver:            "org.apache.maven.artifact.resolver.ArtifactResolver"
DefaultArtifactResolver:     "org.apache.maven.artifact.resolver.DefaultArtifactResolver"
LegacyRepositorySystem:      "org.apache.maven.repository.legacy.LegacyRepositorySystem"
MavenLemminxExtension:       "org.eclipse.lemminx.extensions.maven.MavenLemminxExtension"
PlexusBindingModule:         "org.eclipse.sisu.plexus.PlexusBindingModule"
WireModule:                  "org.eclipse.sisu.wire.WireModule"
aether.RepositorySystem:     "org.eclipse.aether.RepositorySystem"
repository.RepositorySystem: "org.apache.maven.repository.RepositorySystem"
========================
End of classname legend:
========================

      role: org.apache.maven.repository.RepositorySystem
  roleHint: 
org.codehaus.plexus.component.repository.exception.ComponentLookupException: com.google.inject.ProvisionException: Unable to provision, see the following errors:

1) No implementation for aether.RepositorySystem was bound.
  while locating DefaultArtifactResolver
  at ClassRealm[MavenLemminxExtension, parent: null]
      \_ installed by: WireModule -> PlexusBindingModule
  while locating ArtifactResolver
  while locating LegacyRepositorySystem
  at ClassRealm[MavenLemminxExtension, parent: null]
      \_ installed by: WireModule -> PlexusBindingModule
  while locating repository.RepositorySystem

1 error

======================
Full classname legend:
======================
ArtifactResolver:            "org.apache.maven.artifact.resolver.ArtifactResolver"
DefaultArtifactResolver:     "org.apache.maven.artifact.resolver.DefaultArtifactResolver"
LegacyRepositorySystem:      "org.apache.maven.repository.legacy.LegacyRepositorySystem"
MavenLemminxExtension:       "org.eclipse.lemminx.extensions.maven.MavenLemminxExtension"
PlexusBindingModule:         "org.eclipse.sisu.plexus.PlexusBindingModule"
WireModule:                  "org.eclipse.sisu.wire.WireModule"
aether.RepositorySystem:     "org.eclipse.aether.RepositorySystem"
repository.RepositorySystem: "org.apache.maven.repository.RepositorySystem"
========================
End of classname legend:
========================

      role: org.apache.maven.repository.RepositorySystem
  roleHint: 
	at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:267)
	at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:255)
	at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:249)
	at org.eclipse.lemminx.extensions.maven.MavenLemminxExtension.initMavenRequest(MavenLemminxExtension.java:264)
	at org.eclipse.lemminx.extensions.maven.MavenLemminxExtension.initialize(MavenLemminxExtension.java:200)
	at org.eclipse.lemminx.extensions.maven.MavenLemminxExtension.getProjectCache(MavenLemminxExtension.java:411)
	at org.eclipse.lemminx.extensions.maven.participants.diagnostics.MavenDiagnosticParticipant.doDiagnostics(MavenDiagnosticParticipant.java:56)
	at org.eclipse.lemminx.services.XMLDiagnostics.doExtensionsDiagnostics(XMLDiagnostics.java:67)
	at org.eclipse.lemminx.services.XMLDiagnostics.doDiagnostics(XMLDiagnostics.java:49)
	at org.eclipse.lemminx.services.XMLLanguageService.doDiagnostics(XMLLanguageService.java:190)
	at org.eclipse.lemminx.services.XMLLanguageService.publishDiagnostics(XMLLanguageService.java:204)
	at org.eclipse.lemminx.XMLTextDocumentService.validate(XMLTextDocumentService.java:716)
	at org.eclipse.lemminx.XMLTextDocumentService.lambda$validate$35(XMLTextDocumentService.java:691)
	at java.base/java.util.concurrent.CompletableFuture$AsyncRun.run(CompletableFuture.java:1804)
	at java.base/java.util.concurrent.CompletableFuture$AsyncRun.exec(CompletableFuture.java:1796)
	at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:373)
	at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1182)
	at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1655)
	at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1622)
	at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:165)
Caused by: com.google.inject.ProvisionException: Unable to provision, see the following errors:

1) No implementation for aether.RepositorySystem was bound.
  while locating DefaultArtifactResolver
  at ClassRealm[MavenLemminxExtension, parent: null]
      \_ installed by: WireModule -> PlexusBindingModule
  while locating ArtifactResolver
  while locating LegacyRepositorySystem
  at ClassRealm[MavenLemminxExtension, parent: null]
      \_ installed by: WireModule -> PlexusBindingModule
  while locating repository.RepositorySystem

1 error

======================
Full classname legend:
======================
ArtifactResolver:            "org.apache.maven.artifact.resolver.ArtifactResolver"
DefaultArtifactResolver:     "org.apache.maven.artifact.resolver.DefaultArtifactResolver"
LegacyRepositorySystem:      "org.apache.maven.repository.legacy.LegacyRepositorySystem"
MavenLemminxExtension:       "org.eclipse.lemminx.extensions.maven.MavenLemminxExtension"
PlexusBindingModule:         "org.eclipse.sisu.plexus.PlexusBindingModule"
WireModule:                  "org.eclipse.sisu.wire.WireModule"
aether.RepositorySystem:     "org.eclipse.aether.RepositorySystem"
repository.RepositorySystem: "org.apache.maven.repository.RepositorySystem"
========================
End of classname legend:
========================

	at com.google.inject.internal.InternalProvisionException.toProvisionException(InternalProvisionException.java:251)
	at com.google.inject.internal.InjectorImpl$1.get(InjectorImpl.java:1104)
	at org.eclipse.sisu.inject.LazyBeanEntry.getValue(LazyBeanEntry.java:81)
	at org.eclipse.sisu.plexus.LazyPlexusBean.getValue(LazyPlexusBean.java:51)
	at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:263)
	... 19 more

[Error - 4:27:18 PM] Jul 08, 2023 04:27:18 org.eclipse.lemminx.services.XMLDiagnostics doExtensionsDiagnostics()
Message: Error while processing diagnostics for the participant 'org.eclipse.lemminx.extensions.maven.participants.diagnostics.MavenDiagnosticParticipant'.
java.lang.NullPointerException: Cannot invoke "org.eclipse.lemminx.extensions.maven.MavenProjectCache.getProblemsFor(org.eclipse.lemminx.dom.DOMDocument)" because the return value of "org.eclipse.lemminx.extensions.maven.MavenLemminxExtension.getProjectCache()" is null
	at org.eclipse.lemminx.extensions.maven.participants.diagnostics.MavenDiagnosticParticipant.doDiagnostics(MavenDiagnosticParticipant.java:56)
	at org.eclipse.lemminx.services.XMLDiagnostics.doExtensionsDiagnostics(XMLDiagnostics.java:67)
	at org.eclipse.lemminx.services.XMLDiagnostics.doDiagnostics(XMLDiagnostics.java:49)
	at org.eclipse.lemminx.services.XMLLanguageService.doDiagnostics(XMLLanguageService.java:190)
	at org.eclipse.lemminx.services.XMLLanguageService.publishDiagnostics(XMLLanguageService.java:204)
	at org.eclipse.lemminx.XMLTextDocumentService.validate(XMLTextDocumentService.java:716)
	at org.eclipse.lemminx.XMLTextDocumentService.lambda$validate$35(XMLTextDocumentService.java:691)
	at java.base/java.util.concurrent.CompletableFuture$AsyncRun.run(CompletableFuture.java:1804)
	at java.base/java.util.concurrent.CompletableFuture$AsyncRun.exec(CompletableFuture.java:1796)
	at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:373)
	at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1182)
	at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1655)
	at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1622)
	at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:165)

Also, I have a feeling like the jar is not properly created because it's messed somehow with zip-with-dependencies.zip on creation (as they both are currently created with the same maven-assembly-plugin plugin configuration - which looks to be wrong) and the following errors are duplicated in build log during the creation of both jars:

[WARNING] The following patterns were never triggered in this artifact inclusion filter:
o  'com.google.code.findbugs:jsr305'
o  'com.google.guava:guava'
o  'org.apache.commons:commons-lang3'
o  'org.apiguardian:apiguardian-api'
o  'org.jsoup:jsoup'
o  'org.junit.jupiter:junit-jupiter'
o  'org.junit.jupiter:junit-jupiter-api'
o  'org.junit.jupiter:junit-jupiter-engine'
o  'org.junit.jupiter:junit-jupiter-params'
o  'org.junit.platform:junit-platform-commons'
o  'org.junit.platform:junit-platform-engine'
o  'org.opentest4j:opentest4j'

@vrubezhny
Copy link
Contributor Author

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

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

@angelozerr
Copy link

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

Great! Thanks so much @vrubezhny to work on this issue! It will help to promote using lemminx-maven in vscode.

@vrubezhny
Copy link
Contributor Author

vrubezhny commented Jul 10, 2023

@mickaelistria It looks like because we exclude transitive dependencies from being added to the lemminx-maven.jar (for example org.eclipse.aether:aether-* ) the maven-assembly-plugin cannot find and include the following dependencies to the uber jar despite the fact that they are included to src/assembly/uber.xml's dependencySet:

[WARNING] The following patterns were never triggered in this artifact inclusion filter:
o  'com.google.guava:guava'
o  'org.eclipse.aether:aether-api'
o  'org.eclipse.aether:aether-impl'
o  'org.eclipse.aether:aether-spi'
o  'org.eclipse.aether:aether-util'
o  'org.apache.commons:commons-lang3'
o  'org.apiguardian:apiguardian-api'
o  'org.jsoup:jsoup'

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 org.eclipse.aether:aether-* to be added to the lemminx-maven-vscode-uber.jar

@mickaelistria
Copy link
Contributor

It looks like because we exclude transitive dependencies from being added to the lemminx-maven.jar

The lemminx-maven jar only contains lemminx-maven, no deps. I don't think anyone actually uses the other existing assembly,
So I would recommend you try just removing the assembly and exclusion and see what happens.

@vrubezhny
Copy link
Contributor Author

So, I've spitted the assembly configurations so, now they are built independently from each other.
All the required dependencies are included to lemminx-maven-vscode-uber.jar , but still, when trying to start the extension with vscode-xml, it fails to initialize in initMavenRequest(PlexusContainer container, XMLMavenSettings options), specifically on trying to lookup for a RepositorySystem instance:

RepositorySystem repositorySystem = container.lookup(RepositorySystem.class);

When running n Eclipse, this normally returns an object of org.apache.maven.repository.legacy.LegacyRepositorySystem type - which, for sure, is available in resulting lemminx-maven-vscode-uber.jar used in vscode-xml extension but its instance cannot be found/instantiated for some reason:

[Info  - 2:18:40 PM] Jul 12, 2023 02:18:40 org.eclipse.lemminx.XMLLanguageServer initialize()
Message: Initializing XML Language server
LemMinX Server info:
 - Version : 0.26.1-SNAPSHOT
 - Java : /opt/graalvm-jdk-17.0.7+8.1
 - VM Version : 17.0.7
 - Git [Branch changelog-for-0.26.1] d7ffe20 - Changelog for 0.26.1
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
[Error - 2:18:41 PM] Jul 12, 2023 02:18:41 org.eclipse.lemminx.extensions.maven.MavenLemminxExtension initialize()
Message: com.google.inject.ProvisionException: Unable to provision, see the following errors:

1) No implementation for aether.RepositorySystem was bound.
  while locating DefaultArtifactResolver
  at ClassRealm[MavenLemminxExtension, parent: null]
      \_ installed by: WireModule -> PlexusBindingModule
  while locating ArtifactResolver
  while locating LegacyRepositorySystem
  at ClassRealm[MavenLemminxExtension, parent: null]
      \_ installed by: WireModule -> PlexusBindingModule
  while locating repository.RepositorySystem

1 error

======================
Full classname legend:
======================
ArtifactResolver:            "org.apache.maven.artifact.resolver.ArtifactResolver"
DefaultArtifactResolver:     "org.apache.maven.artifact.resolver.DefaultArtifactResolver"
LegacyRepositorySystem:      "org.apache.maven.repository.legacy.LegacyRepositorySystem"
MavenLemminxExtension:       "org.eclipse.lemminx.extensions.maven.MavenLemminxExtension"
PlexusBindingModule:         "org.eclipse.sisu.plexus.PlexusBindingModule"
WireModule:                  "org.eclipse.sisu.wire.WireModule"
aether.RepositorySystem:     "org.eclipse.aether.RepositorySystem"
repository.RepositorySystem: "org.apache.maven.repository.RepositorySystem"
========================
End of classname legend:
========================

      role: org.apache.maven.repository.RepositorySystem
  roleHint: 
org.codehaus.plexus.component.repository.exception.ComponentLookupException: com.google.inject.ProvisionException: Unable to provision, see the following errors:

1) No implementation for aether.RepositorySystem was bound.
  while locating DefaultArtifactResolver
  at ClassRealm[MavenLemminxExtension, parent: null]
      \_ installed by: WireModule -> PlexusBindingModule
  while locating ArtifactResolver
  while locating LegacyRepositorySystem
  at ClassRealm[MavenLemminxExtension, parent: null]
      \_ installed by: WireModule -> PlexusBindingModule
  while locating repository.RepositorySystem

1 error

======================
Full classname legend:
======================
ArtifactResolver:            "org.apache.maven.artifact.resolver.ArtifactResolver"
DefaultArtifactResolver:     "org.apache.maven.artifact.resolver.DefaultArtifactResolver"
LegacyRepositorySystem:      "org.apache.maven.repository.legacy.LegacyRepositorySystem"
MavenLemminxExtension:       "org.eclipse.lemminx.extensions.maven.MavenLemminxExtension"
PlexusBindingModule:         "org.eclipse.sisu.plexus.PlexusBindingModule"
WireModule:                  "org.eclipse.sisu.wire.WireModule"
aether.RepositorySystem:     "org.eclipse.aether.RepositorySystem"
repository.RepositorySystem: "org.apache.maven.repository.RepositorySystem"
========================
End of classname legend:
========================

      role: org.apache.maven.repository.RepositorySystem
  roleHint: 
	at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:267)
	at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:255)
	at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:249)
	at org.eclipse.lemminx.extensions.maven.MavenLemminxExtension.initMavenRequest(MavenLemminxExtension.java:264)
	at org.eclipse.lemminx.extensions.maven.MavenLemminxExtension.initialize(MavenLemminxExtension.java:200)
	at org.eclipse.lemminx.extensions.maven.MavenLemminxExtension.getProjectCache(MavenLemminxExtension.java:411)
	at org.eclipse.lemminx.extensions.maven.participants.codeaction.ExtractPropertyCodeAction.doCodeActionUnconditional(ExtractPropertyCodeAction.java:120)
	at org.eclipse.lemminx.services.XMLCodeActions.doCodeActions(XMLCodeActions.java:81)
	at org.eclipse.lemminx.services.XMLLanguageService.doCodeActions(XMLLanguageService.java:284)
	at org.eclipse.lemminx.XMLTextDocumentService.lambda$codeAction$24(XMLTextDocumentService.java:502)
	at org.eclipse.lemminx.commons.ModelTextDocuments.lambda$computeModelAsync$0(ModelTextDocuments.java:118)
	at java.base/java.util.concurrent.CompletableFuture$UniApply.tryFire(CompletableFuture.java:646)
	at java.base/java.util.concurrent.CompletableFuture$Completion.exec(CompletableFuture.java:483)
	at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:373)
	at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1182)
	at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1655)
	at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1622)
	at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:165)
Caused by: com.google.inject.ProvisionException: Unable to provision, see the following errors:

1) No implementation for aether.RepositorySystem was bound.
  while locating DefaultArtifactResolver
  at ClassRealm[MavenLemminxExtension, parent: null]
      \_ installed by: WireModule -> PlexusBindingModule
  while locating ArtifactResolver
  while locating LegacyRepositorySystem
  at ClassRealm[MavenLemminxExtension, parent: null]
      \_ installed by: WireModule -> PlexusBindingModule
  while locating repository.RepositorySystem

1 error

======================
Full classname legend:
======================
ArtifactResolver:            "org.apache.maven.artifact.resolver.ArtifactResolver"
DefaultArtifactResolver:     "org.apache.maven.artifact.resolver.DefaultArtifactResolver"
LegacyRepositorySystem:      "org.apache.maven.repository.legacy.LegacyRepositorySystem"
MavenLemminxExtension:       "org.eclipse.lemminx.extensions.maven.MavenLemminxExtension"
PlexusBindingModule:         "org.eclipse.sisu.plexus.PlexusBindingModule"
WireModule:                  "org.eclipse.sisu.wire.WireModule"
aether.RepositorySystem:     "org.eclipse.aether.RepositorySystem"
repository.RepositorySystem: "org.apache.maven.repository.RepositorySystem"
========================
End of classname legend:
========================

	at com.google.inject.internal.InternalProvisionException.toProvisionException(InternalProvisionException.java:251)
	at com.google.inject.internal.InjectorImpl$1.get(InjectorImpl.java:1104)
	at org.eclipse.sisu.inject.LazyBeanEntry.getValue(LazyBeanEntry.java:81)
	at org.eclipse.sisu.plexus.LazyPlexusBean.getValue(LazyPlexusBean.java:51)
	at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:263)
	... 17 more

[Error - 2:18:41 PM] Jul 12, 2023 02:18:41 org.eclipse.lemminx.extensions.maven.participants.codeaction.ExtractPropertyCodeAction doCodeActionUnconditional()
Message: Cannot invoke "org.eclipse.lemminx.extensions.maven.MavenProjectCache.getLastSuccessfulMavenProject(org.eclipse.lemminx.dom.DOMDocument)" because the return value of "org.eclipse.lemminx.extensions.maven.MavenLemminxExtension.getProjectCache()" is null
java.lang.NullPointerException: Cannot invoke "org.eclipse.lemminx.extensions.maven.MavenProjectCache.getLastSuccessfulMavenProject(org.eclipse.lemminx.dom.DOMDocument)" because the return value of "org.eclipse.lemminx.extensions.maven.MavenLemminxExtension.getProjectCache()" is null
	at org.eclipse.lemminx.extensions.maven.participants.codeaction.ExtractPropertyCodeAction.doCodeActionUnconditional(ExtractPropertyCodeAction.java:120)
	at org.eclipse.lemminx.services.XMLCodeActions.doCodeActions(XMLCodeActions.java:81)
	at org.eclipse.lemminx.services.XMLLanguageService.doCodeActions(XMLLanguageService.java:284)
	at org.eclipse.lemminx.XMLTextDocumentService.lambda$codeAction$24(XMLTextDocumentService.java:502)
	at org.eclipse.lemminx.commons.ModelTextDocuments.lambda$computeModelAsync$0(ModelTextDocuments.java:118)
	at java.base/java.util.concurrent.CompletableFuture$UniApply.tryFire(CompletableFuture.java:646)
	at java.base/java.util.concurrent.CompletableFuture$Completion.exec(CompletableFuture.java:483)
	at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:373)
	at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1182)
	at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1655)
	at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1622)
	at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:165)

[Error - 2:18:41 PM] Jul 12, 2023 02:18:41 org.eclipse.lsp4j.jsonrpc.RemoteEndpoint fallbackResponseError()
Message: Internal error: java.util.ConcurrentModificationException
java.util.concurrent.CompletionException: java.util.ConcurrentModificationException
	at java.base/java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:315)
	at java.base/java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:320)
	at java.base/java.util.concurrent.CompletableFuture$UniApply.tryFire(CompletableFuture.java:649)
	at java.base/java.util.concurrent.CompletableFuture$Completion.exec(CompletableFuture.java:483)
	at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:373)
	at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1182)
	at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1655)
	at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1622)
	at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:165)
Caused by: java.util.ConcurrentModificationException
	at java.base/java.util.ArrayList$Itr.checkForComodification(ArrayList.java:1013)
	at java.base/java.util.ArrayList$Itr.next(ArrayList.java:967)
	at org.eclipse.lemminx.services.XMLCodeActions.doCodeActions(XMLCodeActions.java:76)
	at org.eclipse.lemminx.services.XMLLanguageService.doCodeActions(XMLLanguageService.java:284)
	at org.eclipse.lemminx.XMLTextDocumentService.lambda$codeAction$24(XMLTextDocumentService.java:502)
	at org.eclipse.lemminx.commons.ModelTextDocuments.lambda$computeModelAsync$0(ModelTextDocuments.java:118)
	at java.base/java.util.concurrent.CompletableFuture$UniApply.tryFire(CompletableFuture.java:646)
	... 6 more

[Error - 2:18:41 PM] Request textDocument/codeAction failed.
  Message: Internal error.
  Code: -32603 
java.util.concurrent.CompletionException: java.util.ConcurrentModificationException
	at java.base/java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:315)
	at java.base/java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:320)
	at java.base/java.util.concurrent.CompletableFuture$UniApply.tryFire(CompletableFuture.java:649)
	at java.base/java.util.concurrent.CompletableFuture$Completion.exec(CompletableFuture.java:483)
	at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:373)
	at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1182)
	at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1655)
	at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1622)
	at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:165)
Caused by: java.util.ConcurrentModificationException
	at java.base/java.util.ArrayList$Itr.checkForComodification(ArrayList.java:1013)
	at java.base/java.util.ArrayList$Itr.next(ArrayList.java:967)
	at org.eclipse.lemminx.services.XMLCodeActions.doCodeActions(XMLCodeActions.java:76)
	at org.eclipse.lemminx.services.XMLLanguageService.doCodeActions(XMLLanguageService.java:284)
	at org.eclipse.lemminx.XMLTextDocumentService.lambda$codeAction$24(XMLTextDocumentService.java:502)
	at org.eclipse.lemminx.commons.ModelTextDocuments.lambda$computeModelAsync$0(ModelTextDocuments.java:118)
	at java.base/java.util.concurrent.CompletableFuture$UniApply.tryFire(CompletableFuture.java:646)
	... 6 more

[Error - 2:18:41 PM] Jul 12, 2023 02:18:41 org.eclipse.lemminx.extensions.maven.MavenLemminxExtension initialize()
Message: com.google.inject.ProvisionException: Unable to provision, see the following errors:

1) No implementation for aether.RepositorySystem was bound.
  while locating DefaultArtifactResolver
  at ClassRealm[MavenLemminxExtension, parent: null]
      \_ installed by: WireModule -> PlexusBindingModule
  while locating ArtifactResolver
  while locating LegacyRepositorySystem
  at ClassRealm[MavenLemminxExtension, parent: null]
      \_ installed by: WireModule -> PlexusBindingModule
  while locating repository.RepositorySystem

1 error

======================
Full classname legend:
======================
ArtifactResolver:            "org.apache.maven.artifact.resolver.ArtifactResolver"
DefaultArtifactResolver:     "org.apache.maven.artifact.resolver.DefaultArtifactResolver"
LegacyRepositorySystem:      "org.apache.maven.repository.legacy.LegacyRepositorySystem"
MavenLemminxExtension:       "org.eclipse.lemminx.extensions.maven.MavenLemminxExtension"
PlexusBindingModule:         "org.eclipse.sisu.plexus.PlexusBindingModule"
WireModule:                  "org.eclipse.sisu.wire.WireModule"
aether.RepositorySystem:     "org.eclipse.aether.RepositorySystem"
repository.RepositorySystem: "org.apache.maven.repository.RepositorySystem"
========================
End of classname legend:
========================

      role: org.apache.maven.repository.RepositorySystem
  roleHint: 
org.codehaus.plexus.component.repository.exception.ComponentLookupException: com.google.inject.ProvisionException: Unable to provision, see the following errors:

1) No implementation for aether.RepositorySystem was bound.
  while locating DefaultArtifactResolver
  at ClassRealm[MavenLemminxExtension, parent: null]
      \_ installed by: WireModule -> PlexusBindingModule
  while locating ArtifactResolver
  while locating LegacyRepositorySystem
  at ClassRealm[MavenLemminxExtension, parent: null]
      \_ installed by: WireModule -> PlexusBindingModule
  while locating repository.RepositorySystem

1 error

======================
Full classname legend:
======================
ArtifactResolver:            "org.apache.maven.artifact.resolver.ArtifactResolver"
DefaultArtifactResolver:     "org.apache.maven.artifact.resolver.DefaultArtifactResolver"
LegacyRepositorySystem:      "org.apache.maven.repository.legacy.LegacyRepositorySystem"
MavenLemminxExtension:       "org.eclipse.lemminx.extensions.maven.MavenLemminxExtension"
PlexusBindingModule:         "org.eclipse.sisu.plexus.PlexusBindingModule"
WireModule:                  "org.eclipse.sisu.wire.WireModule"
aether.RepositorySystem:     "org.eclipse.aether.RepositorySystem"
repository.RepositorySystem: "org.apache.maven.repository.RepositorySystem"
========================
End of classname legend:
========================

      role: org.apache.maven.repository.RepositorySystem
  roleHint: 
	at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:267)
	at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:255)
	at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:249)
	at org.eclipse.lemminx.extensions.maven.MavenLemminxExtension.initMavenRequest(MavenLemminxExtension.java:264)
	at org.eclipse.lemminx.extensions.maven.MavenLemminxExtension.initialize(MavenLemminxExtension.java:200)
	at org.eclipse.lemminx.extensions.maven.MavenLemminxExtension.getProjectCache(MavenLemminxExtension.java:411)
	at org.eclipse.lemminx.extensions.maven.participants.diagnostics.MavenDiagnosticParticipant.doDiagnostics(MavenDiagnosticParticipant.java:56)
	at org.eclipse.lemminx.services.XMLDiagnostics.doExtensionsDiagnostics(XMLDiagnostics.java:67)
	at org.eclipse.lemminx.services.XMLDiagnostics.doDiagnostics(XMLDiagnostics.java:49)
	at org.eclipse.lemminx.services.XMLLanguageService.doDiagnostics(XMLLanguageService.java:190)
	at org.eclipse.lemminx.services.XMLLanguageService.publishDiagnostics(XMLLanguageService.java:204)
	at org.eclipse.lemminx.XMLTextDocumentService.validate(XMLTextDocumentService.java:716)
	at org.eclipse.lemminx.XMLTextDocumentService.lambda$validate$35(XMLTextDocumentService.java:691)
	at java.base/java.util.concurrent.CompletableFuture$AsyncRun.run(CompletableFuture.java:1804)
	at java.base/java.util.concurrent.CompletableFuture$AsyncRun.exec(CompletableFuture.java:1796)
	at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:373)
	at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1182)
	at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1655)
	at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1622)
	at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:165)
Caused by: com.google.inject.ProvisionException: Unable to provision, see the following errors:

1) No implementation for aether.RepositorySystem was bound.
  while locating DefaultArtifactResolver
  at ClassRealm[MavenLemminxExtension, parent: null]
      \_ installed by: WireModule -> PlexusBindingModule
  while locating ArtifactResolver
  while locating LegacyRepositorySystem
  at ClassRealm[MavenLemminxExtension, parent: null]
      \_ installed by: WireModule -> PlexusBindingModule
  while locating repository.RepositorySystem

1 error

======================
Full classname legend:
======================
ArtifactResolver:            "org.apache.maven.artifact.resolver.ArtifactResolver"
DefaultArtifactResolver:     "org.apache.maven.artifact.resolver.DefaultArtifactResolver"
LegacyRepositorySystem:      "org.apache.maven.repository.legacy.LegacyRepositorySystem"
MavenLemminxExtension:       "org.eclipse.lemminx.extensions.maven.MavenLemminxExtension"
PlexusBindingModule:         "org.eclipse.sisu.plexus.PlexusBindingModule"
WireModule:                  "org.eclipse.sisu.wire.WireModule"
aether.RepositorySystem:     "org.eclipse.aether.RepositorySystem"
repository.RepositorySystem: "org.apache.maven.repository.RepositorySystem"
========================
End of classname legend:
========================

	at com.google.inject.internal.InternalProvisionException.toProvisionException(InternalProvisionException.java:251)
	at com.google.inject.internal.InjectorImpl$1.get(InjectorImpl.java:1104)
	at org.eclipse.sisu.inject.LazyBeanEntry.getValue(LazyBeanEntry.java:81)
	at org.eclipse.sisu.plexus.LazyPlexusBean.getValue(LazyPlexusBean.java:51)
	at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:263)
	... 19 more

[Error - 2:18:41 PM] Jul 12, 2023 02:18:41 org.eclipse.lemminx.services.XMLDiagnostics doExtensionsDiagnostics()
Message: Error while processing diagnostics for the participant 'org.eclipse.lemminx.extensions.maven.participants.diagnostics.MavenDiagnosticParticipant'.
java.lang.NullPointerException: Cannot invoke "org.eclipse.lemminx.services.extensions.XMLExtensionsRegistry.unregisterRenameParticipant(org.eclipse.lemminx.services.extensions.rename.IRenameParticipant)" because "registry" is null
	at org.eclipse.lemminx.extensions.maven.MavenLemminxExtension.stop(MavenLemminxExtension.java:370)
	at org.eclipse.lemminx.extensions.maven.MavenLemminxExtension.initialize(MavenLemminxExtension.java:217)
	at org.eclipse.lemminx.extensions.maven.MavenLemminxExtension.getProjectCache(MavenLemminxExtension.java:411)
	at org.eclipse.lemminx.extensions.maven.participants.diagnostics.MavenDiagnosticParticipant.doDiagnostics(MavenDiagnosticParticipant.java:56)
	at org.eclipse.lemminx.services.XMLDiagnostics.doExtensionsDiagnostics(XMLDiagnostics.java:67)
	at org.eclipse.lemminx.services.XMLDiagnostics.doDiagnostics(XMLDiagnostics.java:49)
	at org.eclipse.lemminx.services.XMLLanguageService.doDiagnostics(XMLLanguageService.java:190)
	at org.eclipse.lemminx.services.XMLLanguageService.publishDiagnostics(XMLLanguageService.java:204)
	at org.eclipse.lemminx.XMLTextDocumentService.validate(XMLTextDocumentService.java:716)
	at org.eclipse.lemminx.XMLTextDocumentService.lambda$validate$35(XMLTextDocumentService.java:691)
	at java.base/java.util.concurrent.CompletableFuture$AsyncRun.run(CompletableFuture.java:1804)
	at java.base/java.util.concurrent.CompletableFuture$AsyncRun.exec(CompletableFuture.java:1796)
	at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:373)
	at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1182)
	at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1655)
	at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1622)
	at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:165)

@mickaelistria
Copy link
Contributor

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.

@vrubezhny
Copy link
Contributor Author

vrubezhny commented Jul 12, 2023

Using the separated jars (all the lemminx-maven dependency jars + lemminx-maven jar) and pointing to them in vscode-xml/package.json as:

 "contributes": {
   "xml.javaExtensions": [
     "./jars/l*.jar"
   ],
Screencast_07_12_2023_03.30.15_PM.webm

@angelozerr
Copy link

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

@vrubezhny
Copy link
Contributor Author

@angelozerr Good idea, but I feel it's too early to be presented: Code Actions and prepareRename/rename refactorings do not work at all.
As far as I can see, the only content assist, hovers and definitions work more or less with no problems.
I suspect the LSP realizations may differ between Eclipse (LSP4E) and VSCode, but I'm not sure yet.
Code Action requests are sent, the responses are receinved, but they are empty
Prepare Rename/Rename requests are not even sent (at least I can't spot them in the log with "trace" : "verbose" configured)

@vrubezhny
Copy link
Contributor Author

vrubezhny commented Jul 13, 2023

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?

@angelozerr
Copy link

but I feel it's too early to be presented

OK dont hesitate to ping @rgrunber and me when you think it will be ready

Any thoughts why?

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

@vrubezhny
Copy link
Contributor Author

vrubezhny commented Jul 13, 2023

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?
Yes, Lemminx-Maven Code Actions aren't linked to any Diagnostic, but this is allowed with eclipse/lemminx#1517 which is used in latest vscode-xml 0.26.1 (currently uses lemminx 0.26.1), isn't it?
Or do you mean it's not implemented in VSCode itself? But it requests for Code Actions and successfully receives an array of Code Actions (according the LS logs) - while it looks like this response is just dropped by the editor (not shown a Quick Fix bulb, not the created Code Actions appear in Quick Fix... command)

The failure to request prepareRename/rename requests is unclear to me (probably there is a problem with the client capabilities) - I don't even see any requests from the client - the editor just tells that rename is impossible.

@angelozerr
Copy link

What do you mean?

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?
don't even see any requests from the client - the editor just tells that rename is impossible.

Lemminx provide rename support. For instance if you try to rename xml tag it should be possible

@rgrunber
Copy link
Contributor

rgrunber commented Jul 13, 2023

Anytime the cursor position changes in a document, a properly configured language server should send the textDocument/codeAction request. There's no need to have it be associated with an error. In fact this happens for vscode-xml. Clicking at a location with no errors sends a textDocument/codeAction and the server just responds with an empty list. If your code actions contributed via. lemminx-maven are still not showing, have a look at : https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#codeActionClientCapabilities .

It seems vscode-xml sends by default (default values from vscode-languageclient) :

"codeActionLiteralSupport": {
        "codeActionKind": {
            "valueSet": [
                "",
                "quickfix",
                "refactor",
                "refactor.extract",
                "refactor.inline",
                "refactor.rewrite",
                "source",
                "source.organizeImports"
            ]
        }
    }

Update: So I found this part of the code :

private static CodeAction createReplaceCodeActione(String title, List<TextDocumentEdit> replace, Diagnostic diagnostic) {
CodeAction insertContentAction = new CodeAction(title);
insertContentAction.setKind(CodeActionKind.QuickFix);
insertContentAction.setDiagnostics(Arrays.asList(diagnostic));

Are those the code actions we're talking about ? I noticed you do pass quickfix as the code action kind. However, you seem to pass null as the diagnostic. This would make Arrays.asList(diagnostic) be an array where the first entry is null. Maybe worth trying to just make it return an empty array ? Otherwise, I think you have to just compare the response of code actions that work and see if you can find what might cause the VS Code language client to ignore them.

@angelozerr
Copy link

angelozerr commented Jul 13, 2023

not shown a Quick Fix bulb, not the created Code Actions appear in Quick Fix... command

@vrubezhny have you tried to change the code action king with Refactor for instance in

@vrubezhny
Copy link
Contributor Author

@rgrunber @angelozerr Thanks for the points to be checked.

Arrays.asList(null) may probably really break the functionality as well as insertContentAction.setKind(CodeActionKind.QuickFix) (however, imho, this value is the correct one).

Normally the Code Actions in Lemminx-Maven are created with org.eclipse.lemminx.commons.CodeActionFactory.replace(String, Range, String, TextDocumentItem, Diagnostic) - so, if the Lemminx's ones works in VSCode, so the Lemminx-Maven Code Actions are to be functional.

@vrubezhny
Copy link
Contributor Author

vrubezhny commented Jul 14, 2023

BTW, In VSCode Rename Maven Property works if invoked from context menu Rename Symbol, bot from Refactor....

Probably it should be enabled if the cursor is placed not only to maven property declaration element,but also to a property value use (${value}) in order to allow renaming from any place in text with no need to search for the property declaration .

@vrubezhny
Copy link
Contributor Author

vrubezhny commented Jul 14, 2023

@rgrunber was right: having a list of null-diagnostic makes VSCode editor not to show the Quick Fix for a code action. Now it works (fixed with #439):

Screenshot from 2023-07-14 13-16-04

vrubezhny added a commit to vrubezhny/lemminx-maven that referenced this pull request Jul 17, 2023
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#430
@vrubezhny
Copy link
Contributor Author

vrubezhny commented Jul 17, 2023

@mickaelistria @angelozerr Changed the PR so now one can use -Pgenerate-vscode-jars profile to gather the lamminx-maven Jar and all its dependency Jars into ./lemminx-maven/target/vscode-lemminx-maven-jars/ directory:

$ ./mvnw verify -DskipTests -Pgenerate-vscode-jars

To run lemminx-maven in vscode-xml one can copy the resulting vscode-lemminx-maven-jars/ directory to vscode-xml extension project folder, modify vscode-xml/package.json adding the following configuration to the contributes section:

  "xml.javaExtensions": [
     "./vscode-lemminx-maven-jars/*.jar"
   ],

and then restart the vscode-xml.
Profit.

The LemMinX-Maven extension stays fully functional when running in VSCode XML.

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#430
@vrubezhny vrubezhny marked this pull request as ready for review July 17, 2023 12:49
@vrubezhny vrubezhny merged commit 1ebfbdf into eclipse:master Jul 17, 2023
5 checks passed
@pbodnar
Copy link

pbodnar commented Apr 18, 2024

Hi, thanks for this. Just 2 problems:

  • As the latest Red Hat's release of vscode-xml (lemminx based) is 0.26.1, while we depend on a newer version here, it is practically unusable, without building a custom vscode-xml? For now, we just get this error in the Output view for "XML Support" due to some API changes:
Caused by: java.lang.NoSuchMethodError: 'org.eclipse.lemminx.commons.progress.ProgressSupport org.eclipse.lemminx.services.extensions.XMLExtensionsRegistry.getProgressSupport()'
	at org.eclipse.lemminx.extensions.maven.MavenLemminxExtension.start(MavenLemminxExtension.java:203)
	at org.eclipse.lemminx.services.extensions.XMLExtensionsRegistry.registerExtension(XMLExtensionsRegistry.java:282)
  • The property name is xml.extension.jars, not xml.javaExtensions (which seems to serve quite a different purpose).

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

@angelozerr
Copy link

If I remember I think the vscode-lemminx-maven-jars directory contains lemminx JAR, if it is that you shoud remove it

@rgrunber
Copy link
Contributor

rgrunber commented Apr 18, 2024

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.

@rgrunber
Copy link
Contributor

rgrunber commented Apr 18, 2024

Also, xml.javaExtensions is the VS Code contribution point through which other extensions can ensure that extensions they wish to add to the XML language server end up registered (usable). The setting property that can also be used to send these is xml.extension.jars. So basically if you're using a non-VS Code client, you care about xml.extension.jars because xml.javaExtensions doesn't exist.

@pbodnar
Copy link

pbodnar commented Apr 18, 2024

@rgrunber, thanks for the clarifications. 👍 Regarding xml.javaExtensions vs. xml.extension.jars, I looked at it from the perspective of a VS Code user who does need to set the setting with ID xml.extension.jars. I've overlooked there is also some other "lower level of setup" being described above...

@rgrunber
Copy link
Contributor

rgrunber commented Apr 19, 2024

Yeah, xml.extension.jars is much easier to use. This is my entire setup to get it working after building the repo with -Pgenerate-vscode-jars :

"xml.extension.jars": [
        "/home/rgrunber/git/lemminx-maven/lemminx-maven/target/vscode-lemminx-maven-jars/*.jar"
],

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 xml.javaExtensions to do the final setup needed, after packaging lemminx-maven.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

How to download lemminx-maven uber JAR?
5 participants