本文摘自PHP中文网,作者V,侵删。

问题引出:
最近使用VScode的时候 F12快捷键时好时坏,Ctrl+鼠标左键有时候也不好使,总是跳转不过去。按住Ctrl键,鼠标悬停在某个函数名上方,无提示,且无法跳转:

解决方法:
1、打开VsCode: 文件 -> 将工作区另存为,将文件夹添加到工作区。
2.按快捷键Ctrl+P,之后点击Edit configurations,打开c_cpp_properties.json文件,检查 "includePath" 字段。
如:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | {
"configurations" : [
{
"name" : "Win32" ,
"includePath" : [
"${workspaceFolder}/**" ,
"C:/Keil_v5/ARM/ARMCC/include"
],
"defines" : [
"_DEBUG" ,
"UNICODE" ,
"_UNICODE"
],
"compilerPath" : "C:\\\\Program Files\\\\LLVM\\\\bin\\\\clang.exe" ,
"cStandard" : "c11" ,
"cppStandard" : "c++17" ,
"intelliSenseMode" : "clang-x64"
}
],
"version" : 4
}
|
我这边如果添加了其它路径 "C:/Keil_v5/ARM/ARMCC/include" 就会造成无法跳转,最后只能改成:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | {
"configurations" : [
{
"name" : "Win32" ,
"includePath" : [
"${workspaceFolder}/**"
],
"defines" : [
"_DEBUG" ,
"UNICODE" ,
"_UNICODE"
],
"compilerPath" : "C:\\\\Program Files\\\\LLVM\\\\bin\\\\clang.exe" ,
"cStandard" : "c11" ,
"cppStandard" : "c++17" ,
"intelliSenseMode" : "clang-x64"
}
],
"version" : 4
}
|
Ctrl+左键,F12都完美跳转,解决问题。
相关文章教程推荐:vscode教程
以上就是vscode中CTRL+鼠标左键函数不跳转的详细内容,更多文章请关注木庄网络博客!
相关阅读 >>
vsCode怎么使用相对路径
vsCode底部状态栏不显示
ubuntu如何卸载vsCode
vsCode快捷方式添加到鼠标右键工具栏中
vsCode怎么美化代码
vsCode和dw的区别
vsCode怎么设置快捷键
vsCode如何关闭eslint的语法检查
vsCode怎么显示左侧图标
vsCode光标不跟随怎么办
更多相关阅读请进入《vsCode》频道 >>
转载请注明出处:木庄网络博客 » vscode中CTRL+鼠标左键函数不跳转