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

Add jinja2 to the lib/snippets.json file for emmet support #15021

Closed
MortalCatalyst opened this issue Nov 5, 2016 · 5 comments
Closed

Add jinja2 to the lib/snippets.json file for emmet support #15021

MortalCatalyst opened this issue Nov 5, 2016 · 5 comments
Assignees
Labels
emmet Emmet related issues upstream Issue identified as 'upstream' component related (exists outside of VS Code)

Comments

@MortalCatalyst
Copy link

  • VSCode Version: August 2016 +
  • OS Version: All

In #9500 it references that support for extra languages in emmet are available in the lib/snippets.json file. What would need to be done to add jinja2 as a listed member of that array so that available extensions could utilise emmet jinja2 together.

Has a significant use case with Flask, Ansible, Pyramid etc as one of the most significant templating languages in python.

@rebornix
Copy link
Member

rebornix commented Nov 7, 2016

It's an easy one, @MortalCatalyst you want to give it a try?

@mrmlnc
Copy link
Contributor

mrmlnc commented Nov 8, 2016

Hello, @MortalCatalyst,

After the release of version 1.6.0 VS Code has support for all languages that are supported by Emmet. Now you can:

Create your own plugin

You can convert an existing solution, for example, https://atom.io/packages/atom-jinja2 or https://github.com/antal-bukos/sublimetext3_jinja2_syntax. Just convert cson to json or use tmLanguage files and create plugin for VS Code.

Most importantly, don't forget to check out the scope of language:

tmLanguage

<key>scopeName</key>
<string>text.html.jinja</string> // or jinja2

json

"scopeName": "text.html.jinja" // or jinja2

Configure editor

You can use files.associations to associate j2 extension with html mode:

"files.associations": {
  "*.j2": "html"
}

@MortalCatalyst
Copy link
Author

How can I help the author of the already existing jinja plugin https://marketplace.visualstudio.com/items?itemName=wholroyd.jinja

It seems the only thing I needed to do was to add

"files.associations": {
  "*.j2": "html"
}

to my user settings is there a way the plugin can implement that by default?

@MortalCatalyst
Copy link
Author

Either way I have added snippets support to the vscode repo https://github.com/wholroyd/vscode-jinja/pull/10

@mjbvz mjbvz added the emmet Emmet related issues label Nov 12, 2016
@egamma egamma added the upstream Issue identified as 'upstream' component related (exists outside of VS Code) label Dec 12, 2016
@egamma
Copy link
Member

egamma commented Dec 12, 2016

Closing as upstream

@egamma egamma closed this as completed Dec 12, 2016
@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 18, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
emmet Emmet related issues upstream Issue identified as 'upstream' component related (exists outside of VS Code)
Projects
None yet
Development

No branches or pull requests

5 participants