godotengine / godot-vscode-plugin

Godot development tools for VSCode
MIT License
1.58k stars 168 forks source link

Broken language analysis in GDScript since introduction of "Scene unique nodes" #429

Closed rsubtil closed 1 year ago

rsubtil commented 2 years ago

Godot version

N/A

VS Code version

N/A

Godot Tools VS Code extension version

N/A

System information

N/A

Issue description

(originally from https://github.com/github/linguist/discussions/6108)

Since Godot introduced "Scene unique nodes", the % operator is breaking syntax highlighting on GitHub:

Before:

var my_node = $/Node1/Node2/MyNode

func _ready() -> void:
    my_node.visible = false

After:

var my_node = $"%MyNode"

func _ready() -> void:
    my_node.visible = false

This is not related to Godot, VSCode, and this plugin (and from VSCode syntax highlighting is working without issue); it's for the grammar used for linguist

Steps to reproduce

error-27 commented 2 years ago

This also happens when you use a string literal with the $.

var my_string = "hello"
var my_node = $"Node1/Node2/My_Node"

func _ready() -> void:
    my_node.visible = false
DaelonSuzuka commented 1 year ago

image image

I don't see what's wrong with either of these examples. I don't love githubs color choices but it looks like the grammar is working correctly to me.

rsubtil commented 1 year ago

It seems it was fixed in the meantime! This is what it used to look like: image