Re: [RFC] Strict Namespace Resolution
| From: | Tim Düsterhus | Date: | Thu, 16 Jul 2026 13:23:34 +0000 |
| Subject: | Re: [RFC] Strict Namespace Resolution | ||
| References: | 1 2 3 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-131969@lists.php.net to get a copy of this message | ||
Hi
On 2026-07-15 19:18, Rowan Tommins [IMSoP] wrote:
On 15 July 2026 16:54:04 BST, Ilija Tovilo <tovilo.ilija@gmail.com> wrote:FWIW, I agree. In Visual Studio Code it's also possible to adjust the styling of namespaces specifically, which would allow tuning down the backslash: As an example, this config renders namespaces in black with 50% opacity:This flag forces the use of a \ prefix, but it's worth noting there are some communities (e.g. Laravel and Symfony) who have explicitly rejected the idea of prefixing all functions for readability reasons.I know it won't change anyone's mind, but for the record, I've always found this baffling. Adding a single punctuation mark next to function calls seems far more readable to me than having a huge block of "use function" lines at the top of every file.
"editor.tokenColorCustomizations": {
"textMateRules": [
{
"scope": "support.other.namespace.php",
"settings": {
"foreground": "#0000007F"
}
}
]
}
Using punctuation.separator.inheritance.php as the scope will just affect the backslash specifically.
Best regards
Tim Düsterhus