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

Scan-for-kits duplicates entries for updated kits

Open Nahor opened this issue 2 years ago • 3 comments

Brief Issue Summary

When a compiler/kit is updated and running "Scan for kits", CMake tools will show both the old and new version of the kit.

Here is an example showing duplicates for MSVC and for MingW kits

CMake Tools Diagnostics

{
  "os": "win32",
  "vscodeVersion": "1.67.2",
  "cmtVersion": "1.10.5",
  "configurations": [
    {
      "folder": "<removed>,
      "cmakeVersion": "3.23.1",
      "configured": false,
      "generator": "Ninja Multi-Config",
      "usesPresets": false,
      "compilers": {}
    }
  ],
  "cpptoolsIntegration": {
    "isReady": false,
    "hasCodeModel": false,
    "activeBuildType": "",
    "buildTypesSeen": [],
    "requests": [],
    "responses": [],
    "partialMatches": [],
    "targetCount": 0,
    "executablesCount": 0,
    "librariesCount": 0,
    "targets": []
  },
  "settings": [
    {
      "communicationMode": "automatic",
      "useCMakePresets": "auto",
      "configureOnOpen": true
    }
  ]
}

Debug Log

No response

Additional Information

No response

Nahor avatar May 25 '22 17:05 Nahor

Thank you for the feature suggestion. We may not get to this immediately, but would accept a PR from the community if someone can get to this before us.

bobbrow avatar May 27 '22 16:05 bobbrow

Sometimes CMake tools asks to remove missing kits. It's not quite clear when this happens. Is there an action to "Clean up" the kits? If no maybe adding such an action could be part of the solution?

Zingam avatar Jun 11 '22 11:06 Zingam

We ask to remove missing kits when we detect that the compiler binaries no longer exist.

We don't currently have an action to clean up the Kits. The workaround is to run the 'Edit User-local CMake Kits" command, replace the file contents with [] and then scan for kits again. This issue is asking for us to detect the duplicates when scanning for updates and do the clean up at that point in time instead of adding a new command for it.

bobbrow avatar Jun 13 '22 22:06 bobbrow