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

Contribute to completion, hover .. with external JAR #193

Merged
merged 1 commit into from
Oct 28, 2019

Conversation

angelozerr
Copy link
Contributor

Contribute to completion, hover .. with external JAR

Fixes #190

Signed-off-by: azerr azerr@redhat.com

@angelozerr
Copy link
Contributor Author

This PR gives the capability to contribute with custom completion, hover, etc by using SPI mechanism used by LSP4XML by developping a vscode extension which declares in the package.json, the xml.javaExtensions:

       "contributes": {
		"xml.javaExtensions": [
			"./jar/org.eclipse.lsp4xml.extensions.maven-0.9.1.jar"
		]
	}

See a sample at https://github.com/angelozerr/vscode-xml-maven/blob/master/package.json#L18

Please review the code for the moment and I will explain you soon how to test it.

@angelozerr
Copy link
Contributor Author

To test this PR you can do it with https://github.com/angelozerr/vscode-xml-maven/blob/master/package.json#L18

This vscode extension extends the completion scope for maven by using LSP5XML SPI completion participant for maven. See https://github.com/angelozerr/lsp4xml-extensions-maven/blob/master/org.eclipse.lsp4xml.extensions.maven/src/main/java/org/eclipse/lsp4xml/extensions/maven/MavenCompletionParticipant.java#L39

As we cannot launch 2 extensions in vscode, you should

  • install [vscode-xml-maven-0.0.1.vsix)(vscode-xml-maven with https://github.com/angelozerr/vscode-xml-maven/blob/master/vscode-xml-maven-0.0.1.vsix)
  • launch vscode-xml with this PR
  • open a pom.xml file and open the completion inside scope element, you should have that:

MavenExtensionDemo

src/extension.ts Outdated Show resolved Hide resolved
package.json Outdated Show resolved Hide resolved
package.json Outdated Show resolved Hide resolved
@xorye
Copy link

xorye commented Oct 25, 2019

the completion is working for me

package.json Outdated Show resolved Hide resolved
@angelozerr
Copy link
Contributor Author

the completion is working for me

Are you testing in Linux OS? If your test in Linux OS, it's very cool because it means classpath build is working on any OS (I'm on Windows OS). See https://github.com/redhat-developer/vscode-xml/pull/193/files#diff-d106f0e1914f2f6cbf79404a7f0c42b4R43

@xorye please tell me if you need some other changes, otherwise please merge it, thanks!

@xorye
Copy link

xorye commented Oct 25, 2019

Yes, I am testing on Linux OS, and pathSeparator is : for me, so that's good.

@xorye
Copy link

xorye commented Oct 25, 2019

"vscode": "^1.27.0"

Could you change this to "^1.37.0", so that its "vscode": "^1.37.0"?
Since we are using @types/vscode 1.37.0, we need that to change.

Fixes redhat-developer#190

Signed-off-by: azerr <azerr@redhat.com>
@angelozerr
Copy link
Contributor Author

Could you change this to "^1.37.0", so that its "vscode": "^1.37.0"?

@xorye fixed.

Copy link

@xorye xorye left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

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.

Contribute to completion, hover .. with external JAR
3 participants