tomblachut / svelte-intellij

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

Exported functions from initialized components are "unresolved" #307

Closed AlbertMN closed 1 year ago

AlbertMN commented 2 years ago

In Svelte, it's possible to export a function, which can then be executed via the initialized component, the same way as methods like $destroy are exposed for the individual component.

Example; test.svelte

<script>
  export function myExportedFunction() {
    ...
  }
</script>

main.js

import TestComponent from "./test.svelte";

const comp = new TestComponent({
  ...
});

comp.myExportedFunction();

This code works, but the IDE doesn't suggest, and can't find, a method by the name of myExportedFunction for the component. This is also not to be confused with importing functions from the Svelte file into the JS file - this serves a different purpose.

kyngs commented 1 year ago

I am also suffering from this issue, however, because I use typescript it even yells an error at me. The code works fine tho. Please fix this.

xidoc commented 1 year ago

Same problem with files ts.

kevinleto-informaticon commented 1 year ago

Same issue with the Plugin Version 0.22.1.

tomblachut commented 1 year ago

Duplicate of #223