0

This problem

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

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.

The extensions I have are the following:

Autoprefixer
HTML Snippets
Live Server
Path Intellisense
PHP IntelliSense
Visual Studio IntelliCode
CodeSnap
Polacode

How can I solve? Thanks in advance.

rioV8
  • 24,506
  • 3
  • 32
  • 49
Insomnia
  • 5
  • 4
  • VSC does NOT select them - it just decorates them with a different background color. If you type the other tags/end tag is not modified (there is a setting that modifies the close tag name when you edit the open tag), see in lower right on status bar that you don't have multi cursor active, you see just the lineNr and charPos not `n selections` – rioV8 Mar 25 '21 at 04:04
  • As I said this problem with .html files does not arise, why does it happen with all other extensions files, such as .php? – Insomnia Mar 25 '21 at 11:34
  • just select text and see the difference in decoration, if you want to get rid of some decorations look in the settings for `editor` – rioV8 Mar 25 '21 at 13:38

1 Answers1

0

You can install an extension for that. Go to extension and search "Highlight Matching Tag" and install it. It will underline the closing/opening tag for the tag that you choose. This seems to have already been solved in this post.

Yong
  • 1,622
  • 1
  • 4
  • 29
  • I added a picture of the problem..maybe it can help. The extension you suggested is fine, but the annoyance remains that everything is selected (as in the image). – Insomnia Mar 25 '21 at 11:42
  • @Insomnia, checkout the link I've included in the answer, this seems to have already been solved. – Yong Mar 26 '21 at 01:15