Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PHP syntax highlighting (Dark / Dark+ default themes): "instanceof" gets wrong color #94979

Closed
stakx opened this issue Apr 11, 2020 · 2 comments
Assignees
Labels
grammar Syntax highlighting grammar upstream-issue-linked This is an upstream issue that has been reported upstream

Comments

@stakx
Copy link

stakx commented Apr 11, 2020

Issue Type: Bug

  • VS Code version: Code 1.44.0 (2aae1f2, 2020-04-07T23:31:18.860Z)
  • OS version: Windows_NT x64 10.0.18362

Steps to Reproduce:

  1. Select the Dark or Dark+ default theme.

  2. Create a new empty file.

  3. Change language mode to PHP.

  4. Enter the following:

    <?php
    if ($x instanceof Y) { }

    (Note I'm using an upper-case type name Y intentionally; this isn't the same issue as PHP Syntax Highlighting of instanceof keyword and class name #88441!)

  5. Observe the colour of instanceof. It should be coloured like a keyword, but isn't.

Possible cause:

It appears that the themes don't contain a coloring rule for scope keyword.operator.type.php. The following custom settings appear to fix the problem:

{
    "editor.tokenColorCustomizations": {
        "[Default Dark+]": {
            "textMateRules": [
                {
                    "scope": [
                        "keyword.operator.type.php",
                    ],
                    "settings": {
                        "foreground": "#c586c0"
                    }
                }
            ]
        }
    }
}

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

System Info
Item Value
CPUs Intel(R) Core(TM) i7-8550U CPU @ 1.80GHz (8 x 1992)
GPU Status 2d_canvas: enabled
flash_3d: enabled
flash_stage3d: enabled
flash_stage3d_baseline: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
oop_rasterization: disabled_off
protected_video_decode: enabled
rasterization: enabled
skia_renderer: disabled_off_ok
video_decode: enabled
viz_display_compositor: enabled_on
viz_hit_test_surface_layer: disabled_off_ok
webgl: enabled
webgl2: enabled
Load (avg) undefined
Memory (System) 15.81GB (7.09GB free)
Process Argv
Screen Reader no
VM 0%
@alexr00
Copy link
Member

alexr00 commented Apr 14, 2020

instanceof probably shouldn't be scoped as keyword.operator.type. I opened an issue in the repo that owns the grammar. atom/language-php#388

@alexr00 alexr00 added grammar Syntax highlighting grammar upstream-issue-linked This is an upstream issue that has been reported upstream labels Apr 14, 2020
@alexr00 alexr00 closed this as completed Apr 14, 2020
@stakx
Copy link
Author

stakx commented Apr 14, 2020

Thanks! I didn't realise that these grammars were brought in from another project. Good to know!

@github-actions github-actions bot locked and limited conversation to collaborators May 29, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
grammar Syntax highlighting grammar upstream-issue-linked This is an upstream issue that has been reported upstream
Projects
None yet
Development

No branches or pull requests

2 participants