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
@ahoppen
Copy link
Member

ahoppen commented Dec 20, 2025

Thanks for the PR to swift-tools-protocols. We will need @owenv’s help to tag a new release of swift-tools-protocols and get it into the CI pipeline and he’s on vacation until the new year. Let’s get this over the finish line when he’s back.

@PhantomInTheWire
Copy link
Author

hey @ahoppen @owenv i think we should be able to tag a new release now, lmk if some changes are needed from my end.

@ahoppen
Copy link
Member

ahoppen commented Jan 5, 2026

@owenv is already on it. https://github.com/swiftlang/swift-tools-protocols/releases/tag/0.0.10 has just been tagged and we now need to update the toolchain builds to use that tag so we can land this PR.

@PhantomInTheWire
Copy link
Author

@ahoppen so do i have to open a separate pr to bump swift-tools-protocols to 0.0.10 in package.swift? i noticed its one of the only ones that is tagged to a version and not directly to main

@ahoppen
Copy link
Member

ahoppen commented Jan 6, 2026

We have #2425 for that. We also need to bump the version in other repos at the same time plus some additional manual work in CI jobs. I’ll let you know once the version has been updated and we can proceed with this PR. Sorry for the delay.

@PhantomInTheWire
Copy link
Author

Thanks for the update, appreciate you handling the coordination. I’m not in a rush, happy to wait until the version bumps land.

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