microsoft / vscode-cpptools

Official repository for the Microsoft C/C++ extension for VS Code.
Other
5.46k stars 1.53k forks source link

"Configure Default Build Task" - Task Generation Only Lists Top-Most Project As Active In Multi-Root Workspace #6804

Open vindicatorr opened 3 years ago

vindicatorr commented 3 years ago

Type: LanguageService

Describe the bug

Steps to reproduce

  1. Create a workspace
  2. Add multiple root workspace projects
  3. Make one of the projects NOT contain a "tasks.json" file, but do NOT make that project the top/first project. (not really necessary, but highlights the issue)
  4. Tasks: Configure Default Build Task
  5. Close the workspace and only open the project WITHOUT a "tasks.json" file.
  6. Tasks: Configure Default Build Task

Expected behavior

I'd expect step 4 to show the project that doesn't have a "tasks.json" file like it does in step 6, as opposed to showing the top root workspace project for task generation (screenshots should make it clear).

Logs ``` N/A (nothing showing relating to the "Configure Default Build Task" when activated) ```

Screenshots

Multi-root incorrect: Screenshot_20210117_000720_multiRoot_highlight It looks to always be the top-most project that gets the "generate" option for tasks. It seems to always consider it the "active file". Even when I open the "app.cpp" for the "firmware" project which already has a "tasks.json" file, it still considers the top Arduino project as the "active file".

Solo project correct: Screenshot_20210117_000823_solo_highlight

Additional context

sean-mcmanus commented 3 years ago

@elahehrashedi Do you remember if this was a known TODO for build tasks? I seem to recall it was.

elahehrashedi commented 3 years ago

This is potentially a Vs Code feature. Follow this issue from here: https://github.com/microsoft/vscode/issues/120133

sean-mcmanus commented 3 years ago

@elahehrashedi Is this fixed with 1.3.0?

elahehrashedi commented 3 years ago

Track this issue on Vs Code side: https://github.com/microsoft/vscode/issues/35312 (also https://github.com/microsoft/vscode/issues/120133 and https://github.com/microsoft/vscode/issues/89448). It will be possibly fixed in their June release.