Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
WDYT of just changing this to
.vscode/launch.json
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Teams may want to share custom launch configurations. Mahdi makes some good points on the original PR as well. At the very least, we need to think about this a bit more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My objection here is that auto-generated files should not be committed in the first place. I've bit gitignoring this file in my every single Swift package because VS Code kept recreating it with no way to prevent that, and I don't see a use case for keeping it really. At the very least, VS Code should keep auto-generated and manually maintained data in separate files.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about something like:
Those un-ignored files prefixed with
!
are some you may want to share.launch.json
, liketasks.json
, can be shared and may be potentially useful to others.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same, every project I use VS Code with, I add this line into gitignore.
I'm curious, to make this more data-driven: could we search for packages that have Package.swift and also either have
.vscode
in the gitignore, or have at least one checked-in file from the.vscode
directory? That way we could see what's more common and which group to optimize for (and the other group can always update their gitignore post-init).There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm unfamiliar with some of the xcode related entries in the gitignore. Seems like
xcuserdata
makes sense to ignore. I'm not sure aboutcontents.xcworkspacedata
.Is the underlying issue that the VS Code Swift Extension is creating and modifying launch/tasks.json files in the .vscode folder? If so I think it makes sense to address this in the extension and if possible avoid auto-generating these configurations. That would mean that anything in
.vscode
would be put there explicitly by the user and then its totally up to them how to set up their.gitconfig
around.vscode
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm all for that. I actually find the autogenerated tasks for SwiftPM to be annoying. There's so many of them. That said I do appreciate help creating them. I'd hate to have to remember where my executable ended up.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, might make sense to declare bankruptcy and remove them all, that way at least we start from a consistent point.
xcuserdata is user data, but the argument for not having
.vscode
was that some people do want their user data committed, so I'm curious if we can get to a set of rules that help contributors understand what is and isn't in the gitignore.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@czechboy0 While you can configure whats in
.vscode
to be user data specific to a user I'd argue that its mainly for project configuration data. Settings, recommended extensions, launch tasks, etc are all project specific and not user specific. They can all be configured with relative paths so that when a new user checks out the project it builds in VS Code with no extra setup. I'd argue the default is to commit it and the less common path is to have non-portable configuration in there that should be .gitignored. If the VS Code Swift extension is generating launch configs that aren't portable or useful then we should have that discussion in that repository or on the forums.For now I propose we go forward with this revert and continue to discuss.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, go ahead. I've personally not worked on a single repo that checked in
.vscode
contents, all the ones I've worked with ignore it, but it's also not too difficult to add it to.gitignore
on every project I work on, so happy with the revert 👍