問題引出:
最近使用vscode的時候?F12快捷鍵時好時壞,Ctrl+鼠標左鍵有時候也不好使,總是跳轉不過去。按住Ctrl鍵,鼠標懸停在某個函數(shù)名上方,無提示,且無法跳轉:
解決方法:
1、打開VsCode: 文件 -> 將工作區(qū)另存為,將文件夾添加到工作區(qū)。
2.按快捷鍵Ctrl+P,之后點擊Edit configurations,打開c_cpp_properties.json文件,檢查 “includePath” 字段。
如:
{ ????"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” 就會造成無法跳轉,最后只能改成:
{ ????"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+左鍵,F(xiàn)12都完美跳轉,解決問題。
相關文章教程推薦:vscode教程
? 版權聲明
文章版權歸作者所有,未經(jīng)允許請勿轉載。
THE END
喜歡就支持一下吧
相關推薦