vscode-cmake-tools icon indicating copy to clipboard operation
vscode-cmake-tools copied to clipboard

Fix Issue #4421 - always clean rebuild

Open RedSkittleFox opened this issue 3 months ago • 4 comments

This change addresses item #4421

This fixes a bug which would always run clean rebuild instead of build

The following changes are proposed:

  • Update the findBuildTask function to properly account for the two existing templates.
  • Properly select the build task instead of clean rebuild task. The cleaning in the CMake: Clean Rebuild command is handled separately and currently is being done twice.

Other Notes/Information

The debugging process with code snippets and screenshots has been documented in the respective issue.

RedSkittleFox avatar Nov 05 '25 23:11 RedSkittleFox

Hi @RedSkittleFox, thank you for working on fixing this bug!

Just wanted to let you know that the CI pipeline is failing due to linting issues in your changes. It may have to do with the spacing in front of the if and also the equality with == as opposed to ===.

Also, I noticed there might be some duplication in the logic. It looks like you have overlapping conditions for handling 2 tasks. The current change shows: First condition handles length === 1 || length === 2. Then immediately after, another condition handles length === 1 || length === 3. Could you clarify and elaborate on the intended logic here?

Once you fix the linting issues, the tests should pass. You can run yarn lint --fix locally to automatically fix some of these issues before pushing!

Thanks again for your contribution! Let me know if you need any help with these changes.

hanniavalera avatar Nov 06 '25 18:11 hanniavalera

Hi @RedSkittleFox, thank you for working on fixing this bug!

Just wanted to let you know that the CI pipeline is failing due to linting issues in your changes. It may have to do with the spacing in front of the if and also the equality with == as opposed to ===.

Also, I noticed there might be some duplication in the logic. It looks like you have overlapping conditions for handling 2 tasks. The current change shows: First condition handles length === 1 || length === 2. Then immediately after, another condition handles length === 1 || length === 3. Could you clarify and elaborate on the intended logic here?

Once you fix the linting issues, the tests should pass. You can run yarn lint --fix locally to automatically fix some of these issues before pushing!

Thanks again for your contribution! Let me know if you need any help with these changes.

Hey, I've fixed the the formatting. The first condition only handles the case 2. The diff is a bit confusing.

RedSkittleFox avatar Nov 07 '25 20:11 RedSkittleFox

Okay, this is embarrassing. Give me a moment, I wrongly assumed that running the vs-code's format command is going to resolve the issue. I need to look into that.

RedSkittleFox avatar Nov 07 '25 20:11 RedSkittleFox

Okay, now I've fixed it and confirmed it with yarn run lint. I've looked into the error and it turns out that the vs-code's formatter fixed my issue but caused another one that wasn't visible in the local diffs. Sorry for the confusion.

RedSkittleFox avatar Nov 07 '25 20:11 RedSkittleFox