Closed unlocomqx closed 5 years ago
The hardest part is to find which API to use as there's not enough documentation
Yeah definitely it's like walking in the dark for me. You need to bump into a bunch of wrong APIs before arriving at correct solution.
I'll check the code later, thx!
Method breakpoints in interfaces helped me a lot with this one
Regarding the dicovery of re-exports, I standardized component info using JsModuleNameInfo and added the svelte file manually in https://github.com/tomblachut/svelte-intellij/blob/7cd40038f440498a48c75d813a570972eb699c63/src/main/java/dev/blachut/svelte/lang/codeInsight/ComponentImporter.kt#L131
I've tested it as original branch and merged with master and in both cases only marking imports as used and navigation to definition works. Completions aren't added, unresolved component inspection works only for default exports.
I can merge this but wanted to clarify because you said otherwise in the descriptions. Regression maybe?
I couldn't reproduce on original branch, it still works as expected
Here's how I re-export the Child component
export {default as Child} from "./Child.svelte";
I will rebase and see how it goes
Found a regression,
I will look into it
Thx. Keep in mind I've swapped HTML with SvelteHTML. I've actually checked it there are some obvious checks but didn't find anything
I fixed the direct import regression. I didn't find a potential issue with SvelteHTML in my code. PS: If you know of a way to make a svelte component be treated as an implicit ES6 module, it would be great (maybe something for future dev)
Still no luck with completions and missing imports inspection for components from node modules. I'm running https://github.com/EmilTholin/svelte-routing/tree/master/example
I even tried with IDEA and WebStorm - results are the same.
I'm gonna merge this anyway because I wanted to release something - it's been over a month since 0.8.0. I need to fix some HTML inspections first though.
We should catch up on Discord some day about ES6 module issue.
I was able to reproduce using svelte-routing
example
I had to mark node_modules
as "Not Excluded" to get it working
Can you try it?
node_modules
was initially marked as "library root" which I thought would be sufficient but it wasn't
Ah yes! It's working now.
Anyway we can't expect anybody to do it 😅It will bloat completions for every other library. Node modules integration will need more work (and research first ughhh).
For the time being, thanks for fixing #6 and #37
Thank you for merging, If I find out anything about node_modules, I'll let you know
Cheers
This is a way to handle aliased re-exports from project files as well as from node_modules (related to #37 #6)
Todo:
It's a bit messy, if you'd like to take what's useful, it will be fine The hardest part is to find which API to use as there's not enough documentation
Resolves #6 Resolves #37