From b7c2d4876c24af406131e6dbbc0fe844462f1d53 Mon Sep 17 00:00:00 2001 From: not a cow <104355555+not-a-cowfr@users.noreply.github.com> Date: Fri, 6 Jun 2025 13:58:18 -0700 Subject: [PATCH] Fix syntax highlighting conflicts with certain glsl types (#32022) added first line pattern for glsl because some extensions conflict with others like fragment shaders (.fs) would be highlighted by f#
| no f# extension no fix | f# extension no fix | f# extension with fix | |--------|--------|--------| | ![zed_TW1mkwXSMS](https://github.com/user-attachments/assets/d3d64b44-ced5-41a8-86b1-36cafc92f7e4) | ![zed_T5ewceKmHo](https://github.com/user-attachments/assets/08ced11d-c2c6-4b73-964d-768e8ba763da) | ![zed_9Rhkc5flQZ](https://github.com/user-attachments/assets/9e949d00-4e69-4687-9863-e0ab38b8b3df) |
Release Notes: - glsl: Added a workaround for an issue where fragment shaders with the `.fs` file extension would be misidentified as F#. Now, adding `#version {version}` to the first line of your fragment shader will ensure it is always recognized as glsl --- extensions/glsl/languages/glsl/config.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/extensions/glsl/languages/glsl/config.toml b/extensions/glsl/languages/glsl/config.toml index 72353cfbf5..0144e981cc 100644 --- a/extensions/glsl/languages/glsl/config.toml +++ b/extensions/glsl/languages/glsl/config.toml @@ -10,6 +10,7 @@ path_suffixes = [ # Other "glsl" ] +first_line_pattern = '^#version \d+' line_comments = ["// "] block_comment = ["/* ", " */"] brackets = [