Skip to content

PHP class and primitive type function parameters scoped and highlighted identically #95029

@bakerkretzmar

Description

@bakerkretzmar

Issue Type: Bug

PHP function parameters receive the exact same scope (and are therefore the same colour) whether they are classes or primitive types.

VS Code: class names should be yellow and other keywords purple, but both the Request and bool typehints are purple. They are both scoped:

storage.type.php
meta.function.parameter.typehinted.php
meta.function.parameters.php
meta.function.php
meta.class.body.php
meta.class.php
source.php
meta.embedded.block.php
text.html.php

Screen Shot 2020-04-11 at 9 05 46 PM

For comparison, in Sublime, the Request typehint, which is a class name, is yellow, and the bool one is purple. Scopes are a little different in Sublime, but notably the bool typehint does not include storage.type.php:

Screen Shot 2020-04-11 at 9 06 20 PM

I understand that if this is actually a bug in the grammar I should send a PR to Atom's php-language repo, but is that what's happening here? Can anyone provide some more insight or point me to where I would start working on a fix?

Thanks.


VS Code version: Code 1.44.0 (2aae1f2, 2020-04-08T08:23:56.137Z)
OS version: Darwin x64 18.7.0

System Info
Item Value
CPUs Intel(R) Core(TM) i7-7567U CPU @ 3.50GHz (4 x 3500)
GPU Status 2d_canvas: enabled
flash_3d: enabled
flash_stage3d: enabled
flash_stage3d_baseline: enabled
gpu_compositing: enabled
metal: disabled_off
multiple_raster_threads: enabled_on
oop_rasterization: disabled_off
protected_video_decode: unavailable_off
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) 3, 4, 4
Memory (System) 16.00GB (0.20GB free)
Process Argv
Screen Reader no
VM 0%
Extensions (13)
Extension Author (truncated) Version
vscode-intelephense-client bme 1.3.11
better-phpunit cal 1.5.2
disableligatures Coe 0.0.8
macros ged 1.2.1
customize-ui ioc 0.1.34
monkey-patch ioc 0.1.7
php-cs-fixer jun 0.1.149
vetur oct 0.24.0
advanced-new-file pat 1.2.0
toggle reb 0.0.1
laravel-artisan rya 0.0.27
ayu tea 0.18.0
errorlens use 3.1.0

(2 theme extensions excluded)

Metadata

Metadata

Assignees

Labels

phpPHP support issuesupstreamIssue identified as 'upstream' component related (exists outside of VS Code)

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions