godotengine / godot-vscode-plugin

Godot development tools for VSCode
MIT License
1.47k stars 148 forks source link

`func` alone is highlighted as variable instead of keyword #591

Closed atirut-w closed 4 months ago

atirut-w commented 4 months ago

Godot version

N/A

VS Code version

1.86.2

Godot Tools VS Code extension version

v2.0.0 (bf1d739d073c93f62abf280a7ae19d5c3054c935)

System information

Windows 11

Issue description

func is only highlighted as keyword when there is at least one opening parenthesis on the same line:

image

Steps to reproduce

extends Node

func

func ()

func (
xiaoxustudio commented 4 months ago

I don't think this is a bug. gdscript functions are defined with parentheses, so I think it's pointless to test them like this

atirut-w commented 4 months ago

It's not pointless if it's for the sake of consistency. Also, This is how it looks in Godot's editor:

image

DaelonSuzuka commented 4 months ago

The better metric is whether "func" is a valid identifier name. I don't think it is, which means "func" should always be a keyword.

xiaoxustudio commented 4 months ago

oh !That seems to be the case. I was wrong. I'm sorry