microsoft / vscode-cpptools

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

Run Task Freezes for some Variable References #10695

Open sean-mcmanus opened 1 year ago

sean-mcmanus commented 1 year ago

Discussed in https://github.com/microsoft/vscode-cpptools/discussions/10686

Originally posted by **shengchao-lin** March 15, 2023 When variable reference is used that relates to the current file, e.g., `${file}`, `${fileBasename}`, etc, the run task freezes. However, a simple echo does not. See the example below. Task "My C++ build" hangs but "echo" does not. When freezing, the terminal tab shows: Screenshot 2023-03-15 at 10 37 47 PM If task "echo" is ran first, launched the terminal tab, and ran successfully, then task "My C++ build" can ran successfully too. Additionally, when the `"${workspaceFolder}/${fileBasename}"` is replaced with something like `"${workspaceFolder}/main.cpp"`, the task "My C++ build" runs successfully. What could be the issue here? ``` "tasks": [ { "type": "cppbuild", "label": "build", "command": "g++", "args": [ "-fdiagnostics-color=always", "-g", "${workspaceFolder}/${fileBasename}", "-o", "${workspaceFolder}/output", "-std=c++20" ], "detail": "compiler: /usr/bin/g++", "group": { "kind": "build", "isDefault": true } }, { "type": "shell", "label": "echo", "command": "echo ${workspaceFolder}/${fileBasename}", } ] ``` Platform: MacOS Ventura 13.2.1 VSCODE: Version: 1.76.2 Commit: ee2b180d582a7f601fa6ecfdad8d9fd269ab1884 Date: 2023-03-14T17:54:09.061Z Electron: 19.1.11 Chromium: 102.0.5005.196 Node.js: 16.14.2 V8: 10.2.154.26-electron.0 OS: Darwin x64 22.3.0 Sandboxed: No Extension used: C/C++
sean-mcmanus commented 1 year ago

Version 1.14.4.