godotengine / godot-vscode-plugin

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

Code highlight stays at same color #558

Open EduardoJuliao opened 6 months ago

EduardoJuliao commented 6 months ago

Godot version

4.1.1

VS Code version

1.85.1

Godot Tools VS Code extension version

1.3.1

System information

Windows 11

Issue description

In some files the code highlight won't work and will stay at the same color:

VSCode (with github dark color scheme): image

VSCode (with GDScript color theme): image

Godot: image

Steps to reproduce

Copying the code above will have the same issue in different files

func _set_sprite(device_name:String) -> void:
    if device_name == InputHelper.DEVICE_XBOX_CONTROLLER:
        button_sprite.texture = button_sprites.button_sprites.xbox.interact;
    if device_name == InputHelper.DEVICE_PLAYSTATION_CONTROLLER:
        button_sprite.texture = button_sprites.button_sprites.ps.interact;
    if device_name == InputHelper.DEVICE_SWITCH_CONTROLLER:
        button_sprite.texture = button_sprites.button_sprites.switch.interact;
    if device_name == InputHelper.DEVICE_SWITCH_JOYCON_LEFT_CONTROLLER:
        button_sprite.texture = button_sprites.button_sprites.switch.interact;
    if device_name == InputHelper.DEVICE_SWITCH_JOYCON_RIGHT_CONTROLLER:
        button_sprite.texture = button_sprites.button_sprites.switch.interact;
    if device_name == InputHelper.DEVICE_KEYBOARD:
        button_sprite.texture = button_sprites.button_sprites.keyboard.interact;
DaelonSuzuka commented 6 months ago

Yeah, that's a weird one. I tried your code with 1.3.1 and I see this:

image

I have no idea what's causing this for you or why I can't replicate it. The syntax highlighting has been modified a lot since 1.3.1, and I strongly suspect that this will be fixed in the next version.

Here's what your code looks like to me using the latest build (from PR #559):

image

EduardoJuliao commented 6 months ago

I'll wait for the next version and check if it fixes or not, but it's a very weird one.

I was trying to reproduce the code and I have this, the highlight partially works

image

Now, if I add -> void:, it breaks the highlight.

image

DaelonSuzuka commented 4 months ago

@EduardoJuliao Are you still experiencing this issue since the release of 2.0.0?