franneck94 / Vscode-C-Cpp-Runner

🚀 Compile, run and debug single or multiple C/C++ files with ease. 🚀
MIT License
53 stars 14 forks source link

Cannot "Select folder" #163

Closed Mario-75 closed 2 weeks ago

Mario-75 commented 2 weeks ago

I’m using VSC Version 1.94.1 on a Windows 10 computer. I have installed the C/C++ Runner Version 9.4.9. In VSC I have a workspace, and I opened two folders with C project and C++ project. The project are more a testing project, nothing serios. The two projects compile and run fine when they are the only open folder. When I have both folders open at the same time I cannot select the folder from the C/C++ Runner line on the bottom. Nothing happens when I click on the item. Screenshot 2024-10-08 203000 If I use Command Palette and use “C/C++ Runner: Select Folder” I get the attached error message. Screenshot 2024-10-08 202900

I may misunderstand the concept of using the Runner, but I thought is to switch between folders/projects easily! Maybe I’m wrong. I removed and re-installed the Runner already but I cannot see the problem.

Thanks for any input and help. Mario

franneck94 commented 2 weeks ago

Is it really two folders inside of a root folder, or is it two seperate workspaces that you have opened? If you dont know what i mean, just post a screenshot of the full vscode window, i will see it there

Mario-75 commented 2 weeks ago

It is one Workspace for me! Screenshot VSC I did some more test: If I close the VSC Workspace and close the Editor (under the File Menu). Now I press "add folder to Workspace" (like first project. This works I can compile and run/debug. Now I say again "add folder to Workspace" and I have the second project open. I can select which folder to use for compile, run, debug. Screenshot VSC_2 If I now press "save workspace as" and give it a name, the bar on the bottom disappears and if I press this bug-run button on the top right the bar on the bottom comes back but the Select Folder is broken. Same happens if I just close the VSC and reopen so it comes back with last used files. But this last procedure with add folder to workspace does not always work. Sometimes the runner bar on the bottom disappears right away when I open the next folder. Again, I'm sorry if I misunderstood the concept and just do stupid things.

franneck94 commented 2 weeks ago

Yes, it is intended that in a multi-root workspace use-case, the extension does not work. Due to issues with the Vscode API

Mario-75 commented 2 weeks ago

What does "multi-root workspace use-case" mean? When is a folder a multi-root workspace when there is a .vscode folder? I picked one of the folders from before (Test01) and I created 3 new folders under Test02. Now I made new .c .cpp files inside that new folder. I now can pick the folder from the runner bar on the bottom and compile, run those new created files. This is actually what I wanted. Thanks for your very quick reply.

franneck94 commented 2 weeks ago

"Now I say again "add folder to Workspace" and I have the second project open. I can select which folder to use for compile, run, debug. Screenshot VSC_2 If I now press "save workspace as" and give it a name, the bar on the bottom disappears and if I press this bug-run button on the top right the bar on the bottom comes back but the Select Folder is broken."

Exactly this is multi root workspace. Just everything else than just opening a folder.