glint icon indicating copy to clipboard operation
glint copied to clipboard

Error highlight in wrong place when same substring appears on line

Open ef4 opened this issue 1 year ago • 0 comments

In this example:

import { TemplateOnlyComponent } from '@ember/component/template-only';

function options(): any {
  return [];
}

export default <template>
  <div class='flex flex-col container m-2 p-6'>
    {{#each (options) as |option|}}{{/each}}

  </div>
</template> satisfies TemplateOnlyComponent<{ Args: { thing: object } }>;

Glint is underlying the first occurrent of the string "option" in the template, when it's trying to complain about the second one (being unused). Screenshot 2024-09-27 at 5 43 32 PM

If I pick a different name for the helper function that doesn't contain the substring "option", the error highlight moves to the correct place.

ef4 avatar Sep 27 '24 21:09 ef4