1、ctrl+shift+p后找不到C/C++: Edit configurations
安裝或重裝C++插件。
參考鏈接:
搜索C/C++: Edit configurations顯示no matching command問題https://www.cnblogs.com/hunghau/p/17195622.html
2、ROS2 API無法轉到定義
(1)在c_cpp_properties.json文件中添加ROS2頭文件路徑
{"configurations": [{"name": "Linux","includePath": ["${workspaceFolder}/**","/opt/ros/humble/**","${workspaceFolder}/install/base_interfaces/include"],"defines": [],"compilerPath": "/usr/bin/gcc","cStandard": "c17","cppStandard": "gnu++14","intelliSenseMode": "linux-gcc-x64"}],"version": 4
}
?(2)刪除.vscode緩存文件
? ? ? ? 本人遇到該問題是將在原有foxy下開發的工程代碼文件夾拷貝到新的humble版本的ROS2環境后遇到的該問題。在實際操作過程中,刪除該文件夾后問題依然存在,在重新安裝C++插件,完成c_cpp_properties.json的配置后,該問題解決。因此該方法僅作參考。