godotengine / godot-vscode-plugin

Godot development tools for VSCode
MIT License
1.55k stars 164 forks source link

match always highlighted red #538

Closed moritztim closed 10 months ago

moritztim commented 10 months ago

Godot version

v4.1.3.stable.arch_linux

VS Code version

1.84.2

Godot Tools VS Code extension version

1.3.1

System information

Arch Linux

Issue description

image match is always treated as tho it was a keyword even when it's used as a variable name, even when spelled with a different case.

Steps to reproduce

  1. type var match
moritztim commented 10 months ago

Guess this is also a language server issue

DaelonSuzuka commented 10 months ago

Interesting. I'm a little surprised that match is a valid identifier.

Here's how it look in master:

image

The variable declaration is correct now, but usage as a variable name is still being highlighted as a keyword. This should be fixed in the next release.

Guess this is also a language server issue

No, all the highlighting is provided by the extension.

moritztim commented 10 months ago

I didn't know match was a thing but turns out it's like switch case

DaelonSuzuka commented 10 months ago

I spent a couple minutes looking at the syntax highlighting for this and discovered that match is not a valid identifier in the general case. I believe that it's being incorrectly allowed sometimes, and you just got lucky.

I have to advise you to not use match as a variable name.

Code_zvjJCIZZfa

Code_lVwHpqSijF

moritztim commented 10 months ago

oh that's good to know then :) thanks!