-
Notifications
You must be signed in to change notification settings - Fork 945
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
Adding support for Visual Studio Code #2168
base: master
Are you sure you want to change the base?
Conversation
Added VS Code workspace files to Cinder and all of the samples. Updated Cmake guide to introduce VS Code as a free cross-platform IDE solution and how to use it along with cmakeTools and cppTools extensions
As per Rich's suggestion, found a way to pack the needed settings in the |
P.S : I haven't tested this on osx yet because I don't have one around but it should work OK if cmake was already working on it. It'll be great if someone can test this. Maybe with the addition of this? |
Corrected the info on configuring Cinder in the guide
Still think it would be much more effective and efficient to put the cmake files into the root folder where they belong instead of adding N tool specific configuration files to each of the M examples and maintain them, but I guess that needs a decision from @richardeakin or @andrewfb. |
Yeah I guess that's something best decided by the main maintainers of Cinder since it will be a breaking change and previous projects will need to be modified if this change occurs. Meanwhile I need to say that there is no more the need of having N configuration files because I managed to put all the necessary settings in the Also the needed settings are more than just pointing to the CML file in my case, so even if the CML files are moved to the root of each project, there still needs to be other settings set in the project file. To demonstrate this, here's the content of the And here it is for a sample that has the CML in As you can see the settings are more than the path to the CML and will need to be there anyways. Although as mentioned, I don't think that's a problem in either case because all is embedded in the workpspace file itself |
One question I had when it comes to the discussion about file paths, is the location of these |
The N was refererring to the N different tools that users might want to use Cinder with. |
And I don't think any of those additional settings are actually necessary in order to allow users to interact with cinder in a convenient manner. |
E.g.:
|
Oops sorry, thought you meant the files for each tool.
I followed Cinder's own routine. Since the CML files are inside
If this value is not set, the first time the workspace project is opened, vs-code asks if it should use the Cmake toolchain as the C++ configuration provider. If answered yes by the user, the exact same setting is written to a
Yes, you can do that but that's not the recommended way when it comes to vs-code and cmake-tools. Have a look at this, here it explicitly says that to change configuration settings, it's best to set this value in the settings.json file. And again to prevent a redundant hidden folder, I decided to embed this setting in the workspace file itself. |
In all the points I was referring to your comment that even if the CML was in the root, a VS-Code config file was needed
That's only a reason as long as the CML is in that sub directory instead of the root.
I haven't been asked this on my machine when I moved the CML into the root - it just worked, but even if it happens- so what?
Sorry If I was unclear: I was asking if it is necessary to set this option in a cinder-provided file. If VSCode creates it itself after a simple yes/no question, I'd say no, it is not necessary.
I think you ignored the first part of my question: Isn't that the default anyway?
It says that IF you need to set options, you shouldn't do it via a) That doesn't mean you shouldn't set necessary options and flags in the CML (which btw. has the advantage that they are now picked up by all editors- not just VSCode) and b) I don't see, why this option has to be set explicitly at all given that building static libs is the default behavior anyway. Again, my argument here is that, if the existing CMLs would be moved to the root, everything would probably just work for a number of different editors (including VSCode, but also VS, QtCreator, CLion and probably a few more) without adding any tool specific files. At worst the user might have to answer 1-2 popup dialogs (again, I didn't have to, but that might be specific to my environment). If the project maintainers instead decide that they want to keep the CMLs in the sub directory and add individual support for various tools, then this looks like a good PR to add support for VSCode. |
I believe that the original motivation for having separate folders for the different editors/toolsets that Cinder supports on the different platforms was mainly to keep different project files/directories isolated/uncluttered and easy for the user to pick and start depending on the development platform at hand. With support for VS and Xcode project files along with CMake there had to be some directory restructuring to keep things tidy and at that point, it felt that keeping the CMake dir structure similar as to the other tools was a natural choice. I understand that this is a bit in contrast with the traditional CMake approach of having things located at the root folder but on the other hand I do not personally see a real issue with the current structure and people are already using different editors with the current CMake configuration with minimal setup needed. That said, with the number of different editors supporting CMake increasing constantly, I think it would be problematic to try and follow a similar pattern for each individual editor. In the case of VSCode ( and any other editor ) I suppose the main question would be what is the maintenance cost and how can this be minimised - Considering that, personally I would lean towards @MikeGitb direction in that when it comes to support for different editors whatever can be set by user or defaults it is better to stay like this instead of adding individual settings files since this would provide the path of least resistance moving forward. If something doesn't work this way because of Cinder's CMake configuration then we should try to solve the issue there ( instead of patching the issue on the editor settings side ) so that other editors can benefit by default also. If there is a real explicit need for some editor settings to be stored and its not just about conveniency or saving clicks then I guess it is really a question of the maintenance cost/benefit ratio at the end of the day. |
Added VS Code workspace files to Cinder and all of the samples. Updated Cmake guide to introduce VS Code as a free cross-platform IDE solution and how to use it along with cmakeTools and cppTools extensions in VS Code