tomblachut / svelte-intellij Goto Github PK
View Code? Open in Web Editor NEWSvelte components in WebStorm and friends
License: MIT License
Svelte components in WebStorm and friends
License: MIT License
It will fix unused imports problem and improve rename refactoring
It would be nice if there was an option to make the auto-complete feature only complete the tag name and not also add in all the available params, as sometimes the list of available params can be quite long and I may only want to set one of them, or often none of them.
Here's a video demo of the auto-complete adding all the available params where I would only want the tag name: https://youtu.be/fr7yT8QJGxg
Hi! WS2019.2EAP is out and current available version of the plugin is not compatible with it (because of version range 2019.1.1 โ 2019.1.3). Could you please update it?
The following stack-trace occurs when importing a project that has a dependency on spring-jdbc:
Error while indexing /Users/okkeharsta/.m2/repository/org/springframework/spring-jdbc/4.3.20.RELEASE/spring-jdbc-4.3.20.RELEASE.jar!/org/springframework/jdbc/support/sql-error-codes.xml
To reindex this file IDEA has to be restarted
java.lang.IllegalStateException: file.virtualFile must not be null
at dev.blachut.svelte.lang.codeInsight.SvelteNSInfoProvider.overrideNamespaceFromDocType(SvelteNSInfoProvider.kt:13)
at com.intellij.xml.util.XmlUtil.getDefaultNamespaces(XmlUtil.java:589)
at com.intellij.xml.XmlExtension.getNamespacesFromDocument(XmlExtension.java:94)
at com.intellij.psi.impl.source.xml.XmlTagImpl.computeNamespaceMap(XmlTagImpl.java:899)
at com.intellij.psi.impl.source.xml.XmlTagImpl.lambda$getNamespaceMap$12(XmlTagImpl.java:867)
at com.intellij.psi.util.CachedValuesManager.lambda$getCachedValue$0(CachedValuesManager.java:148)
at com.intellij.psi.impl.PsiCachedValueImpl.doCompute(PsiCachedValueImpl.java:54)
at com.intellij.util.CachedValueBase.lambda$getValueWithLock$1(CachedValueBase.java:240)
at com.intellij.openapi.util.RecursionManager$1.doPreventingRecursion(RecursionManager.java:113)
at com.intellij.openapi.util.RecursionManager.doPreventingRecursion(RecursionManager.java:71)
at com.intellij.util.CachedValueBase.getValueWithLock(CachedValueBase.java:241)
at com.intellij.psi.impl.PsiCachedValueImpl.getValue(PsiCachedValueImpl.java:43)
at com.intellij.util.CachedValuesManagerImpl.getCachedValueFromExHolder(CachedValuesManagerImpl.java:72)
at com.intellij.util.CachedValuesManagerImpl.getCachedValue(CachedValuesManagerImpl.java:45)
at com.intellij.psi.util.CachedValuesManager.getCachedValue(CachedValuesManager.java:147)
at com.intellij.psi.util.CachedValuesManager.getCachedValue(CachedValuesManager.java:129)
at com.intellij.psi.impl.source.xml.XmlTagImpl.getNamespaceMap(XmlTagImpl.java:866)
at com.intellij.psi.impl.source.xml.XmlTagImpl.getNamespaceByPrefix(XmlTagImpl.java:785)
at com.intellij.psi.impl.source.xml.XmlTagImpl.lambda$getNamespace$10(XmlTagImpl.java:768)
at com.intellij.psi.util.CachedValuesManager.lambda$getCachedValue$0(CachedValuesManager.java:148)
at com.intellij.psi.impl.PsiCachedValueImpl.doCompute(PsiCachedValueImpl.java:54)
at com.intellij.util.CachedValueBase.lambda$getValueWithLock$1(CachedValueBase.java:240)
at com.intellij.openapi.util.RecursionManager$1.doPreventingRecursion(RecursionManager.java:113)
at com.intellij.openapi.util.RecursionManager.doPreventingRecursion(RecursionManager.java:71)
at com.intellij.util.CachedValueBase.getValueWithLock(CachedValueBase.java:241)
at com.intellij.psi.impl.PsiCachedValueImpl.getValue(PsiCachedValueImpl.java:43)
at com.intellij.util.CachedValuesManagerImpl.getCachedValueFromExHolder(CachedValuesManagerImpl.java:72)
at com.intellij.util.CachedValuesManagerImpl.getCachedValue(CachedValuesManagerImpl.java:45)
at com.intellij.psi.util.CachedValuesManager.getCachedValue(CachedValuesManager.java:147)
at com.intellij.psi.util.CachedValuesManager.getCachedValue(CachedValuesManager.java:129)
at com.intellij.psi.impl.source.xml.XmlTagImpl.getNamespace(XmlTagImpl.java:767)
at com.intellij.util.xml.impl.DomFileElementImpl.getRootTag(DomFileElementImpl.java:183)
at com.intellij.util.xml.impl.RootDomParentStrategy.getXmlElement(RootDomParentStrategy.java:41)
at com.intellij.util.xml.impl.RootDomParentStrategy.getXmlElement(RootDomParentStrategy.java:26)
at com.intellij.util.xml.impl.DomInvocationHandler.getXmlElement(DomInvocationHandler.java:258)
at com.intellij.util.xml.impl.InvocationCache.m(InvocationCache.java:63)
at com.intellij.util.xml.impl.DomInvocationHandler.invoke(DomInvocationHandler.java:670)
at com.intellij.jam.model.common.BaseRootImpl$$EnhancerByJetBrainsMainCglib$$6f929b05.getXmlElement(<generated>)
at com.intellij.util.xml.DomUtil.getDefinedChildren(DomUtil.java:225)
at com.intellij.spring.index.SpringIndexUtil.processChildren(SpringIndexUtil.java:127)
at com.intellij.spring.index.SpringIndexUtil.getAllBeanInfos(SpringIndexUtil.java:122)
at com.intellij.spring.index.SpringIndexUtil.indexFile(SpringIndexUtil.java:31)
at com.intellij.util.indexing.impl.MapReduceIndex.mapInput(MapReduceIndex.java:312)
at com.intellij.util.indexing.VfsAwareMapReduceIndex.mapInput(VfsAwareMapReduceIndex.java:109)
at com.intellij.util.indexing.impl.MapReduceIndex.calculateUpdateData(MapReduceIndex.java:268)
at com.intellij.util.indexing.impl.MapReduceIndex.update(MapReduceIndex.java:250)
at com.intellij.util.indexing.FileBasedIndexImpl.updateSingleIndex(FileBasedIndexImpl.java:1680)
at com.intellij.util.indexing.FileBasedIndexImpl.lambda$doIndexFileContent$28(FileBasedIndexImpl.java:1605)
at com.intellij.openapi.fileTypes.impl.FileTypeManagerImpl.freezeFileTypeTemporarilyIn(FileTypeManagerImpl.java:656)
at com.intellij.util.indexing.FileBasedIndexImpl.doIndexFileContent(FileBasedIndexImpl.java:1564)
at com.intellij.util.indexing.FileBasedIndexImpl.indexFileContent(FileBasedIndexImpl.java:1550)
at com.intellij.util.indexing.UnindexedFilesUpdater.lambda$indexFiles$0(UnindexedFilesUpdater.java:109)
at com.intellij.openapi.project.CacheUpdateRunner$MyRunnable.lambda$run$0(CacheUpdateRunner.java:219)
at com.intellij.openapi.application.impl.ApplicationImpl.tryRunReadAction(ApplicationImpl.java:1106)
at com.intellij.openapi.project.CacheUpdateRunner$MyRunnable.lambda$run$1(CacheUpdateRunner.java:235)
at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$2(CoreProgressManager.java:169)
at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:591)
at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:537)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:59)
at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:156)
at com.intellij.openapi.project.CacheUpdateRunner$MyRunnable.run(CacheUpdateRunner.java:232)
at com.intellij.openapi.application.impl.ApplicationImpl$1.run(ApplicationImpl.java:294)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:834)
<style>
blocks in components can have :global(...)
modifier (https://svelte.dev/docs#style). At the moment css completion doesn't take these styles into account.
I often would rather have double quotes instead of curly braces. In the case when the js code within the braces has spaces, double quotes need to be used anyways.
A more sensible default would be to have double quotes with curly braces inside. Or make it an option to change the default and/or have additional emmet-style sequences to have double quotes, curly braces, or double quoted curly braces.
stacktrace.txt
com.intellij.psi.PsiInvalidElementAccessException: Element: class com.intellij.psi.impl.source.html.HtmlTagImpl #XML because: parent is null
invalidated at: see attachment
at com.intellij.psi.impl.source.tree.CompositePsiElement.getContainingFile(CompositePsiElement.java:107)
at dev.blachut.svelte.lang.inspections.SvelteUnresolvedComponentInspection$buildVisitor$1$visitXmlTag$$inlined$forEach$lambda$1.getFamilyName(SvelteUnresolvedComponentInspection.kt:35)
at com.intellij.codeInspection.QuickFix.getName(QuickFix.java:26)
at com.intellij.codeInspection.ex.QuickFixWrapper.getFamilyName(QuickFixWrapper.java:56)
at com.intellij.codeInspection.ex.QuickFixWrapper.getText(QuickFixWrapper.java:50)
at com.intellij.codeInsight.intention.impl.IntentionActionWithTextCaching.<init>(IntentionActionWithTextCaching.java:52)
at com.intellij.codeInsight.intention.impl.IntentionActionWithTextCaching.<init>(IntentionActionWithTextCaching.java:47)
at com.intellij.codeInsight.intention.impl.CachedIntentions.wrapAction(CachedIntentions.java:242)
at com.intellij.codeInsight.intention.impl.CachedIntentions.wrapActionsTo(CachedIntentions.java:220)
at com.intellij.codeInsight.intention.impl.CachedIntentions.wrapAndUpdateActions(CachedIntentions.java:135)
at com.intellij.codeInsight.daemon.impl.ShowIntentionsPass.doCollectInformation(ShowIntentionsPass.java:222)
at com.intellij.codeHighlighting.TextEditorHighlightingPass.collectInformation(TextEditorHighlightingPass.java:55)
at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.lambda$null$1(PassExecutorService.java:429)
at com.intellij.openapi.application.impl.ApplicationImpl.tryRunReadAction(ApplicationImpl.java:1106)
at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.lambda$doRun$2(PassExecutorService.java:422)
at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:591)
at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:537)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:59)
at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.doRun(PassExecutorService.java:421)
at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.lambda$run$0(PassExecutorService.java:397)
at com.intellij.openapi.application.impl.ReadMostlyRWLock.executeByImpatientReader(ReadMostlyRWLock.java:164)
at com.intellij.openapi.application.impl.ApplicationImpl.executeByImpatientReader(ApplicationImpl.java:204)
at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.run(PassExecutorService.java:395)
at com.intellij.concurrency.JobLauncherImpl$VoidForkJoinTask$1.exec(JobLauncherImpl.java:161)
at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:290)
at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1020)
at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1656)
at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1594)
at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:177)
invalidation.trace
java.lang.Throwable
at com.intellij.psi.impl.DebugUtil.startPsiModification(DebugUtil.java:531)
at com.intellij.psi.impl.DebugUtil.performPsiModification(DebugUtil.java:562)
at com.intellij.pom.core.impl.PomModelImpl.lambda$runTransaction$2(PomModelImpl.java:144)
at com.intellij.openapi.progress.impl.CoreProgressManager.executeNonCancelableSection(CoreProgressManager.java:192)
at com.intellij.pom.core.impl.PomModelImpl.runTransaction(PomModelImpl.java:135)
at com.intellij.psi.impl.DiffLog.lambda$doActualPsiChange$0(DiffLog.java:267)
at com.intellij.psi.impl.source.codeStyle.CodeStyleManagerImpl.lambda$performActionWithFormatterDisabled$6(CodeStyleManagerImpl.java:700)
at com.intellij.psi.impl.source.PostprocessReformattingAspect.disablePostprocessFormattingInside(PostprocessReformattingAspect.java:108)
at com.intellij.psi.impl.source.codeStyle.CodeStyleManagerImpl.lambda$performActionWithFormatterDisabled$8(CodeStyleManagerImpl.java:729)
at com.intellij.formatting.FormatterImpl.runWithFormattingDisabled(FormatterImpl.java:691)
at com.intellij.psi.impl.source.codeStyle.CodeStyleManagerImpl.performActionWithFormatterDisabled(CodeStyleManagerImpl.java:727)
at com.intellij.psi.impl.source.codeStyle.CodeStyleManagerImpl.performActionWithFormatterDisabled(CodeStyleManagerImpl.java:699)
at com.intellij.psi.impl.DiffLog.doActualPsiChange(DiffLog.java:255)
at com.intellij.psi.impl.DocumentCommitThread.lambda$doCommit$8(DocumentCommitThread.java:702)
at com.intellij.psi.impl.PsiDocumentManagerBase.commitToExistingPsi(PsiDocumentManagerBase.java:395)
at com.intellij.psi.impl.PsiDocumentManagerBase.lambda$finishCommitInWriteAction$1(PsiDocumentManagerBase.java:367)
at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:591)
at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:537)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:59)
at com.intellij.openapi.progress.impl.CoreProgressManager.executeNonCancelableSection(CoreProgressManager.java:197)
at com.intellij.psi.impl.PsiDocumentManagerBase.finishCommitInWriteAction(PsiDocumentManagerBase.java:362)
at com.intellij.psi.impl.PsiDocumentManagerImpl.finishCommitInWriteAction(PsiDocumentManagerImpl.java:145)
at com.intellij.psi.impl.PsiDocumentManagerBase$1.run(PsiDocumentManagerBase.java:323)
at com.intellij.openapi.application.impl.ApplicationImpl.runWriteAction(ApplicationImpl.java:994)
at com.intellij.psi.impl.PsiDocumentManagerBase.finishCommit(PsiDocumentManagerBase.java:330)
at com.intellij.psi.impl.DocumentCommitThread.lambda$createFinishCommitInEDTRunnable$5(DocumentCommitThread.java:488)
at com.intellij.openapi.application.TransactionGuardImpl.runSyncTransaction(TransactionGuardImpl.java:82)
at com.intellij.openapi.application.TransactionGuardImpl.lambda$submitTransaction$1(TransactionGuardImpl.java:106)
at com.intellij.openapi.application.impl.LaterInvocator$FlushQueue.doRun(LaterInvocator.java:433)
at com.intellij.openapi.application.impl.LaterInvocator$FlushQueue.runNextEvent(LaterInvocator.java:416)
at com.intellij.openapi.application.impl.LaterInvocator$FlushQueue.run(LaterInvocator.java:399)
at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:313)
at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:776)
at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:727)
at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:746)
at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:873)
at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:822)
at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$8(IdeEventQueue.java:461)
at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:704)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:460)
at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)
java.lang.NoSuchMethodError: com.intellij.lang.javascript.psi.resolve.ResolveResultSink.<init>(Lcom/intellij/psi/PsiElement;Ljava/lang/String;ZZ)V
at dev.blachut.svelte.lang.SvelteJSReferenceExpressionResolver.resolveInScriptTag(SvelteJSReferenceExpressionResolver.kt:89)
at dev.blachut.svelte.lang.SvelteJSReferenceExpressionResolver.resolveInComponent(SvelteJSReferenceExpressionResolver.kt:29)
at dev.blachut.svelte.lang.SvelteJSReferenceExpressionResolver.resolve(SvelteJSReferenceExpressionResolver.kt:21)
at dev.blachut.svelte.lang.SvelteJSReferenceExpressionResolver.resolve(SvelteJSReferenceExpressionResolver.kt:17)
at com.intellij.psi.impl.source.resolve.ResolveCache.resolve(ResolveCache.java:150)
at com.intellij.psi.impl.source.resolve.ResolveCache.resolveWithCaching(ResolveCache.java:180)
at com.intellij.psi.impl.source.resolve.ResolveCache.resolveWithCaching(ResolveCache.java:172)
at com.intellij.lang.javascript.psi.resolve.JSResolveUtil.resolve(JSResolveUtil.java:2117)
at com.intellij.lang.javascript.psi.impl.JSReferenceExpressionImpl.multiResolve(JSReferenceExpressionImpl.java:472)
at com.intellij.lang.javascript.highlighting.JSSemanticHighlightingUtil.highlight(JSSemanticHighlightingUtil.java:174)
at com.intellij.lang.javascript.validation.JSAnnotatingVisitor.visitJSReferenceExpression(JSAnnotatingVisitor.java:485)
at com.intellij.lang.javascript.psi.impl.JSReferenceExpressionImpl.accept(JSReferenceExpressionImpl.java:459)
at com.intellij.lang.javascript.validation.JSAnnotator.annotate(JSAnnotator.java:17)
at com.intellij.codeInsight.daemon.impl.DefaultHighlightVisitor.runAnnotators(DefaultHighlightVisitor.java:120)
at com.intellij.codeInsight.daemon.impl.DefaultHighlightVisitor.visit(DefaultHighlightVisitor.java:87)
at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.runVisitors(GeneralHighlightingPass.java:351)
at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.lambda$collectHighlights$5(GeneralHighlightingPass.java:284)
at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.analyzeByVisitors(GeneralHighlightingPass.java:311)
at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.lambda$analyzeByVisitors$6(GeneralHighlightingPass.java:314)
at com.intellij.codeInsight.daemon.impl.analysis.XmlHighlightVisitor.analyze(XmlHighlightVisitor.java:597)
at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.analyzeByVisitors(GeneralHighlightingPass.java:314)
at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.lambda$analyzeByVisitors$6(GeneralHighlightingPass.java:314)
at com.intellij.codeInsight.daemon.impl.DefaultHighlightVisitor.analyze(DefaultHighlightVisitor.java:71)
at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.analyzeByVisitors(GeneralHighlightingPass.java:314)
at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.collectHighlights(GeneralHighlightingPass.java:281)
at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.collectInformationWithProgress(GeneralHighlightingPass.java:225)
at com.intellij.codeInsight.daemon.impl.ProgressableTextEditorHighlightingPass.doCollectInformation(ProgressableTextEditorHighlightingPass.java:84)
at com.intellij.codeHighlighting.TextEditorHighlightingPass.collectInformation(TextEditorHighlightingPass.java:69)
at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.lambda$null$1(PassExecutorService.java:430)
at com.intellij.openapi.application.impl.ApplicationImpl.tryRunReadAction(ApplicationImpl.java:1166)
at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.lambda$doRun$2(PassExecutorService.java:423)
at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:586)
at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:532)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:86)
at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.doRun(PassExecutorService.java:422)
at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.lambda$run$0(PassExecutorService.java:398)
at com.intellij.openapi.application.impl.ReadMostlyRWLock.executeByImpatientReader(ReadMostlyRWLock.java:164)
at com.intellij.openapi.application.impl.ApplicationImpl.executeByImpatientReader(ApplicationImpl.java:218)
at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.run(PassExecutorService.java:396)
at com.intellij.concurrency.JobLauncherImpl$VoidForkJoinTask$1.exec(JobLauncherImpl.java:174)
at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289)
at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056)
at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692)
at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:157)
Auto import will duplicate an already imported named import.
Here's a video demo: https://youtu.be/mrJlFoHUUkk (deleted)
It would also be nice if there was an option to disable auto imports.
Yes, we can add them to custom attributes in config, but maybe it is possible to automatically add them (on:*
, bind:*
, ... ) in .svelte
files.
Thanks! ๐
I wasted an hour until I realized that this plugin works fine with <style type="text/scss">
.
I was using <style lang="scss">
, because that's what the VueJS plugin uses, and that's what I used on Vue apps. Also the Svelte preprocess package is documenting lang="scss"
, so I thought that was the right way to do it.
So, it would be great to add support for lang="scss"
, since Vue developers are already used to that.
Thanks for your great plugin!
{#if x}<div>Test</div>{/if}
should stay the same after running format
There is also a test prepared that should be uncommented after fixing that
I get an error "Unresolved variable or type videoElem" with the following component.
The error appears in the IDE, but does not break the Svelte build.
<video muted playsinline bind:this={videoElem}></video>
<script context="module">
// Something happens here at module context, not for each component
</script>
<script>
let videoElem;
</script>
If I move the variable declaration to the module context, or swap the order of the script blocks, then the error does not appear. Perhaps the plugin is only looking within the first script block within a component?
Hello
We can enable different html and style languages with svelte-preprocess plugin. This allows the following syntax
<template lang="pug">
... markup in pug syntax
</template>
<style lang="stylus">
...style definitions in stylus syntax
</stylus>
To have intellisense for these languages would be very beneficial?
Thank you
Great plugin ๐
I'm just wondering if this supports stylelint?
i.e.
<style type="text/scss">
.parent {
.child {
//
}
}
</style>
I can't seem to find a way for stylelint to work in this block.
Hi,
any chance to have your work PHPStorm compatible ?
Bunch of features are broken in WS. This blocks releasing 0.9.0
As I understand, right now in WebStorm you can run eslint only against files with extensions associated with JavaScript. Svelte plugin has separate file type.
If that's the case, it would be nice if we could get option to run eslint against .svelte files. Right now I managed run eslint from command line with https://github.com/sveltejs/eslint-plugin-svelte3 and works great.
If a variable has as
in it's name, the as
is highlighted.
{#each assets as asset}
{/each}
I appreciate your efforts in making this plugin!
I think it's not yet right?
What is still missing to make that happen?
Addon Version: 0.10.0
PHPStorm Version: 2019.2.3
While rewriting component attributes I had an intermediate state of an empty object as attribute:
<Component {someAttribute} attr2={variable} {}><!-- some other stuff --></Component>
I then get multiple of the following exceptions and am unable to edit my file further until i disable the plugin (even restart does not fix it).
java.lang.IllegalStateException: builder.treeBuilt.firstChildNode must not be null
at dev.blachut.svelte.lang.psi.SvelteJSLazyElementType.doParseContents(SvelteJSLazyElementType.kt:33)
at com.intellij.psi.tree.ILazyParseableElementType.parseContents(ILazyParseableElementType.java:67)
at com.intellij.psi.impl.source.tree.LazyParseableElement.lambda$ensureParsed$0(LazyParseableElement.java:198)
at com.intellij.psi.impl.DebugUtil.performPsiModification(DebugUtil.java:564)
at com.intellij.psi.impl.source.tree.LazyParseableElement.ensureParsed(LazyParseableElement.java:197)
at com.intellij.psi.impl.source.tree.LazyParseableElement.getFirstChildNode(LazyParseableElement.java:246)
at com.intellij.psi.impl.source.tree.LazyParseableElement.getFirstChildNode(LazyParseableElement.java:40)
at com.intellij.psi.impl.source.tree.ASTStructure.getChildren(ASTStructure.java:47)
at com.intellij.psi.impl.BlockSupportImpl$4.getChildren(BlockSupportImpl.java:383)
at com.intellij.psi.impl.BlockSupportImpl$4.getChildren(BlockSupportImpl.java:379)
at com.intellij.util.diff.DiffTree.build(DiffTree.java:105)
at com.intellij.util.diff.DiffTree.build(DiffTree.java:144)
at com.intellij.util.diff.DiffTree.build(DiffTree.java:144)
at com.intellij.util.diff.DiffTree.build(DiffTree.java:144)
at com.intellij.util.diff.DiffTree.build(DiffTree.java:144)
at com.intellij.util.diff.DiffTree.build(DiffTree.java:144)
at com.intellij.util.diff.DiffTree.diff(DiffTree.java:61)
at com.intellij.psi.impl.BlockSupportImpl.diffTrees(BlockSupportImpl.java:375)
at com.intellij.psi.impl.BlockSupportImpl.mergeTrees(BlockSupportImpl.java:364)
at com.intellij.psi.impl.BlockSupportImpl.makeFullParse(BlockSupportImpl.java:271)
at com.intellij.psi.impl.BlockSupportImpl.reparse(BlockSupportImpl.java:106)
at com.intellij.psi.impl.DocumentCommitThread.doCommit(DocumentCommitThread.java:662)
at com.intellij.psi.impl.DocumentCommitThread.lambda$commitUnderProgress$4(DocumentCommitThread.java:441)
at com.intellij.openapi.application.impl.ApplicationImpl.tryRunReadAction(ApplicationImpl.java:1106)
at com.intellij.psi.impl.DocumentCommitThread.commitUnderProgress(DocumentCommitThread.java:453)
at com.intellij.psi.impl.DocumentCommitThread.lambda$pollQueue$1(DocumentCommitThread.java:281)
at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:591)
at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:537)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:59)
at com.intellij.psi.impl.DocumentCommitThread.pollQueue(DocumentCommitThread.java:281)
at com.intellij.psi.impl.DocumentCommitThread.run(DocumentCommitThread.java:241)
at com.intellij.util.concurrency.BoundedTaskExecutor.doRun(BoundedTaskExecutor.java:207)
at com.intellij.util.concurrency.BoundedTaskExecutor.access$100(BoundedTaskExecutor.java:29)
at com.intellij.util.concurrency.BoundedTaskExecutor$1.lambda$run$0(BoundedTaskExecutor.java:185)
at com.intellij.util.ConcurrencyUtil.runUnderThreadName(ConcurrencyUtil.java:208)
at com.intellij.util.concurrency.BoundedTaskExecutor$1.run(BoundedTaskExecutor.java:181)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:834)
Minimal files to reproduce:
Component.svelte
:
<!-- Component.svelte -->
<script>
export let attribute = 0
</script>
Test.svelte
:
<!-- Test.svelte -->
<script>
import Component from './Component.svelte'
let attribute = 42
</script>
<Component {}></Component>
This is just an intermediate state of the Test.svelte
file, the goal is to have <Component {attribute}></Component>
https://svelte.dev/docs#4_Prefix_stores_with_$_to_access_their_values
import {funnelQuery} from '../stores';
<Chip color={getColor($funnelQuery, attr.id, option.value)} on:click={toggle(attr.id, option.value)}>
{option.label}
</Chip>
This is for version 0.8.0.
When I import components using their npm names it doesn't work, i.e. the IDE gives an "Unresolved Svelte component" error. Here's a minimal reproduction:
<script>
import MyComponent from "./MyComponent.svelte";
import {Router, Route} from "svelte-routing";
export let url = "";
</script>
<main>
<Header />
<Router url="{url}">
<Route path="/"><MyComponent/></Route>
</Router>
</main>
This gives "Unresolved Svelte component" error for Router
and Route
components. Notice that importing components from a file works, as does importing from svelte-routing
like the IDE suggests:
import Router from "../../node_modules/svelte-routing/src/Router.svelte";
import Route from "../../node_modules/svelte-routing/src/Route.svelte";
When re-export multiple svelte components using a js file, webstorm can't recognize component.
example: https://svelte.dev/repl/e66018598e614b5d874a28fb9fa4ac62?version=3.7.1
dev.blachut.svelte.lang.codeInsight.SvelteTagProvider#getDescriptor
should return implementation of XmlElementDescriptor
. Could reuse or enhance SvelteComponentTagDescriptor
if possible. Descriptor should return available props in getAttributesDescriptors
method.
This task is unfortunately partially blocked by #2
Related to #2
Not-shorthand let
is kinda handled since 2019, there needs to be a proper support for all directives, with navigation to definition and value completions. Type checking would be also nice, but it will come later.
This is talking so long because shorthand syntax is pretty novel in terms of language support.
XmlElementDescriptor
s & XmlAttributeDescriptor
sFolding refers to those +/- signs in the gutter that allow you to collapse parts of file.
intellij-rust
repo has quite robust tests.
Work on folding tests can be based on https://github.com/intellij-rust/intellij-rust/blob/master/src/test/kotlin/org/rust/ide/folding/RsFoldingBuilderTest.kt
I want to use svelte in typescript by using svelte-ts-preprocess preprocess
It would be great to add support for <script lang="ts"></script>.
Let me know if I can help you.
Writing block opening tags should add level of indentation, and writing closing tags should unindent.
Related:
BraceMatcher
https://intellij-support.jetbrains.com/hc/en-us/community/posts/206797085-Custom-Language-How-to-make-a-closing-brace-unindent-
<form on:submit={e => User.login(e, router)}>
<label>
email
<input name="email" type="email" value="[email protected]"/>
</label>
<label>
password
<input name="password" type="password" value="secretPassword"/>
</label>
<input type="submit" value="Login"/>
</form>
It would be great if a component's exported parameters would be included in the HTML autocompletion. So f.e. if this is my component:
// MyComponent.svelte
<script>
export let foo
export let bar
</script>
When I type
<MyCom
into a consuming component and accept the autocompletion, I would then get
<MyComponent foo="" bar="" />
Some related nice-to-haves:
foo="$foo$"
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.