conan-io / conan

Conan - The open-source C and C++ package manager
https://conan.io
MIT License
7.95k stars 951 forks source link

VSCode extension #11087

Open memsharded opened 2 years ago

memsharded commented 2 years ago

Many developers are now on vs code and it's ruling IDE market according to stackoverflow survey 2019. I wish there would be conan extension for vs code.

https://insights.stackoverflow.com/survey/2019#technology-_-most-popular-development-environments

@KaungZawHtet, @jsgogo Maybe it's a bit late to reply this thread, but I created the conan extension for VS code, and just published it a couple days ago. Maybe you can check out my extension :) I hope it could be really helpful for the community :) Here is the link to my extension https://github.com/afri-bit/vsconan

Originally posted by @afri-bit in https://github.com/conan-io/wishlist/issues/226#issuecomment-1107853636

memsharded commented 2 years ago

Hi @afri-bit

I am creating a new issue here in the main Conan repo, because the wishlist is mainly for packages, and is almost abandoned in favor of the main conan-center-index repo.

Indeed an extension for VScode is interesting, and we have been wanting to do something for it for a while. At the moment we are prioritizing getting 2.0 out, but after 2.0 we will resume work on IDE plugins and extensions. We will continue the conversation here when it is time, so thanks very much for doing this and sharing it!

afri-bit commented 2 years ago

Hi @memsharded,

thanks for creating a new issue for this topic.

Looking forward to Conan 2.0 :) I hope the CLI API will not change so much at the end, so my extension can be reused, since it just uses CLI mainly for this purpose.

Other than that, always happy to help :)

memsharded commented 2 years ago

I hope the CLI API will not change so much at the end, so my extension can be reused, since it just uses CLI mainly for this purpose.

Unfortunately it will change substantially, the Conan 1.X cli accumulated some bad UX, so it was time for a clean up. But conan install <path> -pr=myprofile remains, it depends on how many things you use. But don't worry now, we will figure it out when it comes.

tbsuht commented 3 months ago

Indeed an extension for VScode is interesting, and we have been wanting to do something for it for a while.

Push. This would be great!

See also: https://github.com/conan-io/conan/issues/7374

jcar87 commented 3 months ago

Indeed an extension for VScode is interesting, and we have been wanting to do something for it for a while.

Push. This would be great!

See also: #7374

Hi @tbsuht - in the meantime, if your project uses CMake and already has a conanfile (txt or py), you may want to look into https://github.com/conan-io/cmake-conan - Using VSCode's CMake tools extension, all you would need to do is edit the presets to define CMAKE_PROJECT_TOP_LEVEL_INCLUDES to point to [path-to-cmake-conan]/conan_provider.cmake - this can be persisted in CMakePresets.json or CMakeUserPresets.json at the root of your project. This should cause CMake to invoke Conan while it configures - negating the need to call Conan beforehand (although it has some limitations, please see that project's readme).

tbsuht commented 3 months ago

Hi @jcar87

We're already using CMake-Conan and hitting the limitations there. In our case it's information from the cpp_info (builddirs) of an internal package made available via CMakeToolchain generator which can't be used when building.

Is there any plan for a plugin? Can't find something in the milestone section.

memsharded commented 3 months ago

I think the experience with VSCode with the cmake-tools installed using presets is quite good. Yes, it requires doing conan install in the terminal, but the presets are automatically loaded and can be used from VSCode, so the effort is smaller than other IDEs.

At the moment a VSCode plugin is not planned.

tbsuht commented 2 months ago

@memsharded Sure, the integration into VS Code is good. The problem is that the CMakeToolchain generator is not supported, to my knowledge. And this limitation is easily reachable imo, see the example above.

memsharded commented 2 months ago

Sure, the integration into VS Code is good. The problem is that the CMakeToolchain generator is not supported, to my knowledge. And this limitation is easily reachable imo, see the example above.

Yes, the CMakeToolchain is supported, and it is the one that generates the presets and toolchain for the integration to work. I am referring to the flow using conan install . + VSCode cmake-tools integration opening the presets generated by Conan, this works quite well, with the CMakeToolchain. The only thing is that user should type conan install ..

tbsuht commented 2 months ago

Ok, I wasn't precise enough. :)

I was talking about the one-click-to-build solution without using conan install.

jcar87 commented 2 months ago

Hi @jcar87

We're already using CMake-Conan and hitting the limitations there. In our case it's information from the cpp_info (builddirs) of an internal package made available via CMakeToolchain generator which can't be used when building.

Is there any plan for a plugin? Can't find something in the milestone section.

Hi @tbsuht - if you could open an issue with more details in the cmake-conan repository we may be able to advise further, if anything so that we can have a better view of what is missing feature-wise :)