Skip to main content
Explorer II
November 5, 2025
Question

I'm not used to the automatic code completion feature at present

  • November 5, 2025
  • 1 reply
  • 147 views

I'm not used to the automatic code completion feature at present. For example, the "for" code block is written as "for (init-statement; condition; inc-expression) {}". Could it be modified to have the code block written as "for (int i=0; i<size; i++) {}"? This would be much more convenient. Do you have such a configuration?

    This topic has been closed for replies.

    1 reply

    Technical Moderator
    November 5, 2025

    Hi @t_j_l 

    Thanks for the feedback we will try to add such snippet automatically in our extension, otherwise to have this in the code auto completion you have to add a snippet, please follow these steps: 

    1- open command palette by CTRL+shift+P

    2- search for menu "snippets: configure snippets" and name your snippet file

    3- add this snippet (you can change the prefix and description as you want

     

        "C for loop": {
            "scope": "c,cpp",
            "prefix": "fori",
            "body": [
                "for (int i = 0; i < ${1:size}; i++) {",
                "    $0",
                "}"
            ],
            "description": "C-style for loop: for (int i=0; i<size; i++) {}"
        }
     
    4- reload VSCode to have your snippet functional