在phpstorm(和其他喷气桥IDE)中,在输入HTML时,在您输入时编辑两个HTML标签时有一个不错的选择,因此它们始终是同步的:
return '<buttond class="btn"> hello </buttond>'
它是由设置管理的: syultanate&lt; ;/tag&gt; phpstorm中的编辑。
我想知道引号是否有类似的内容,甚至符号()
, {}
和 []
,以便最接近的报价也将修改标记,以避免这样的内容:
return "<button class="btn"> hello </button>'
我知道这会导致语法错误,因为如果您更改符号,则会更改内部内容的结构,但是如果IDE可以告诉引号何时结束,是否可以执行这也是吗?
In PhpStorm (and other JetBrains IDEs), there is a nice option when typing HTML to edit both HTML tags as you type, so that they are always in sync:
return '<buttond class="btn"> hello </buttond>'
It is managed by the setting: Simultaneous <tag></tag> editing in PhpStorm.
I was wondering if there was something similar for quotation marks, and even symbols like ()
, {}
and []
so that the closest quotation mark would also be modified, to avoid stuff like this:
return "<button class="btn"> hello </button>'
I understand that this would cause syntax errors, since if you change the symbol you change the inner content's structure, but if the IDE can tell when a quotation ends, is it possible to do this as well?
发布评论
评论(1)
为什么? 如果是php ,只需在Windows上使用“意图/快速修复”菜单中的适当快速修复操作( alt + Enter 在此处或在灯泡图标上使用鼠标) :
最终结果:
在
设置(MacOS上的首选项)下检查选项|编辑|一般| smart键
这将用于更改引号。
对于支架/支架等,更多的是在打开开场时自动插入关闭。尽管在某些情况下它也将有效: eg在JSON文件中,请更改开口
{
[ [),并且还将替换关闭>}
<代码>] 。Why? If it's PHP then just use the appropriate quick fix action from the Intentions/Quick Fix menu (Alt + Enter here on Windows or by using a mouse on the light bulb icon):
Final result:
Check options under
Settings (Preferences on macOS) | Editor | General | Smart Keys
This will work for quotes changing.
For brackets/braces etc it's more about inserting the closing one automatically when typing the opening one. Although in some contexts it will also work: e.g. in JSON file, change the opening
{
by[
and it will also replace the closing}
to]
.