-
Notifications
You must be signed in to change notification settings - Fork 11
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
Opt into html language features #23
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is not required to manually activate the html extension await htmlExtension?.activate();
because "extensionDependencies"
already activates the extension for you
I don't think a blank extension.js
file is required either
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It didn't activate the extension for me, that's how I found the vscode and Jinja issues. When I first tested it with just the package.json
changes I had no auto complete or documentation on hover.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
weird
it works when I add the package code to my non-html extension
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I retested removing "main": "./src/extension.js",
from the package.json
and it quit working for me until switching to HTML and back as described in microsoft/vscode#160585. I don't have any experience with VS Code extensions, so I can't really guess what might be different, but the discussion in that issue, especially that it sounds like they are considering auto-activating based on htmlLanguageParticipants
makes me think there isn't an obvious better way.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interestingly, a blank extension.js
file DOES work for me... which seems weird. I can only assume that running the activation script is enough to activate the dependencies, but just declaring them isn't? I've dropped the contents of extension.js
since it apparently isn't needed after all.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice catch
could prob make a bug report I guess
BTW after adding "main"
a blank "activationEvents": []
is required for publishing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added, thanks! I can probably write up a bug report later this evening.
43e64dc
to
816dbc8
Compare
816dbc8
to
215e246
Compare
This opts into VSCode's built-in HTML language features, allowing for autocomplete and documentation based on HTML tags, attributes, etc.
Addresses #20 and #18.
The extension.js implementation is cribbed directly from Jinja's implementation to address microsoft/vscode#160585 as mentioned in the comment.