Skip to content

Conversation

@PhantomInTheWire
Copy link

@PhantomInTheWire PhantomInTheWire commented Dec 18, 2025

Motivation: Argument labels are currently tokenized as function without any modifier, making them indistinguishable from function names. This prevents theme authors from styling them differently, particularly important for accessibility (e.g., themes for neurodivergent developers) and personal preference.

Changes:

  • Added parameterLabel semantic token modifier to SemanticTokenModifiers extension
  • Applied the modifier to argument labels in both the syntactic path (SemanticTokens.swift) and semantic path (SyntaxHighlightingTokenParser.swift) to ensure consistency.
  • Updated the token legend to include the new modifier so editors can decode it.
  • Updated all(?) relevant test expectations to include .parameterLabel for argument label tokens.

Fixes #1540

Copy link
Member

@ahoppen ahoppen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice. Looks good to me, I’d just like to define the modifier in swift-tools-protocols.

@PhantomInTheWire
Copy link
Author

@ahoppen i have a open pr on swift-tools-protocols for this. we will have to merge that first. swiftlang/swift-tools-protocols#31 before this

@PhantomInTheWire PhantomInTheWire force-pushed the feat/add-parameterLabel-modifier branch from 80f905b to 682bac6 Compare December 19, 2025 19:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Parameter label as function token

2 participants