microsoft / vscode-cmake-tools

CMake integration in Visual Studio Code
https://marketplace.visualstudio.com/items?itemName=vector-of-bool.cmake-tools
MIT License
1.48k stars 456 forks source link

[Flaky]Duplicate information appeared in output when Add CMakePreset.json #3873

Open PhoebeTf opened 4 months ago

PhoebeTf commented 4 months ago

Brief Issue Summary

Environment: VSCode 1.90.1+ CMake Tools v1.19.13(pre-release)

More info:

Repro steps:

  1. Open VScode
  2. Create a new folder named 'Test' and open it with vscode.
  3. Create a file named CMakeLists.txt under test with the following content:
    cmake_minimum_required (VERSION 3.8) 
    project ("test") 
    add_executable (test "test.cpp" ) 
  4. Create a file named test.cpp under test with the following content:
    #include <iostream> 
    int main(int argc, char **argv) 
    { 
    std::cout << "Hello World" << std::endl; 
    return 0; 
    } 
  5. Create "CMakePresets.json" file and copy the following code into the file, then save it
    {
    "version": 3,
    "configurePresets": [
    {
    "name": "windows-base",
    "hidden": true,
    "generator": "Ninja",
    "binaryDir": "${sourceDir}/out/build/${presetName}",
    "installDir": "${sourceDir}/out/install/${presetName}",
    "cacheVariables": {
    "CMAKE_C_COMPILER": "cl.exe",
    "CMAKE_CXX_COMPILER": "cl.exe"
    },
    "condition": {
    "type": "equals",
    "lhs": "${hostSystemName}",
    "rhs": "Windows"
    }
    }
    ]
    }
  6. Launch output window and navigate to "CMake/Build" category
  7. Check the output info

Expected result: Without duplicate output info

Actual result: Duplicate output info appeared Dup_output

Whole process: CMakeTools_DupOutput

CMake Tools Diagnostics

No response

Debug Log

No response

Additional Information

No response