简体   繁体   English

Visual Studio 代码中的错误或设置不正确?

[英]Bug or incorrect setting in the Visual Studio Code?

这个问题

In an HTML file, when I position the cursor at the beginning of element (example <div> ), VS CODE select the closing tag correctly ( </div> ). In an HTML file, when I position the cursor at the beginning of element (example <div> ), VS CODE select the closing tag correctly ( </div> ).

On the other hand, if I create a PHP file containing HTML this does not happen.另一方面,如果我创建一个包含 HTML 的 PHP 文件,则不会发生这种情况。 If I position myself at the beginning of a tag (example <div> ), VS CODE selects all the div tags for me, of any piece of code, making it impossible for me to understand where the tag ( </div> ) closes.如果我自己在标签的开头 position(例如<div> ),VS CODE 会为我选择所有 div 标签,任何一段代码,使我无法理解标签( </div> )的关闭位置.

This also happens with other elements or attributes, such as: class, section, id, p etc. As if it found all the characters identical to the ones I selected with the cursor.其他元素或属性也会发生这种情况,例如:class、section、id、p 等。好像它发现所有字符都与我用 cursor 选择的字符相同。

The extensions I have are the following:我拥有的扩展如下:

Autoprefixer自动前缀
HTML Snippets HTML 片段
Live Server直播服务器
Path Intellisense路径智能感知
PHP IntelliSense PHP IntelliSense
Visual Studio IntelliCode Visual Studio 智能代码
CodeSnap代码快照
Polacode波拉码

How can I solve?我该如何解决? Thanks in advance.提前致谢。

You can install an extension for that.您可以为此安装扩展程序。 Go to extension and search "Highlight Matching Tag" and install it. Go 扩展并搜索“突出显示匹配标签”并安装它。 It will underline the closing/opening tag for the tag that you choose.它将在您选择的标签的结束/开始标签下划线。 This seems to have already been solved in this post.这似乎已经在这篇文章中解决了。

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

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