How to trigger IntelliSense for a restart after cmake configuration from customized task? #3875
-
I'd like to passing args for "CMake: Configure" task, hence I write one in The "CMake: Configure" template task also generates cmake-file-api files ( So I create two tasks in {
"version": "2.0.0",
"tasks": [
{
"label": "Generate cmake-file-api files",
"type": "shell",
"command": "zsh",
"args": [
"-c",
"mkdir -p build/.cmake/api/v1/query/client-vscode && cmake -E capabilities | jq '.fileApi' > build/.cmake/api/v1/query/client-vscode/query.json"
],
"problemMatcher": []
},
{
"label": "cmake-configure",
"type": "shell",
"command": "zsh",
"args": [
"-c",
"cmake -S . -B build -DHELLO_TYPE=HAPPY",
],
"dependsOn":[
"Generate cmake-file-api files"
],
"options": {
"cwd": "${workspaceFolder}"
},
"problemMatcher": [],
},
]
} The task |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 3 replies
-
To reproduce, use these files:
#include <stdio.h>
#include <opencv2/opencv.hpp>
int main(int argc, char** argv)
{
printf("Hello, from hello!\n");
printf("args:");
for (int i=0; i<argc; i++)
{
printf(" %s", argv[i]);
}
printf("\n");
const std::string image_path = "/Users/zz/data/1920x1080.jpg";
cv::Mat image = cv::imread(image_path);
cv::imshow("image", image);
cv::waitKey(0);
return 0;
}
cmake_minimum_required(VERSION 3.5)
project(hello VERSION 0.1.0 LANGUAGES C CXX)
find_package(OpenCV REQUIRED)
add_executable(hello main.cpp)
target_link_libraries(hello PRIVATE ${OpenCV_LIBS})
message(STATUS "HELLO_TYPE: ${HELLO_TYPE}") |
Beta Was this translation helpful? Give feedback.
-
The actual VSCode is: A restart of VSCode window can help resolve that issue, but it is considered "too heavy". |
Beta Was this translation helpful? Give feedback.
-
@zchrissirhcz What about your scenario requires the setup you have, which adds complexity and multiple tasks, rather than simply relying on "CMake: Configure" and the typical flow from the extension. It seems to me from your task set that you're not actually "Configuring" with our extension which is actually what integrates with the Intellisense extension (ms-vscode.cpptools). |
Beta Was this translation helpful? Give feedback.
@zchrissirhcz What about your scenario requires the setup you have, which adds complexity and multiple tasks, rather than simply relying on "CMake: Configure" and the typical flow from the extension. It seems to me from your task set that you're not actually "Configuring" with our extension which is actually what integrates with the Intellisense extension (ms-vscode.cpptools).