Open WittonBell opened 11 months ago
Hi @WittonBell thanks for creating this issue. We'll add it to the backlog and investigate it as soon as we have the capacity!
@WittonBell I just followed your repro steps and I was able to press F12 and jump to the define, could you confirm that this issue no longer reproduces?
I've marked this as completed but will wait for confirmation from you before fully closing the issue. Thanks!
@gcampbell-msft It's still exist this issue. Please see the gif:
Thanks.
This issue is now marked as 'stale' due to there being no activity on it for the past 30 days and being labelled 'more info needed'. Unless the 'stale' label is removed or the issue is commented on, this will be closed in 7 days. If you would like to make this issue exempt from getting stale, please remove the 'more info needed' and 'stale' labels or add the 'stale-exempt' label
This issue is now closed due to there being no activity on it for the past 7 days since being marked as 'stale'.
@gcampbell-msft @snehara99 this issue is still exist!
env:
OS: win10 22H2
MinGW clang 17.0.6
MinGW gcc 13.2.0
vscode version: 1.85.2
cmake version: 3.28.1
c/c++
plugin version 1.18.5
cmake tools
plugin version: v1.16.32
@WittonBell Thanks for pinging, looking again at your gif, it seems like the CMake extension is providing intellisense. Could you set the C_Cpp.default.configurationProvider setting in VS Code to ms-vscode.cmake-tools
?
Please let us know if this fixes your issue!
@gcampbell-msft I use the following c_cpp_properties.json
configuration:
{
"configurations": [
{
"name": "MinGW",
"includePath": [
"${workspaceFolder}/**"
],
"defines": [
"_DEBUG",
"UNICODE",
"_UNICODE",
"_WIN32"
],
"windowsSdkVersion": "10.0.22621.0",
"compilerPath": "G:/msys64/mingw64/bin/clang++.exe",
"cStandard": "c17",
"cppStandard": "c++17",
"intelliSenseMode": "windows-clang-x64",
"configurationProvider": "ms-vscode.cmake-tools"
}
],
"version": 4
}
It cannot fix this issue. And I try to use "intelliSenseMode": "clang-x64"
, also exist this issue.
Thanks!
@WittonBell Is there a reason you can't use the CMake Tools extension to provide IntelliSense?
@WittonBell Is there a reason you can't use the CMake Tools extension to provide IntelliSense?
@gcampbell-msft Is there a log to know which configurationProvider
it is using? It should be using CMake Tools extension
, because I change main.c
to main.cpp
, it work normally. Have you reproduced this issue?
@WittonBell You can set the configuration provider by modifying the setting C_Cpp.default.configurationProvider
, in the VS Code settings.
@gcampbell-msft I use the configuration in settings.json
of VSCode:
"C_Cpp.default.configurationProvider": "ms-vscode.cmake-tools",
"C_Cpp.default.intelliSenseMode": "clang-x64",
also exist this issue. Need you to check and fix it. Thanks!
Got it. With this in mind, I'll re-open the issue. Thanks!
Intellisense breaks for me too. It doesn't suggest any variable (even in the same function) anymore.
Except that it's broken in C++ (cpp) files, and partially works in C.
C++ example: https://github.com/microsoft/vscode-cmake-tools/assets/57674559/a9f34a7a-3959-4a33-9f17-0472e8769655
C example: https://github.com/microsoft/vscode-cmake-tools/assets/57674559/d93bf4c4-63ed-4af2-8abe-6fe64519ce82
@WittonBell We are currently trying to reproduce your issue, but we are experiencing the following problem. May I ask what is the value of your Preset setting?
@Yingzi1234 我提的issue中复现步骤有详细说明,第5步中提到选择clang Debug
,简单来说,这个问题就是在使用Clang编译器时,CMake创建的C项目,智能提示不能正常工作。
另外,我看你发的GIF中的问题,应该是没有让VSCode使用预设配置吧?可以看看VSCode的设置。
@WittonBell According to the information you provided, we only reproduced this issue once and we can't reproduce this issue anymore, we put the details below, could you confirm the reproduction steps for us? Thank you!
Repro steps:
Expected result: It should jump to the definition
Actual result: It doesn't jump to definitions. And when I rename ‘main.c’ to ‘main.cpp’ and then rename it to ‘main.c’ this issue no longer reproduces.
@Yingzi1234 明显你这个跳转是有问题的,使用MinGW,不应该跳转到MS的SDK中去。你可以仔细看一下我前面给出的信息,还可以看一下我前面给出的GIF
Brief Issue Summary
env: VSCode: 1.84.2 C/C++: v1.18.5 cmake tools: v1.16.31 gcc: 13.2.0 clang: 17.0.4
reproduce step:
create any cmake project with c language.
create
main.c
:create
CMakeLists.txt
:create
CMakePresets.json
:select preset
clang Debug
, and buildpress F12 on function
SetConsoleOutputCP
, can not jump to define.if rename
main.c
tomain.cpp
or select presetgcc Debug
, the IntelliSense work fine.CMake Tools Diagnostics
No response
Debug Log
No response
Additional Information
No response