Skip to content

Add namespace qualifier highlighting#101

Closed
alfredomtx wants to merge 1 commit intozed-extensions:mainfrom
alfredomtx:feat/namespace-qualifier-highlight
Closed

Add namespace qualifier highlighting#101
alfredomtx wants to merge 1 commit intozed-extensions:mainfrom
alfredomtx:feat/namespace-qualifier-highlight

Conversation

@alfredomtx
Copy link
Contributor

@alfredomtx alfredomtx commented Feb 3, 2026

Summary

Dims namespace qualifiers in inline FQNs using @label capture, matching IDE behavior like PhpStorm.

Before: \App\Models\User - all same color
After: \App\Models\ - dimmed, User - highlighted

Changes

Targets specific expression contexts where inline FQNs appear:

  • Class constant access: \App\Models\Foo::CONST
  • Static method calls: \App\Models\Foo::method()
  • Object creation: new \App\Models\Foo()
  • Type annotations

use statements are NOT affected.

Theme Configuration

"theme_overrides": {
  "One Light": {
    "syntax": {
      "label": { "color": "#a0a1a7" }
    }
  }
}

Example:
image

@cla-bot cla-bot bot added the cla-signed label Feb 3, 2026
@alfredomtx alfredomtx force-pushed the feat/namespace-qualifier-highlight branch from afc4347 to 1d48dc5 Compare February 3, 2026 21:04
@alfredomtx alfredomtx marked this pull request as draft February 3, 2026 21:05
@alfredomtx alfredomtx force-pushed the feat/namespace-qualifier-highlight branch 5 times, most recently from e1e1ceb to 0c37f09 Compare February 3, 2026 22:12
Dims namespace qualifiers in inline fully qualified names using
@Label capture. Targets specific expression contexts where FQNs
appear inline (not use statements).
@alfredomtx alfredomtx force-pushed the feat/namespace-qualifier-highlight branch from 0c37f09 to 8e7b68d Compare February 3, 2026 22:13
@MrSubidubi MrSubidubi changed the title feat: add namespace qualifier highlighting Add namespace qualifier highlighting Feb 4, 2026
@alfredomtx
Copy link
Contributor Author

I'm closing it because I'm not sure this will be useful for the community.
I was trying to achieve the same behaviour as PhpStorm, to only dim the full namespace when it can be replaced by an import(code action), but it doesn't seem that this is currently possible on Zed.

@alfredomtx alfredomtx closed this Feb 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant