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

Code snippets/template as in Eclipse #3686

Open
Sandared opened this issue Nov 30, 2018 · 6 comments
Open

Code snippets/template as in Eclipse #3686

Sandared opened this issue Nov 30, 2018 · 6 comments
Labels
enhancement issues that are enhancements to current functionality - nice to haves help wanted issues meant to be picked up, require help monaco issues related to monaco vscode issues related to VSCode compatibility

Comments

@Sandared
Copy link

It would be awesome to be able to create own code snippets/templates as in Eclipse, i.e. I type "fore" and then via autocomplete create a full foreach loop code fragment that lets me edit only the variable parts.
Not sure if this has been already resolved by #54

@akosyakov akosyakov added editor issues related to the editor enhancement issues that are enhancements to current functionality - nice to haves help wanted issues meant to be picked up, require help labels Sep 12, 2019
@akosyakov
Copy link
Member

See https://code.visualstudio.com/docs/editor/userdefinedsnippets#_create-your-own-snippets

Theia is capable already to load snippets from a file:

fromURI(uri: string | URI, options: SnippetLoadOptions): Disposable {

We need a command to allow a user to add new snippets in the global snippet file and code tracking changes to this file and updating snippet configurations.

@akosyakov akosyakov added monaco issues related to monaco and removed editor issues related to the editor labels Sep 12, 2019
@akosyakov
Copy link
Member

PRs are welcomed if someone wants to have a look into it.

@marcdumais-work
Copy link
Contributor

marcdumais-work commented May 9, 2023

This extension looks promising (it's a bit old vs what's in the MS Marketplace):
https://open-vsx.org/extension/vscode-snippet/snippet

image

@MatthewKhouzam
Copy link
Contributor

Would this be interesting for boilerplate issues like copyright headers?

e.g. I'm developing the Linux Kernel, I want to add a gpl2 preamble, would this help?

@marcdumais-work
Copy link
Contributor

Yes, I think so .A given project could add their license header as a custom snippet, making it very easy to add it when creating a new file

@vince-fugnitto
Copy link
Member

For additional information I believe the issue should track supporting user-defined snippets.

It seems as though snippets contributed by language-extensions (and others) are supported in the framework (ex: html doctype template), but we are still missing the ability to load *.code-snippets (like our copyright headers), and the snippets: configure user snippets command.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement issues that are enhancements to current functionality - nice to haves help wanted issues meant to be picked up, require help monaco issues related to monaco vscode issues related to VSCode compatibility
Projects
None yet
Development

No branches or pull requests

5 participants