pixi icon indicating copy to clipboard operation
pixi copied to clipboard

Integration of pixi with vscode for C++ projects

Open traversaro opened this issue 1 year ago • 5 comments

Problem description

It would be great for pixi ecosystem to have support to easily open in Visual Studio Code and have integration out of the box with pixi projects that build C++ code.

See:

  • https://github.com/prefix-dev/pixi/discussions/415#discussioncomment-9367581
  • https://github.com/ami-iit/ami-commons/issues/22

traversaro avatar Jul 05 '24 13:07 traversaro

I have seen this mentioned a few times on discord. But I think the best approach would be something similar to the micromamba vscode extension where the environment is loaded globally to the IDE. This gives all extensions access to the virtual environment.

In my opinion, this Is a must when you have multi-language project.

jfchenier avatar Jul 05 '24 13:07 jfchenier

I wonder if changing the VSCode CMake extension (for example) would be worth it - for example here: https://github.com/microsoft/vscode-cmake-tools/blob/7b621f45ca9ab4df486f9ea3bcc5439034cea7a9/src/paths.ts#L251

However, if all extensions would be aware of the "pixi"-PATH then the CMake extension should work OOTB.

wolfv avatar Jul 05 '24 13:07 wolfv

I am afraid that just setting the CMake path to the pixi's cmake is not enough. If the PATH is not modified to contain the environment executables or if CXX/CC env variables are not properly exported, CMake would not pick the pixi's compilers in place of the system ones.

traversaro avatar Jul 05 '24 13:07 traversaro

I see that the vscode CMake extension has the concept of KitsController, similar to the locator of the python extension. Maybe that is the way to go?

sdebionne avatar Jul 09 '24 19:07 sdebionne

Hi, if I open a pixi shell and start vscode from there, will everything just work as expected with the pixi environment?

mnesarco avatar Apr 15 '25 18:04 mnesarco