VS Code php标签自动完成 [英] VS Code php tag autocomplete

查看:400
本文介绍了VS Code php标签自动完成的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

些琐碎的问题,但事情就到此为止.我不知道为什么VS Code自动正确完成(带有选项卡)所有html标记,而php标记不正确.当我输入"php"并点击选项卡时,它将创建以下内容:

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 tab, it creates this:

<php></php>

这是没有用的,我不知道为什么它在那里.我希望它做普通的php标记

which is useless and i have no idea why it's there. I want it to do normal php tag

<?php ?>

由于建议分散了我的注意力,我已将其关闭.还是要编辑默认/顶部的标签自动完成"项目?

I have turned off suggestions as they were distracting me. Anyway to edit default/top "tab autocomplete" item?

推荐答案

此技巧对我有用:转到首选项:打开用户代码段",然后将此代码段粘贴到html(是html)用户代码段中:

this hack worked for me: go to 'Preferences: Open User Snippets', and paste this snippet into the html (yes, that's html) user snippets:

"php": {
    "prefix": "php",
    "body": [
        "<?php $1 ?>"
    ],
    "description": "php tag"
}

这篇关于VS Code php标签自动完成的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆