Giter VIP home page Giter VIP logo

svelte-intellij's People

Contributors

actions-user avatar aleksandrsl avatar alexander-doroshko avatar alexandrsuhinin avatar amaembo avatar anstarovoyt avatar azhebel avatar cdracm avatar chashnikov avatar christianivicevic avatar denofevil avatar develar avatar dmpanov avatar dovchinnikov avatar gregsh avatar hurricup avatar jqyp avatar jreznot avatar karollewandowski avatar martinbeentjes avatar pfz avatar piotrtomiak avatar shirotech avatar tomblachut avatar ulitink avatar unlocomqx avatar vepanimas avatar vladrassokhin avatar yanncebron avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

svelte-intellij's Issues

CSS class autocompletion

HTML templates detect and offer autocompletion for css classes in your project:

image

Svelte files don't do the same, do we know the limitations to doing this?

image

Feature Request: Option To Auto Complete Only The Tag Name (and not all available params)

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

Update compatible version for WS2019.2 EAP

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?

Error when importing a new project that uses spring-jdbc

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)

Option to *not* automatically include {} after defining an attribute on a HTML tag

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.

style attribute syntax error with curly braces

It's not really breaking, but would be good if there is a way to suppress this error.
Screen Shot 2019-11-05 at 10 46 38 am
From reading around, this is a low-level inspection that is tied to the css language itself and cannot be "turned off" by normal means, was wondering if this can be overwritten on the plugin level? Thanks.

Element Access Exception

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)

Webstorm 2019.1.4 0.9.0 error

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)

Handle attributes

  1. Attributes are highlighted as "not allowed":

image

Yes, we can add them to custom attributes in config, but maybe it is possible to automatically add them (on:*, bind:*, ... ) in .svelte files.

  1. Make "Go to declaration" possible:

image

Thanks! ๐Ÿ‘

Support for lang="scss"

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!

"Unresolved variable or type" when using script with context="module"

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?

Support Pug

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

stylelint support?

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.

Store and transitions imports not detected

Some imports are still not being detected as being used. Mainly transitions, and stores, which are not detected if using autosubscriptions with the $ sign. Btw, these two also show alerts when being used correctly:

image

Screen Shot 2019-08-05 at 22 49 28

Screen Shot 2019-08-05 at 22 49 35

Great work on this plugin, much appreciated.

PHPStorm 2018?

Hi,

any chance to have your work PHPStorm compatible ?

Enable ESLint for .svelte files

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.

IllegalStateException on empty object as attribute shorthand

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>

Importing components from npm modules doesn't work

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";

Support namespaced components

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

Support directives including shorthand notation

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.

TODO:

  • learn about stubs & indices
  • explore solutions to insert JS semantics into attribute name
  • analyse how directives interact with each other and rest of the language
  • insert JS semantics into attribute name
  • provide completions
  • design component model
  • build index of component models
  • wire up XmlElementDescriptors & XmlAttributeDescriptors

Support for lang="ts" / TypeScript

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.

Emmet is not working as expected

Can this be because of this plugin? I'm using Goland.

I haven't found out when exaclty it doesn't work. It never works inside another tag. Sometimes it doesn't even work on the root level.

Changing the File type of .svelte files back to HTML makes everything work as expected again.

emmet

Handle $: reactive label

image

Reactive label should display as keyword and don't prompt inspections. Implicit let keyword insertion in also needed.

ENHANCEMENT: prop autofill

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:

  1. the completions behave as Live Templates, with tab stops in between the quotes, e.g. foo="$foo$"
  2. the completions lay out any existing slots, or self-close the tag if there are none

syntax highlightnig bugs

image

There are 2 problems on this screenshot:

  1. {#each prhasesIds as phraseId} highlightnig wrong 'as'
  2. import of Phrase component is grey but it used on string 58

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.