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

Bind to a schema from an empty document #1408

Merged
merged 1 commit into from
Jan 8, 2023

Conversation

datho7561
Copy link
Contributor

@datho7561 datho7561 commented Dec 13, 2022

Allows you to use the code action to bind to a schema when a document doesn't have a root element. Also, the bind schema CodeLens is shown when the document doesn't have a root element.

It generates an element placeholder-element-name when the binding
strategy requires a root element to function (eg. schemaLocation, noNamespaceSchemaLocation). It also uses placeholder-element-name when binding to a .dtd using a DOCTYPE declaration.

Closes redhat-developer/vscode-xml#819

Signed-off-by: David Thompson davthomp@redhat.com

@datho7561 datho7561 force-pushed the 819-bind-to-schema branch 2 times, most recently from 5531e2e to 84224cd Compare December 13, 2022 20:07
@datho7561
Copy link
Contributor Author

I need to write tests, but the code should be good.

@datho7561 datho7561 marked this pull request as ready for review December 14, 2022 18:21
@angelozerr
Copy link
Contributor

@datho7561 could you fix the conflict please.

@datho7561 datho7561 force-pushed the 819-bind-to-schema branch 2 times, most recently from 1ddec78 to 80b4663 Compare January 4, 2023 15:41
Allows you to use the code action to bind to a schema when
a document doesn't have a root element.
Also, the bind schema CodeLens is shown when the document doesn't
have a root element.
It generates an element `placeholder-element-name` when the binding
strategy requires a root element to function (eg. `schemaLocation`,
`noNamespaceSchemaLocation`).
It also uses `placeholder-element-name` when binding to a `.dtd` using a
DOCTYPE declaration.

Closes redhat-developer/vscode-xml#819

Signed-off-by: David Thompson <davthomp@redhat.com>
@angelozerr angelozerr added this to the 0.24.0 milestone Jan 8, 2023
@angelozerr angelozerr merged commit 1663001 into eclipse-lemminx:main Jan 8, 2023
@angelozerr
Copy link
Contributor

It works like a charm, thanks @datho7561 !

@datho7561 datho7561 deleted the 819-bind-to-schema branch January 9, 2023 13:26
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.

"Bind to schema" doesn't work if the document doesn't have a root element
3 participants