tc39 / ecmarkup

An HTML superset/Markdown subset source format for ECMAScript and related specifications
https://tc39.es/ecmarkup/
MIT License
222 stars 63 forks source link

handle ins/del in completion-record typechecks #610

Closed bakkot closed 2 months ago

bakkot commented 2 months ago

Fixes https://github.com/tc39/ecmarkup/issues/608.

The typechecker is already using the expr-parser output, which strips ins/del, but the result of that parse can have multiple adjacent name: 'text' items in sequence, which the typechecker didn't account for here. Specifically, with the input <ins>?</ins> Foo() we end up with [{ name: 'text', content: '?' }, { name: 'text', content: ' ' }, foo]. Adjust the logic to handle this case.

michaelficarra commented 2 months ago

Let's add a test for using both ins and del to change the sigil, like in the original issue.

bakkot commented 2 months ago

Done.