Cyrill
Cyrill

Reputation: 166

VScode "linkedEditing" not working for php files

I want to be able to easily edit HTML tags together. There is a built-in option for this in Visual Studio Code.

enter image description here

It works fine for HTML files. Buy why not for php files? Does anybody know a work-around?

For example, let's say I wanted to change this div into a section. It should automatically select both opening tag and the closing tag.

enter image description here

Upvotes: 2

Views: 2251

Answers (2)

Delta
Delta

Reputation: 980

For now VS Code doesn't handle PHP with editor.linkedEditing.

But you can install Auto Tag Rename extension which will work for PHP files as well.

The extension will ignore certain file types if editor.linkedEditing = true, so you can install it without any conflicts.

Upvotes: 1

MattJamison
MattJamison

Reputation: 339

Assuming you have html inside a PHP file. The simplest solution would be:

  1. double click the element to edit
  2. Holding control key double click the closing element ( open and close elements should be highlighted now)
  3. type to edit the element

Upvotes: 1

Related Questions