vscode中CTRL+鼠標(biāo)左鍵函數(shù)不跳轉(zhuǎn)

vscode中CTRL+鼠標(biāo)左鍵函數(shù)不跳轉(zhuǎn)

問題引出:

最近使用vscode的時候?F12快捷鍵時好時壞,Ctrl+鼠標(biāo)左鍵有時候也不好使,總是跳轉(zhuǎn)不過去。按住Ctrl鍵,鼠標(biāo)懸停在某個函數(shù)名上方,無提示,且無法跳轉(zhuǎn):

vscode中CTRL+鼠標(biāo)左鍵函數(shù)不跳轉(zhuǎn)

解決方法:

1、打開VsCode: 文件 -> 將工作區(qū)另存為,將文件夾添加到工作區(qū)。

2.按快捷鍵Ctrl+P,之后點(diǎn)擊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” 就會造成無法跳轉(zhuǎn),最后只能改成:

{ ????"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都完美跳轉(zhuǎn),解決問題。

相關(guān)文章教程推薦:vscode教程

以上就是

? 版權(quán)聲明
THE END
喜歡就支持一下吧
點(diǎn)贊6 分享