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

Api to add and remove custom snippets.json files loaded? #662

Open
parrotcar00 opened this issue Aug 5, 2021 · 3 comments
Open

Api to add and remove custom snippets.json files loaded? #662

parrotcar00 opened this issue Aug 5, 2021 · 3 comments

Comments

@parrotcar00
Copy link

I'm trying to find out what emmet api I can use to programmatically add and remove the custom snippets.json file that I have loaded into emmet?

My use case is that I might define custom snippets that are specific to a project or a html file and I'd want to remove these custom snippets when I'm not editing that particular html file and wanted to do this programmatically.

@sergeche
Copy link
Member

sergeche commented Aug 5, 2021

You can simply redefine existing snippets globally or locally, for specific syntax only. No need to remove anything

@parrotcar00
Copy link
Author

Do you know what API I can use to redefine an existing snippets.json to be global or local? If I could just know which file in the emmet source deals with all this, I'd be set!

@sergeche
Copy link
Member

sergeche commented Aug 5, 2021

You can pass second argument with options to expand() method: https:/emmetio/emmet#usage

You can also refer unit tests with examples: https:/emmetio/emmet/blob/master/test/expand.ts#L71

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants