tomblachut / svelte-intellij

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

Unresolve custom methods and properties in window #222

Closed vgpechenkin closed 3 years ago

vgpechenkin commented 3 years ago

Hi, Tomasz. Thank you so much for you working on the plugin. I have some problems. The plugin doesn't resolve custom methods and properties. I using svelte on Game UI and c++ expose methods and properties in window global object.

global.d.ts

declare global {
    interface Window {
        ContractService: ContractService;
    }
}

Using image

tomblachut commented 3 years ago

Hey, last time I've checked Svelte had builtin list of allowed globals, did something change in that area?

vgpechenkin commented 3 years ago

Hey. I don't know about builtin list of allowed globals. I create an empty test project and 2 svelte files. App and Component. image How do you think it is svelte or plugin problem?

tomblachut commented 3 years ago

I'm not sure if it should compile, does it? in Svelte you can't access whatever (only some explicitly allowed things) from window object as global (without window.) and I assumed same can be said about window. access

vgpechenkin commented 3 years ago

Hi @tomblachut. I think this problem relate to https://youtrack.jetbrains.com/issue/WEB-51050. When I moved importing svelte file to ts It solves the problem

tomblachut commented 3 years ago

Ok, thank you.

tomblachut commented 3 years ago

Hi @vgpechenkin, could you check if this super secret attachment fixes the problem? (2021.2 required) svelte-intellij-0.21.0-alpha.zip

vgpechenkin commented 3 years ago

Hi @tomblachut. Yes, This version fixes the bug. Thanks

tomblachut commented 3 years ago

I'm glad it works. Thanks for testing.

Fixed in #232