vuejs / vetur

Vue tooling for VS Code.
https://vuejs.github.io/vetur/
MIT License
5.75k stars 593 forks source link

Vetur cannot find variables/methods when used inside an anonymous function for an event #2795

Open aziztitu opened 3 years ago

aziztitu commented 3 years ago

Info

Problem

Vetur is not able to find symbols when used inside an anonymous function for an event like so:

<v-btn
  color="primary"
  depressed
  @click="
    () => {
      if (!resetPasswordSessionId) {
        sendResetPasswordEmail();   // I get an error here: "Cannot find name 'sendResetPasswordEmail'"
      } else {
        resetPassword();   // I get an error here: "Cannot find name 'resetPassword'"
      }
    }
  "
  :loading="forgotCredentialsSendingEmail || resettingPassword"
  >Submit</v-btn
>

Error message:

Cannot find name 'sendResetPasswordEmail'
Cannot find name 'resetPassword'

Reproducible Case

lgarczyn commented 2 years ago

Same issue. It is especially bad if a component uses @Emit from vue-property-decorator, as any non-default type will cause similar errors