bmewburn / vscode-intelephense

PHP intellisense for Visual Studio Code
https://intelephense.com
Other
1.56k stars 92 forks source link

Highlight named parameters in constructors the same way as in methods/functions #2905

Closed Feralidragon closed 2 weeks ago

Feralidragon commented 2 weeks ago

At the moment, it seems that Intelephense identifies the name of a named parameter in methods/functions as entity.name.variable.parameter.php, whereas the same kind of name is identified as constant in constructor calls.

Screenshot below: intelephense_named_param_highlight

In my case, I have set my own highlighting colors and style based on the token names from Intelephense, having named parameters such as foo: (in the example above) to have a darker shade of blue/purple relative to other stuff (like variables, constants, etc), and as you can see above, in the constructor foo: is colored the same as a variable or constant, and that's because Intelephense is seeing it as a constant and not as the name of a named parameter.

Whereas in the method call, foo: has the correct coloring as it's being correctly identified as the name of a named parameter (by seeing it as a entity.name.variable.parameter.php token).

Thus the same should be done for constructors, in my opinion. :)

I'm currently using version 1.10.4 of Intelephense.

bmewburn commented 2 weeks ago

VSCode is supplying highlighting here using https://github.com/KapitanOczywisty/language-php . Tracking semantic highlighting from this extension in #1021