question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

PHP 8 named arguments color

See original GitHub issue

There are a mish mash coloring for the PHP 8 named arguments.

Screenshot: Unbenannt-1

For reproduction:

<?php

sample('string', param: 1);
figure(sprintf('pattern %d', 1), param: 1);
type(Class::func(), param: 1);
throw new \Exception(sprintf('pattern %d', 1), param: 1);
type(
    Class::func(), 
    param: 1
);
throw new \Exception(
    "Error Processing Request",
    param: 1,
    option: 0
);
Class::func('string', mode: 0);
type(Class::func(), param: 1);

Screenshot of the code above: Code_78RC6Ix1z4

Thank you for your great work!

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
asoluxcommented, Dec 13, 2021

Great! Seems to be working fine. However, I still added the entity.name.goto-label.php key. If I notice anything else, I’ll get in touch again. Thanks!

0reactions
Binaryifycommented, Dec 13, 2021

you can add this snippet in your settions.json before I release next version

"editor.tokenColorCustomizations": {
    "[One Dark Pro]": {
      "textMateRules": []
    },
    "textMateRules": [
      {
        "name": "php scope",
        "scope": "entity.name.variable.parameter.php,punctuation.separator.colon.php,constant.other.php",
        "settings": {
          "foreground": "#abb2bf"
        }
      },
    ]
  },
Read more comments on GitHub >

github_iconTop Results From Across the Web

PHP 8: named arguments - Stitcher.io
A close look at named parameters in PHP 8.
Read more >
PHP 8 Named Arguments - YouTube
Please consider supporting Anna Filina's Ukrainian relatives https://afilina.com/donate/ua-suppliesOther ways to support the people of ...
Read more >
Named Arguments and Variadics in PHP 8 | Mark Baker's Blog
It means that we can instantiate a new car using named arguments for those optional values rather than passing them as an associative...
Read more >
Named arguments in PHP 8 | Arsouyes.org
This class has all needed to create an image, draw it and build colors for subsequent uses. Lets say that I then add...
Read more >
Understanding named arguments | PHP 8 Programming Tips ...
Named arguments represent a way to avoid confusion when calling functions or methods with a large number of arguments. This not only helps...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found