-
Notifications
You must be signed in to change notification settings - Fork 92
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
Manage snippet registry to write snippet in JSON #680
Manage snippet registry to write snippet in JSON #680
Conversation
This PR manages snippets with vscode JSON format. In other words
Here some advanced snippet support:
|
646ffe5
to
1ff5502
Compare
b810a78
to
45b3e8d
Compare
xml prolog should also probably be added to all snippets |
If there's an xml prolog already, the doctype snippets are not even proposed on the next line |
45b3e8d
to
fce48ba
Compare
d3817dd
to
4a6bed3
Compare
done
fixed
fixed
fixed @xorye could you play again with this PR and give me feedback, thanks! |
I have not managed sort for te moment, could we see that in an another PR please. |
05de9df
to
398559d
Compare
e023c94
to
b930bdb
Compare
It can be hard to do that because we need to manage case of existing or not of xml processing instruction to avoid generating it twice. I had the problem with DOCTYPE (which generates a root-element if doens't exist and don't generate it otherwise). To do that I have duplicated snippets (see newfile-snippets.json and doctype-snippets.json). To manage properly this usecase we should manage aggregation of several snippets, but perhaps we could do that in the future?
I removed it.
@xorye fixed
@xorye fixed
@xorye fixed
@fbricon fixed The JSON snippet needs to be improved again, but if you are OK could we done that in separate issues:
The new work that I have done is:
<?xml version="1.0" encoding="UTF-8"?>
|
9471326
to
ebcf25e
Compare
...lipse.lemminx/src/main/resources/org/eclipse/lemminx/services/snippets/doctype-snippets.json
Outdated
Show resolved
Hide resolved
...lipse.lemminx/src/main/resources/org/eclipse/lemminx/services/snippets/doctype-snippets.json
Outdated
Show resolved
Hide resolved
...lipse.lemminx/src/main/resources/org/eclipse/lemminx/services/snippets/new-xml-snippets.json
Outdated
Show resolved
Hide resolved
...lipse.lemminx/src/main/resources/org/eclipse/lemminx/services/snippets/new-xml-snippets.json
Outdated
Show resolved
Hide resolved
...lipse.lemminx/src/main/resources/org/eclipse/lemminx/services/snippets/new-xml-snippets.json
Outdated
Show resolved
Hide resolved
For the noNamespaceSchemaLocation snippet, the attributes are on a separate line:
A cool enhancement (maybe this can be done on a different issue) would be to have the attributes on a separate line if Taking it one step further, it might be cool to have snippet text be preformatted against the formatter. |
ebcf25e
to
9e487b4
Compare
fixed |
I agree with you we should pay attention with format settings in otherwise snippet should be formatted (each time or better one time and cache the formatted snippet). Please create an issue for that. Thanks |
Jenkins fails https://ci.eclipse.org/lemminx/blue/organizations/jenkins/lemminx/detail/PR-680/34/pipeline:
|
9e487b4
to
f287fe3
Compare
@fbricon fixed |
No it's very bad -( Let me try to fix it. |
a857388
to
c858258
Compare
Fixes eclipse-lemminx#640 Signed-off-by: azerr <[email protected]>
Fixes #640
Signed-off-by: azerr [email protected]