Skip to content

fix: avoid template local clash for primitive completions - #2411

Open
Tanvir Alam (tanvir-ux) wants to merge 1 commit into
microsoft:mainfrom
tanvir-ux:fix/primitive-completion-name-clash
Open

fix: avoid template local clash for primitive completions#2411
Tanvir Alam (tanvir-ux) wants to merge 1 commit into
microsoft:mainfrom
tanvir-ux:fix/primitive-completion-name-clash

Conversation

@tanvir-ux

Copy link
Copy Markdown

Summary

When completing properties on a paused primitive whose name matches a local in enumeratePropertiesTemplate (for example minified n, or target), the helper was re-evaluated on the call frame as let n = (n) / let target = (target). That binds the template local instead of the user value, so evaluation throws and completions are empty.

This change interpolates the already-evaluated primitive into the template and runs it with Runtime.evaluate in the execution context (no call frame), matching the approach discussed in #2399.

Test plan

  • Added completes primitive when name clashes with template locals (#2399) integration coverage for n. and target. while paused
  • CI completion tests

Fixes #2399

When completing properties on a paused primitive whose name matches a
local in enumeratePropertiesTemplate (e.g. minified `n`, or `target`),
re-evaluating the expression on the call frame binds the template local
instead of the user value and completions come back empty.

Interpolate the already-evaluated primitive into the template and run it
with Runtime.evaluate in the execution context (no call frame).

Fixes microsoft#2399
@tanvir-ux

Copy link
Copy Markdown
Author

@microsoft-github-policy-service agree

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.

Completions fail when the completed name matches a variable in the enumeration template

1 participant