-
Notifications
You must be signed in to change notification settings - Fork 24
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
We should have HTML attribute snippet completion of the ="" #345
Comments
My apologies. I now also see this issue. I'll leave this one open, so you can read a little bit of my additional context as well. |
It's all good I prefer the context in this one :) I'd love to get around doing that one. We support snippet completion in the codemirror-language-client now (had to do it for JSON completion in the Shopify admin), so there's nothing stopping us from adding snippet completions in our HtmlAttributeCompletionProvider Things to look at for is making sure we do re-add them if the equal sign is already there. From the spec, what we need to add is this:
Resources |
(Updated above comment with more breadcrumbs in case it isn't me that implements it :)) |
Hi @charlespwd, I try to contribute here and figured out what to do. The only thing is that debugging is quite hard... I added the following (WIP), but this should do the easy trick. HtmlAttributeCompletionProvider function toCompletionItem(tag: Attribute): CompletionItem {
return {
label: tag.name,
kind: CompletionItemKind.Value,
insertText: tag.valueSet !== 'v' ? `${tag.name}="$1"` : tag.name,
documentation: {
kind: 'markdown',
value: renderHtmlEntry(tag),
},
};
} I did a format -> build -> test and have it running with pressing F5. I create a simple liquid file and type Any idea why? When I remove my edits, it works fine. |
Describe the bug
When I type
clas
, the editor will suggest me to auto completeclass
. Normally it's smart enough to add=""`` as well where your cursor will be placed within
"". This is not the case. It only autocompletes the word, but without
=""`.Source
Expected behaviour
When I hit tab when a suggestion pops up, I expect that it will be completed with
=""
at the end with my cursor inside""
.Actual behaviour
When I hit tab when a suggestion pops up, it only autocompletes the word.
Debugging information
Additional context
I created my own extension ones which is working correctly. At that time, HTML autocompletion was not working yet with the Shopify extension. Since it is kind of working now, I got the suggestions twice.
Might be worth to checkout
vscode-html-languageservice
as well.Handy links
Good to know
vscode-html-languageservice is checking for tags that doesn't have the valueSet set to 'v'. If it has 'v', the attribute doesn't support any value.
The text was updated successfully, but these errors were encountered: