typed-ember / glint

TypeScript powered tooling for Glimmer templates
https://typed-ember.gitbook.io/glint
MIT License
110 stars 51 forks source link

Error highlight in wrong place when same substring appears on line #773

Open ef4 opened 1 month ago

ef4 commented 1 month ago

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.