同时引用标记标记编辑在Jetbrains Ides中?

发布于 2025-01-30 17:56:55 字数 489 浏览 6 评论 0 原文

在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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

谜兔 2025-02-06 17:56:55

我知道这会导致语法错误,

为什么? 如果是php ,只需在Windows上使用“意图/快速修复”菜单中的适当快速修复操作( alt + Enter 在此处或在灯泡图标上使用鼠标) :

最终结果:

return "<buttond class=\"btn\"> hello </buttond>";

我想知道引号是否有类似的东西,甚至还有() {} [] 之类的符号最近的引号也将被修改...


设置(MacOS上的首选项)下检查选项|编辑|一般| smart键

”在此处输入图像描述”

这将用于更改引号。

对于支架/支架等,更多的是在打开开场时自动插入关闭。尽管在某些情况下它也将有效: eg在JSON文件中,请更改开口 { [ [),并且还将替换关闭 >} <代码>] 。

I understand that this would cause syntax errors,

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):

enter image description here

Final result:

return "<buttond class=\"btn\"> hello </buttond>";

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...

Check options under Settings (Preferences on macOS) | Editor | General | Smart Keys

enter image description here

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 ].

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文