Home > Development Tools > VSCode > body text

How to configure C/C++ code automatic completion in VSCode [detailed graphic explanation]

青灯夜游
Release: 2022-12-12 20:21:30
forward
8503 people have browsed it

VSCodeHow to configure C/C code automatic completion? The following article will introduce to you the method of automatically completing C/C code in VSCode. I hope it will be helpful to you!

How to configure C/C++ code automatic completion in VSCode [detailed graphic explanation]

【Recommended learning: vscode tutorial, Programming teaching

##About VSCode's C/C code automatic completion

Step one:Need to download the C/C plug-in in VsCode

Picture:

# After downloading the plug-in, it is best to restart VS.

Step 2: Find the settings

Enter in the input box: editor-->Under "Text Editor" "Suggestions"-->Editor>Quick Suggestions. Set the values ​​of the three items according to your own needs, and then click "Open Settings (json)" in the upper right corner to jump to this interface.

First check whether "C_Cpp.intelliSenseEngine" is Default. If it is Disable, be sure to change it, otherwise an error prompt box will pop up in the lower left corner, prompting: "C_Cpp.intelliSenseEngine" is Disable, and there is no way to prompt

The code is as follows:

"C_Cpp.intelliSenseEngine": "Default"
Copy after login

The third step: Add part of the code to call the automatic completion function. You can combine it with some of the codes that your system already has. The code is as follows:

    "C_Cpp.autocomplete": "Default",
    "[cpp]": {
        "editor.quickSuggestions": {
            "comments": "on",
            "strings": "on",
            "other": "on"
        }
    },
    "[c]": {
        "editor.quickSuggestions": {
            "comments": "on",
            "strings": "on",
            "other": "on"
        }
    },
    "editor.quickSuggestions": {
        "comments": "on",
        "strings": "on"
    },
    "C_Cpp.codeAnalysis.exclude": {
   
    },
    "settingsSync.ignoredExtensions": [
Copy after login

Step 4:Restart VS, create a test.c, test it to see if the auto-complete function can work, the effect is as follows:

Run successfully!

You can try it yourself. Everyone’s computer usage habits are different, so some settings of everyone’s computer software are different. In fact, you can follow the system prompts and make targeted breakthroughs one by one based on the problem. That’s it! The more problems you encounter, the greater your gains will be, and you will have corresponding solutions in your mind. I have always believed that, as for computers, it is impossible to find a solution without lighting your hair.

I wish everyone the best!

For more knowledge about VSCode, please visit:

vscode Basic Tutorial!

The above is the detailed content of How to configure C/C++ code automatic completion in VSCode [detailed graphic explanation]. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:csdn.net
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!