-
Notifications
You must be signed in to change notification settings - Fork 29.4k
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
Test: Enable emmet for other languages #9500 #11139
Comments
Do you mean "inside a Java file using the html profile"? If not I could use some clarification on how to test part one. If you did mean Java, these are the steps I took. Add the following to "emmet.syntaxProfiles": {
"java": "html"
} Create |
For reference this is what I put in the extension's "contributes": {
"languages": [
{
"id": "foo",
"extensions": [".foo"]
}
],
"grammars": [
{
"language": "foo",
"scopeName": "text.foo.html",
"path": "grammar.tmLanguage"
}
]
}, And here is my sample grammar.
|
Yes, you're right. Correct result:
For correct results, you should use P.S.: for testing you can use any extension that provides the HTML syntax (or any language from #9500 (comment)). For example: https://github.com/mrmlnc/vscode-vash. Correct result: |
@aeschli @ramya-rao-a friendly reminder to test this item. |
Naming my grammar's scope in a specific way so that I get emmet proposals seems like hacky solution to me. It only is feasible when my language is a subset of that language, given that the scope name also has an impact on colorization (at least as long as we flatten our scopes). |
The newly defined language only gets emmet abbreviations if the scope name was
|
@ramya-rao-a, @aeschli, I think that it's not hacky solution. If the language inherits syntax of another language, the developer needs to specify him in
In any case we get result. For example:
In the case of an explicit solution, for example, option in In the current solution does not suit me only this rule ( P.S.: Maybe I'm wrong. |
Test for #9500
Complexity 1
You can enable emmet for other languages both as a user and as a language contributor.
Enable emmet for a new language as a user.
As a user you can define an emmet syntax profile and associate an emmet supported profile to a language. For a list of supported emmet profiles see #9500 (comment). For example to associate
java
with thehtml
syntax profile you can define the setting:Enable emmet as a language provider
As a language provider you can associate your language with an emmet syntax profile by adding an emmet supported profile in the scope name of the grammar (textmate language grammar). For example, define the scope of you
Define a language foo as shown above.
html
appears in the scope name.The text was updated successfully, but these errors were encountered: