tomblachut / svelte-intellij

Svelte components in WebStorm and friends
MIT License
482 stars 38 forks source link

Unresolved functions #215

Closed unlocomqx closed 3 years ago

unlocomqx commented 3 years ago

Some functions are not resolved when using lang=ts

2021-04-25 at 4 07 PM

I used the svelte template to reproduce

npx degit sveltejs/template svelte-app
cd svelte-app
node scripts/setupTypeScript.js

I don't know if it's caused by my IDE settings or by the extension The JS Language level is set to ES6+ if that's relevant to this

r00t3g commented 3 years ago

It might be related to misconfiguration in tsconfig - target or lib sections, not the plugin

unlocomqx commented 3 years ago

After adding "es2017" to tsconfig, I couldn't reproduce it on the svelte template. It still occurs in my main project though but I guess it doesn't come from the plugin itself.

unlocomqx commented 3 years ago

I was able to reproduce on the svelte template. The issue doesn't occur on App.svelte but on other components only (that are not imported by main.ts) Can you check if you can repro?

App.svelte

app

Comp.svelte

comp

When Comp.svelte is imported in main.ts the issue goes away

For info, String.includes is part of ES2015 and Array.includes is part of ES2016 according to intellij declaration files at least

Minimal Repo: https://github.com/unlocomqx/unresolved-functions

tomblachut commented 3 years ago

Hey @unlocomqx thanks for reporting, I was able to reproduce. I'll close this in favor of https://youtrack.jetbrains.com/issue/WEB-51050

unlocomqx commented 3 years ago

Sorry for double reporting, I thought it must be an issue with webstorm itself not the plugin but the webstorm team member scoped it to the plugin anyway! Cheers.

tomblachut commented 3 years ago

No problem :)