microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
163.61k stars 29.04k forks source link

The tmLanguage `injectionSelector` has broken in v1.9.2 #224680

Closed edheltzel closed 2 months ago

edheltzel commented 2 months ago

Type: Bug Does this issue occur when all extensions are disabled?: Yes

I maintain an extension called Better Nunjucks. It uses tmLanguage's injectionSelector to specify "the scope in which a particular grammar should be injected. This feature allows for embedding one grammar within another based on specific conditions, enhancing the syntax highlighting capabilities for complex language constructs." This choice was made to avoid setting files.association for Nunjucks/HTML/Markdown files.

With the release of v1.92 - the Better Nunjucks syntax highlighting has broken. I can confirm that with v1.91.1 the extension functions as expected.

Steps to Reproduce:

  1. Install and enable Better Nunjucks
  2. Open a project with Nunjucks files

Images for context:

v1.91.1 v1.92
v1 91-Screenshot 2024-08-03 at 8 12 35 AM v1 92-Screenshot 2024-08-03 at 8 11 17 AM
v1 91-Screenshot 2024-08-03 at 8 12 41 AM v1 92-Screenshot 2024-08-03 at 8 11 32 AM
v1 91-Screenshot 2024-08-03 at 8 12 45 AM v1 92-Screenshot 2024-08-03 at 8 13 16 AM

Seen on https://github.com/edheltzel/nunjucks-for-visual-studio-code/issues/21

edheltzel commented 2 months ago

@aeschli, I ended up resolving this on my end - PR #22: Better Nunjucks for VSCode