简体   繁体   English

PhpStorm 5中的Modyfing代码完成

[英]Modyfing code completion in PhpStorm 5

After entering first characters of <textarea> tag and using autocomplete ( eg <texta and hitting ENTER) editor generates following snippet: <textarea rows="" cols="" 输入<textarea>标签的第一个字符并使用自动完成功能(例如<texta并点击ENTER)后,编辑器会生成以下代码段: <textarea rows="" cols=""

It's extremely unhelpful since I don't use rows and cols attributes. 由于我不使用rows和cols属性,所以它非常无用。

How can I modify those snippets ? 我该如何修改这些片段? I tried "Live templates" section but it's not there. 我尝试了“实时模板”部分,但它并不存在。

In this case code completion is performed according to the DTD, which defines rows and cols attributes of the textarea tag as Required . 在这种情况下,代码完成是根据DTD执行的,DTD将textarea标记的rowscols属性定义为Required

Most likely your file starts with: 您的文件最有可能的开头是:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
        "http://www.w3.org/TR/html4/loose.dtd">

or the default HTML language level defines it. 或默认的HTML语言级别定义它。

To address this problem you can create HTML 5 files with <!DOCTYPE html> and PhpStorm will stop completing these attributes. 要解决此问题,您可以使用<!DOCTYPE html>创建HTML 5文件,PhpStorm将停止完成这些属性。

See also the related IDE setting: 另请参阅相关的IDE设置:

在此输入图像描述

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM