Skip to content

fix: resolve signals declared in JSX template-literal data-signals - #1

Merged
hyperpuncher merged 1 commit into
hyperpuncher:mainfrom
aretrace:main
Jun 21, 2026
Merged

fix: resolve signals declared in JSX template-literal data-signals#1
hyperpuncher merged 1 commit into
hyperpuncher:mainfrom
aretrace:main

Conversation

@aretrace

@aretrace aretrace commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

Resolves signals declared via a JSX template-literal data-signals (e.g. data-signals={`{ status: 'idle', lapCount: 0 }`}), which were previously reported as undefined for every usage.

Two fixes:

  1. ts_util::extract_attr now unwraps a surrounding template literal in the jsx_expression arm so the value is the object body rather than a backtick-quoted string (the leading backtick was defeating the {-prefixed object-literal check in signal_names_from_attr).
  2. find_obj_key_ranges now anchors on value.find('{') instead of value.len() - trimmed.len() so go-to-definition/rename ranges stay byte-accurate when the body has surrounding whitespace.

Added tests; full suite passes with no regressions.

@hyperpuncher
hyperpuncher merged commit f568ec9 into hyperpuncher:main Jun 21, 2026
1 check passed
@hyperpuncher

Copy link
Copy Markdown
Owner

sorry, missed your pr
lgtm, thx!

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.

2 participants