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

Add support for textDocument/definition for DTD #544

Merged
merged 1 commit into from
Aug 13, 2019
Merged

Conversation

angelozerr
Copy link
Contributor

Fixes #233

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

@angelozerr angelozerr force-pushed the dtd-definition branch 2 times, most recently from 723a613 to fb625c7 Compare July 24, 2019 18:06
@angelozerr
Copy link
Contributor Author

To play with this PR, open the DTD https://github.com/angelozerr/lsp4xml/blob/master/org.eclipse.lsp4xml/src/test/resources/dtd/svg.dtd

and do like the following demo:

DTDDefinitionWithSVG

It shoud work too when DOCTYPE inside XML is defined.

With this XML file:

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE note [
	<!ELEMENT note (to,from,heading,body)>
	<!ELEMENT to (#PCDATA)>
	<!ELEMENT from (#PCDATA)>
	<!ELEMENT heading (#PCDATA)>
	<!ELEMENT body (#PCDATA)>
]>
<note>
	<to>Tove</to>
	<from>Jani</from>
	<heading>Reminder</heading>
	<body>Don't forget me this weekend!</body>
</note>

Ctrl+Click on the first heading (declared in <!ELEMENT note (to,from,heading,body)>) should set the cursor to the declared heading ( <!ELEMENT heading (#PCDATA)>)

@angelozerr
Copy link
Contributor Author

@fbricon I have finished to clean my code and write several tests.

Fixes #233

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

@angelozerr

I think this should be one hyperlink, not sure if this is not easily doable.

savag

@angelozerr
Copy link
Contributor Author

angelozerr commented Jul 24, 2019

I think this should be one hyperlink, not sure if this is not easily doable.

Our LSP4XML definition supports
https://microsoft.github.io/language-server-protocol/specification#locationlink which should fix that. But it seems vscode doesn't support it now and supports only https://microsoft.github.io/language-server-protocol/specification#location

After debugging, it seems vscode doesn't support the capability clientCapabilities.textDocument.definition.linkSupport (see https://microsoft.github.io/language-server-protocol/specification#textDocument_definition). Once vscode will support it this problem should be gone.

@angelozerr
Copy link
Contributor Author

@NikolasKomonen do you think we can merge it this PR? @fbricon what do you think?

@NikolasKomonen
Copy link
Contributor

@fbricon It works great for me, I think it can be merged.

@angelozerr angelozerr merged commit 8a3da66 into master Aug 13, 2019
@angelozerr
Copy link
Contributor Author

Thanks @NikolasKomonen for your review!

@angelozerr angelozerr deleted the dtd-definition branch August 13, 2019 14:12
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.

Add support for textDocument/definition for DTD
2 participants