Go to the declaration of symfony/ux-css tokens in css()

Open
#131 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
42/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Tech stack
php
Domain
devtools

Research direction

Start from how the language server resolves go-to-definition for Twig css() hash keys, and from how it reads config/reference_css.php to map a property type such as SpacingToken to a token category. Then check how the project's ux_css configuration (YAML or PHP, including when@dev) and vendor/symfony/ux-css/resources/panda-tokens.json are parsed. Done means a definition request on blue.500 or md returns the project declaration, the default JSON entry, or both when a default is overridden.

Written by the indexing model from the issue text.

Description

Hi 👋🏻

Go to definition on a token in a css() hash should open its declaration under tokens or semantic_tokens in the project's ux_css configuration (YAML or PHP, any file name, also under when@dev). If the project does not declare the token, it should open the default token in vendor/symfony/ux-css/resources/panda-tokens.json, and when the project overrides a default token, both locations are targets.

{{ css({ color: 'blue.500', p: 'md' }) }}

The token category comes from the property type in config/reference_css.php: p?: SpacingToken means md is spacing.md.

This is how it looks in PhpStorm (Haehnchen/idea-php-symfony2-plugin#2906):

https://github.com/user-attachments/assets/bdb0c0eb-fc9b-48d0-8264-944b46c24956

Dominant language
PHP
Stars
171
Forks
5
PR merge metrics
No merged PRs in 30d

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from symfony/language-tools

All issues in symfony/language-tools

Similar issues

More PHP issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.