Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"HTML mirror cursor" and "F2 to rename tag" won't work with anything but HTML files #87064

Closed
solid-pixel opened this issue Dec 16, 2019 · 6 comments
Assignees
Labels
*as-designed Described behavior is as designed html HTML support issues

Comments

@solid-pixel
Copy link

solid-pixel commented Dec 16, 2019

Hello! :)

I'm working mainly with .tpl Smarty files, and I have the Smarty extension installed for syntax highlighting and language support.

I was really eager to try the new features "HTML mirror cursor" and "F2 to rename tag" but none of these will work unless I go and change the Language Mode from Smarty to HTML.

I have tried to add these settings, but to no avail:

	"[smarty]": {
		"html.mirrorCursorOnMatchingTag": true,
		"editor.defaultFormatter": "vscode.html-language-features",
	}

Given that .tpl files are essentially HTML files that support Smarty {tags}, would it be possible to add support for these features? It would be a great game changer.

Thank you very much!

Edit: just realised the same applies to PHP too :(

@vscodebot vscodebot bot added the html HTML support issues label Dec 16, 2019
@solid-pixel solid-pixel changed the title "HTML mirror cursor" and "F2 to rename tag" won't work with Smarty (.tpl) files "HTML mirror cursor" and "F2 to rename tag" won't work with PHP or Smarty (.tpl) files Dec 16, 2019
@gjsjohnmurray
Copy link
Contributor

@octref - is it possible for other languages that embed HTML to benefit somehow from this new feature that I think you added?

@JamesCoyle
Copy link

I feel like this should be extended to support all XML like syntaxes.

@solid-pixel solid-pixel changed the title "HTML mirror cursor" and "F2 to rename tag" won't work with PHP or Smarty (.tpl) files "HTML mirror cursor" and "F2 to rename tag" won't work with anything but HTML files Dec 16, 2019
@octref
Copy link
Contributor

octref commented Dec 17, 2019

is it possible for other languages that embed HTML to benefit somehow from this new feature that I think you added?

@gjsjohnmurray Nope. Each language extension needs to implement this feature themselves.

XML already has it. See redhat-developer/vscode-xml#130
JSX -> microsoft/TypeScript#51832

@octref octref closed this as completed Dec 17, 2019
@octref octref added the *as-designed Described behavior is as designed label Dec 17, 2019
@octref
Copy link
Contributor

octref commented Dec 17, 2019

@solid-pixel Currently they only way is to use files.associations to mark tpl as HTML languages.

In the future we might make this feature available to other languages.

@solid-pixel
Copy link
Author

@octref thanks for coming back.
If I do that, I'll lose Smarty's syntax highlighting and other stuff, so, unfortunately, it's not an option for me.

Perhaps I'll try and ask the Smarty extension devs if they can implement this the way XML did.

@rtanx
Copy link

rtanx commented Dec 23, 2019

that's also what happens to me too, but what I experienced is on Laravel blade.php file, and if I add blade.php to file.associations that remove the syntax highlight

@vscodebot vscodebot bot locked and limited conversation to collaborators Jan 31, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
*as-designed Described behavior is as designed html HTML support issues
Projects
None yet
Development

No branches or pull requests

5 participants