Skip to content
This repository was archived by the owner on Dec 15, 2022. It is now read-only.
This repository was archived by the owner on Dec 15, 2022. It is now read-only.

Static keyword not colored correctly on props #419

Closed
@roblourens

Description

@roblourens

From microsoft/vscode#120042:

  • VS Code Version: 1.54.3
  • OS Version: Ubuntu Desktop 20.04

Steps to Reproduce:

  1. Create a new PHP file
  2. Paste the example code below
<?php
class Authentication
{
    private static $authTag;
    
    public static function setTag($authTag)
    {
        session_start();
        self::$authTag = $authTag;
    }
}

Does this issue occur when all extensions are disabled?: Yes

Explanation

When used with a property, static keyword is setted as support.class.php scope.
When used with a method, static keyword is setted as storage.modifier.php scope.

Print without extensions, default Dark+ theme.
image
image

Suggestion

I don't understand much about syntax highlight, but I was looking in the php.tmLanguage.json file and this bug, apparently, has something with this line.
https://github.com/microsoft/vscode/blob/c0fa3dfd3e252792efbae044c44c3bbb90c5b093/extensions/php/syntaxes/php.tmLanguage.json#L1170

When I change its value to storage.modifier.php, the bug is gone.
image

Please, note that I'm not saying that this is the fix to this bug. I didn't tested anything more than just changing the value of the parameter. I'm just guessing that this line has something to do with the bug.

Thank you!

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions