Why does vscode/platformio insist on adding useless entries to my .gitignore file - visual-studio-code

I have been using vscode and PlatformIO for a little while now.
I would like my .gitignore file to be:
.pioenvs
.piolibdeps
.vscode/
but for some reason the IDE insists on adding the following every time I start up:
.vscode/c_cpp_properties.json
.vscode/launch.json
I am already ignoring the entire .vscode directory, why is it valuable to ignore individual files within that directory?

Related

How to open vscode on a large directory of files

I have a project that has hundreds of .c .h and .cpp files. I'd like to start using vscode with this project; however, I need to be able to tell vscode what files to actually include in the project (because depending on the build, many files are not included). Is there a way to force a file list into vscode without using the GUI/Add-File mechanism?

How do I stop VScode from creating the .vscode folder inside my source folder

VScode keeps creating this weird .vscode folder inside my source folder where my code is, it's super annoying and I want nothing to do with it. For some odd reason deleting it caused my program to bug out, of course I thought it was my code but I ctrl-z the entire code back where I started and it still did the same thing.
And I'm not using any build in compilers in vscode.
I've found the best thing to do here is setup a global .gitignore file and add .vscode to it https://sebastiandedeyne.com/setting-up-a-global-gitignore-file/

How can I create Eclipse-style folders from the Terminal?

Is it possible to create Eclipse-style folders (Project Folder, Package and so on) via the Terminal?
I once renamed an Eclipse package like this: mv oldname newname, and I noticed that after doing so, Eclipse no longer considered the folder a Package.
This possibly means that it is a matter of metadata, but I have so far been unsuccessful in locating the files containing the relevant information.
Eclipse does not provide anything to do this and it is not really possible manually.
For a project some information is stored in the .project file in the project folder. Depending on the type of project there may also be a .classpath file and there will also be data stored in the .metadata folder in the workspace and also in a .settings folder in the project.
All the file and folder names starting with . are considered to be hidden on Linux, Unix and Mac systems and are not shown by default. Use the -a flag of ls to see them.

Files disappeared, could be related to Eclipse

I have lost files mysteriously a few times from my Eclipse workspace folder, and previously I assumed that I must have deleted them, but this time I know for sure that I didn't.
I entered a folder for a Java project. I listed the files. There were several text files. I then opened one in gedit to look at it. As far as I remember, I then did something in libreoffice Calc (to a spreadsheet file in a completely separate location), then I made some changes to the Java file in Eclipse. It would then have been automatically compiled. I then went back to the terminal to execute the program, but it wouldn't run. Listing the files shows that the reason it wouldn't run is that all the text files have disappeared and so has one of the .jar files (called stanford-parser.jar) but not another. I've searched my computer for these files and I can confirm they've gone.
A screenshot from my terminal illustrates this.
Can anyone help me to understand how this is happened, so I can avoid it happening again? Could compilation delete the files?
You seem to be storing source files in the bin directory of your Eclipse project, which is probably the target directory used by Eclipse to put the compiled classes. Store your sources in the source folder. The target folder is completeley deleted by Eclipse each time the project is cleaned up.
Note that non .java files stored in the source directory are automatically copied to the target directory by Eclipse. They're considered as resources that must be available at runtime in the compiled application.

IntelliJ IDEA 9/10, what folders to check into (or not check into) source control?

Our team has just moved from Netbeans to IntelliJ 9 Ultimate and need to know what files/folders should typically be excluded from source control as they are not "workstation portable", i.e.: they reference paths that only exist on one user's computer.
As far as I can tell, IntelliJ wants to ignore most of the .idea project including
.idea/artifacts/*
.idea/inspectionProfiles/*
.idea/copyright/*
.idea/dataSources.ids
.idea/dataSources.xml
.idea/workspace.xml
However, it seems to want to check in the .iml files that exist in each module's root directory.
I originally checked in the entire .idea directory via the command line which is obviously not aware of what "should" be ignored by IDEA. Is the entire .idea directory typically ignored?
We have a FAQ article covering this question.
[The .idea] format is used by all the recent IDE versions by default.
Here is what you need to share:
All the files under .idea directory in the project root except the workspace.xml and tasks.xml files which store user specific settings
All the .iml module files that can be located in different module directories (applies to IntelliJ IDEA)
Be careful about sharing the following:
Android artifacts that produce a signed build (will contain keystore passwords)
In IDEA 13 and earlier dataSources.ids, datasources.xml can contain database passwords. IDEA 14 solves this problem.
You may consider not to share the following:
.iml files for the Gradle or Maven based projects, since these files will be generated on import
gradle.xml file, see this discussion
user dictionaries folder (to avoid conflicts if other developer has the same name)
XML files under .idea/libraries in case they are generated from Gradle or Maven project
.idea directory is a replacement for the old .ipr (Idea Project) file and if you want to share the project between users, then you need to share .idea folder (with the exceptions mentioned in the FAQ) and all the .iml files.
Refer to GitHub's JetBrains.gitignore file to always have an updated listing of which files to ignore.
Not an exact answer to the question, but there are sample .gitignore files available here, including one for JetBrains which includes IntelliJ.
You might find this post interesting: Merges on IntelliJ IDEA .IPR and .IWS files
It seems to conclude that you should add all files except for: workspace.xml, dataSources.xml, sqlDataSources.xml and dynamic.xml. The answer there is focusing on having files that do not change simply from opening the editor or making ide specific changes.
I'm using PHPStorm.
Here is an example snippet for your .gitignore
# Ignore the following 2 PHPStorm files only workspace and tasks file
**/.idea/workspace.xml
**/.idea/tasks.xml
All other files in the .idea directory should be committed to your repository.
e.g: (commit everything else in the .idea directory)
new file: .idea/.name
new file: .idea/encodings.xml
new file: .idea/framework.iml
...
Docs: How to manage projects under Version Control Systems
Here is what you need to share:
All the files under .idea directory in the project root except the workspace.xml and tasks.xml files which store user specific settings
All the .iml module files that can be located in different module directories (applies to IntelliJ IDEA)
So basically, commit everything except workspace.xml and tasks.xml.
Yes, I believe so. You can check the SVN configuration to see what's ignored and add anything that you think should be ignored.
IntelliJ now creates its own .gitignore file in the .idea folder so you can safely add it to repository.