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 class and primitive type function parameters scoped and highlighted identically #95029

Closed
bakerkretzmar opened this issue Apr 12, 2020 · 3 comments · Fixed by atom/language-php#398
Assignees
Labels
php PHP support issues upstream Issue identified as 'upstream' component related (exists outside of VS Code)

Comments

@bakerkretzmar
Copy link

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)

@roblourens
Copy link
Member

Sorry for not responding, thanks for filing it upstream, looks like this is in progress

@roblourens roblourens added php PHP support issues upstream Issue identified as 'upstream' component related (exists outside of VS Code) labels Nov 5, 2020
@bakerkretzmar
Copy link
Author

@roblourens the upstream PR has been merged, do I need to submit one here now to run the update script and pull in the new grammar, or will that happen automatically? Thanks!

@roblourens
Copy link
Member

Thanks for the ping. We do this periodically and I'll do it in December (we are stabilizing the November release this week), but I would accept a PR next week too.

@github-actions github-actions bot locked and limited conversation to collaborators Dec 22, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
php PHP support issues upstream Issue identified as 'upstream' component related (exists outside of VS Code)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants