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

Feature Request - Project-level extensions and snippets #8102

Closed
jdforsythe opened this issue Jun 24, 2016 · 34 comments
Closed

Feature Request - Project-level extensions and snippets #8102

jdforsythe opened this issue Jun 24, 2016 · 34 comments
Assignees
Labels
feature-request Request for new features or functionality release-notes Release notes issues snippets verification-needed Verification of issue is requested verified Verification succeeded

Comments

@jdforsythe
Copy link

  • VSCode Version: all
  • OS Version: all

We have a custom set of snippets written per-project and would like to include them in the project repo, like our launch.json, tasks.json. Right now we just include the json file and the dev has to copy+paste it into his user snippets, but the snippets are particular to a project, not to all projects.

Also it would be great to have a way to define what extensions a developer should have installed to work on the project. We use several code quality and styling plugins to enforce our custom rules and it would be nice if there was a project definition file to suggest installation of the extensions we define.

@dbaeumer dbaeumer assigned chrisdias and unassigned chrisdias Jun 25, 2016
@dbaeumer
Copy link
Member

@aeschli can you comment on the snippet request. Can't we define snippets on a workspace folder level.

@chrisdias @seanmcbreen for the workspace folder extension request.

@seanmcbreen
Copy link

A workspace config for extensions is something we are definitely thinking about.

@rebornix
Copy link
Member

rebornix commented Aug 8, 2016

I was writing test cases for extensions and those cases share similar format then I thought I should put a snippet in project settings. But unfortunately I found that's not possible right now.

This can be a good extension as well if we expose Snippet management through API.

@maxdeviant
Copy link

I would love to see workspace-level snippets.

@mpj
Copy link

mpj commented Nov 18, 2016

This would indeed be amazing. In fact, I found it really unintuitive that there is marketplace-level snippets, but not project level. Took me quite a while to figure out that it wasn't possible. :P

@rebornix
Copy link
Member

Just for your information, with the new API we added in our latest release 1.8, project/workspace level snippets is now possible. You can use this extension https://marketplace.visualstudio.com/items?itemName=rebornix.project-snippets to share and insert snippets across projects.

@jdfwarrior
Copy link

Does this plugin still work? Unless I'm doing something wrong, it doesn't seem to be doing anything and there is zero information on it (in the README). I created a snippets folder in .vscode and then created a language specified snippets file within there but that file isn't loaded. I can't use the snippets there.

@rebornix
Copy link
Member

@jdfwarrior do you mind sharing me part of your snippet then I can have a good reproduce and see what's blocking you :( I know it's not a reasonable request but look forward to your reply.

@jdfwarrior
Copy link

@rebornix This is all I currently have while testing..

{
"Print to console": {
"prefix": "log",
"body": [
"console.log('$1');",
"$2"
],
"description": "Log output to console"
},

"Angular Controller": {
"prefix": "controller",
"body": [
"export default class $1 {",
" constructor( $2 ) {",
" $0",
" }",
"}"
],
"description": "Create new Angular controller"
}
}

Is there any kind of configuration that needs to be done to make this work?

@rebornix
Copy link
Member

@jdfwarrior the only thing I'm worried about is tab or space , maybe it's similar to rebornix/vscode-project-snippet#4 as your snippet looks reasonable. I'll reach out to you real quick after fixing that.

@rebornix
Copy link
Member

@jdfwarrior I've updated the extension. Please let me know if it fixes your problem.

@rebornix rebornix added the *extension-candidate Issue identified as good extension implementation label Mar 30, 2017
@larssb
Copy link

larssb commented Jun 29, 2017

@rebornix seems to work after your March 30th update. Thanks.

@fallenleavesguy
Copy link

@rebornix thanks.

@theblang
Copy link

Just an FYI for anyone who finds this ticket, you can now specify recommended extensions for the workspace.

@ffxsam
Copy link

ffxsam commented Feb 4, 2018

Would love to see workspace-shared snippets!

@antoniusostermann
Copy link

+1

2 similar comments
@imrvelj
Copy link

imrvelj commented Feb 9, 2018

+1

@fallenleavesguy
Copy link

+1

@jrieken jrieken assigned jrieken and unassigned chrisdias Sep 7, 2018
@jrieken jrieken added the help wanted Issues identified as good community contribution opportunities label Sep 7, 2018
@egamma
Copy link
Member

egamma commented Sep 11, 2018

September issue cleansing.

This is well covered by an extension and we have no plans to bundle this extension with VS Code.

@egamma egamma closed this as completed Sep 11, 2018
@egamma
Copy link
Member

egamma commented Sep 11, 2018

Reopening... this is not out of scope according to our guidelines https://github.com/Microsoft/vscode/wiki/Issue-Grooming#out-of-scope-feature-requests

@egamma egamma reopened this Sep 11, 2018
@egamma egamma removed the *extension-candidate Issue identified as good extension implementation label Sep 11, 2018
@jrieken jrieken removed the help wanted Issues identified as good community contribution opportunities label Sep 20, 2018
@jrieken jrieken added this to the September 2018 milestone Sep 20, 2018
@jrieken
Copy link
Member

jrieken commented Sep 20, 2018

Reopening... this is not out of scope according to our guidelines https://github.com/Microsoft/vscode/wiki/Issue-Grooming#out-of-scope-feature-requests

Even better: this will happen in September!

@jrieken
Copy link
Member

jrieken commented Sep 21, 2018

Good news: Current Insiders has a rough version of this already and with next Insiders this will be working. This is how:

  • you can put snippets in the .vscode-folder of your workspace (but not inside subfolders of that)
  • only snippet files with the .code-snippets extension are supported
  • the insert snippet command and completions show that a snippet is a workspace snippet
  • with the configure snippet command you can create workspace snippets

screen shot 2018-09-21 at 11 38 56

Ash258 added a commit to Ash258/Shovel-Ash258 that referenced this issue Sep 21, 2018
@jrieken jrieken closed this as completed Sep 21, 2018
@jdforsythe
Copy link
Author

Thank you! This is why we love VS Code

@ffxsam
Copy link

ffxsam commented Sep 21, 2018

Thanks, team!

@Ash258
Copy link
Contributor

Ash258 commented Sep 21, 2018

you can put snippets in the .vscode-folder of your workspace (but not inside subfolders of that)

@jrieken Love this, but can we expect support for subfolders? (best way .vscode\snippets\*.code-snipets).

@jrieken jrieken added the verification-needed Verification of issue is requested label Sep 24, 2018
@jrieken
Copy link
Member

jrieken commented Sep 24, 2018

@Ash258 We are always a little scared of subfolders because there might be many, many...

@rebornix
Copy link
Member

🚀 love this feature, my extension can retire now and I don't need to fix all those issues 😆 . I'll put my name on the test item to ensure they get tested.

@rebornix rebornix added the verified Verification succeeded label Sep 26, 2018
@rebornix
Copy link
Member

Went through https://github.com/rebornix/vscode-project-snippet/issues and test cases of vscode-project-snippet, didn't find any issue at all, the builtin support is solid 👍

@jrieken jrieken added the release-notes Release notes issues label Sep 27, 2018
@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 5, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature-request Request for new features or functionality release-notes Release notes issues snippets verification-needed Verification of issue is requested verified Verification succeeded
Projects
None yet
Development

No branches or pull requests