VS Code php tag autocomplete

后端 未结 7 2255
刺人心
刺人心 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:08

    I prefer a custom keyboard shortcut added to keybindings.json - this lets you add php tags in places where intellisense doesn't work properly, like inside the quotes of html attributes. You can also select some text (maybe you copied some php from elsewhere without the full php tags) and automatically wrap it in php tags. Here is what I use:

    {
      "key": "cmd+alt+ctrl+p",
      "command": "editor.action.insertSnippet",
      "when": "editorTextFocus",
      "args": {
        "snippet": ""
      }
    }
    

提交回复
热议问题