VScode CTRL+left mouse button jump problem F12 cannot find the definition

VScode CTRL+left mouse button jump problem F12 cannot find the definition


The key is to remember in addition to setting c_cpp_properties, join the workspace

When I used VScode recently, the F12 shortcut key went up and down, and Ctrl+left mouse button sometimes didn't work well, and I couldn't jump past it. . .

Hold down the Ctrl key and hover the mouse over a function name:

No prompt, and unable to jump:

img

Baidu will solve this problem,

1. Open VsCode: File -> Save Workspace As, and add the folder to the workspace.

2. Press the shortcut key Ctrl+P, then click Edit configurations, open the c_cpp_properties.json file, and check the "includePath" field. .

Such as:

{
    "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
}

If I add another path "C:/Keil_v5/ARM/ARMCC/include" on my side, it will not be able to jump. Finally, I can only change it to:

{
    "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+left key and F12 all jump perfectly to solve the problem. . .

img

Guess you like

Origin blog.csdn.net/ahelloyou/article/details/115118267