Skip to content
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

Fix 3232 #4223

Open
wants to merge 13 commits into
base: main
Choose a base branch
from
Open

Fix 3232 #4223

wants to merge 13 commits into from

Conversation

hippo91
Copy link
Contributor

@hippo91 hippo91 commented Jan 3, 2025

This change addresses item #3232

This changes visible behavior

The following changes are proposed:

  • Two methods are added to the ExtensionManager class (getAllCMakeProjects, getProjectForFolder). They are just delegations to the projectController object.
  • The findBuildTask method of the CMakeTaskProvider is expecting a workspace folder (under string form) as first argument. Its call site in the cmakeDriver.ts file is updated accordingly
  • The provideTasks method of the CMakeTaskProvider does not deal with the active project anymore but loop over all the CMake projects of the workspace to build the task list.
  • Accordingly, the provideTask method of the CMakeTaskProvider is expecting a workspace folder as 2nd argument so that the scope of each task is the given workspace folder. This folder is also used to specialize the task definition label in order for the definition to be unique for each task (even for the same task type of two different workspace folders). Last but not least, the workspace folder is also passed to the constructor of the CustomBuildTaskTerminal
  • The CustomBuildTaskTerminal does not rely only on the activeProject anymore. Instead, if a workspaceFolder member is defined, then the getProject method (formerly getActiveProject method) return the project associated to the workspace folder.

At first sight solving #3232 should have been as easy as looping over each CMake project of the workspace to build the list of available tasks (in the provideTasks method). But as lot of pieces of the CMakeTaskProvider and CustomBuildTaskTerminal were relying on working on the active project, i had no other choice that modifying them so that they could work on any project the workspace folder is given.

Other Notes/Information

Please tell me if it is possible to add tests for task selection. I will be pleased to implement them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant