Skip to content

feat(tokens): expose renamed data for deprecated tokens#6049

Open
5t3ph wants to merge 38 commits intomainfrom
seckles/tokens-expose-renamed
Open

feat(tokens): expose renamed data for deprecated tokens#6049
5t3ph wants to merge 38 commits intomainfrom
seckles/tokens-expose-renamed

Conversation

@5t3ph
Copy link
Contributor

@5t3ph 5t3ph commented Feb 24, 2026

Description / Context

Per recent design data update, the extension will now use renamed data in prompt if available for deprecated tokens.

The swc-tokens token generation was updated to split off renamed tokens in order to keep deprecated tokens out of the final CSS token output, but make the renamed data available to the extension.

Related issue(s)

SWC-1489

Screenshots (if appropriate)

Extension flags as error and displays renamed value to assist in updating.

image

Typos also try to match with renamed values when close

image

Regular error on unknown/fully deprecated tokens

image

Diagnostic message also appears in "Problems" pane

image

Author's checklist

  • I have read the CONTRIBUTING and PULL_REQUESTS documents.
  • I have reviewed at the Accessibility Practices for this feature, see: Aria Practices
  • I have added automated tests to cover my changes.
  • I have included updated documentation if my change required it.

Reviewer's checklist

  • Includes a Github Issue with appropriate flag or Jira ticket number without a link
  • Automated tests cover all use cases and follow best practices for writing

Manual review test cases

  1. Access this branch locally, and install and activate the latest extension
    • See the README for swc-vscode-token for install instructions
  2. Open any 2nd-gen CSS file and add or modify a token name to a known deprecated token, ex. field-width
  3. Validate the extension flags it as an error and that the hover suggestions show the renamed value to use
  4. Edit the token name to have a type, ex. field-with and validate suggestions still include the renamed value as possibility

5t3ph added 29 commits February 9, 2026 10:04
@5t3ph 5t3ph requested a review from a team as a code owner February 24, 2026 16:09
@5t3ph 5t3ph added Status:Ready for review PR ready for review or re-review. 2nd gen These issues or PRs map to our 2nd generation work to modernizing infrastructure. labels Feb 24, 2026
@changeset-bot
Copy link

changeset-bot bot commented Feb 24, 2026

⚠️ No Changeset found

Latest commit: 553f1ee

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

}

function tokenRefFromName(name) {
return name ? `token('${name}')` : null;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Just updating to double-quotes

return dp[aLen][bLen];
}

function suggestionPrefixScore(query: string, candidate: string): number {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

All of this sort and rank and so forth logic courtesy of ChatGPT via Codex, theoretically optimized for performance 😅

"displayName": "SWC token() Intellisense",
"engines": {
"vscode": "1.1.37"
"vscode": "^1.109.0"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

There were compat issues with a locked version, but this is entirely separate from our library since it is exclusive to the extension

@github-actions
Copy link
Contributor

github-actions bot commented Feb 24, 2026

📚 Branch Preview Links

🔍 First Generation Visual Regression Test Results

When a visual regression test fails (or has previously failed while working on this branch), its results can be found in the following URLs:

Deployed to Azure Blob Storage: pr-6049

If the changes are expected, update the current_golden_images_cache hash in the circleci config to accept the new images. Instructions are included in that file.
If the changes are unexpected, you can investigate the cause of the differences and update the code accordingly.

Copy link
Contributor

@caseyisonit caseyisonit left a comment

Choose a reason for hiding this comment

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

looks good with one minor code suggestion to fix serif font tokens

@5t3ph 5t3ph added Status:Ready for re-review PR has had its feedback addressed and is once again ready for review. Status:Ready for review PR ready for review or re-review. and removed Status:Ready for review PR ready for review or re-review. Status:Ready for re-review PR has had its feedback addressed and is once again ready for review. labels Feb 25, 2026
@Rajdeepc
Copy link
Contributor

Rajdeepc commented Feb 26, 2026

@5t3ph FYI The CI was failing with some flaky test. I surfaced a fix and tested on this commit. Should work fine.

Copy link
Member

@cdransf cdransf left a comment

Choose a reason for hiding this comment

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

This looks great! ✨

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

2nd gen These issues or PRs map to our 2nd generation work to modernizing infrastructure. CSS Processing Status:Ready for review PR ready for review or re-review.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants