VS Code php tag autocomplete

后端 未结 7 2232
刺人心
刺人心 2020-12-23 11:47

kind of trivial question but here it goes. I can\'t figure out why VS Code autocompletes (with tab) all html tags correctly while php tag not. When i type \"php\" and hit t

7条回答
  •  独厮守ぢ
    2020-12-23 12:23

    Under File > Preferences there is User Snippets, use html for adding php snippets.

    {
      "Snippet name": {
      "prefix": ["keywords", "for", "finding"],
      "body": [
        ""
      ],
      "description": "A php tag."
      }
    }
    

    $1, $2 etc. are variables that will be on focus when snippet is entered. You can also use placeholder as presented in my example.

    For multiline body, end current line with comma and add content at new line in " ". You can find more information about creating own snippets in VS Code here:

    https://code.visualstudio.com/docs/editor/userdefinedsnippets

提交回复
热议问题