Git Product home page Git Product logo

bamboo-soy's Introduction

Bamboo Soy for IntelliJ ๐Ÿฎ๐Ÿฃ๐Ÿฎ

Java CI with Gradle GitHub license

The smartest Intellij plugin for the Soy templating language.

output

Adds syntax highlighting, autocompletion and static analysis for your closure template files.

Installation

Install the plugin directly from your IDE or the Jetbrains plugin repository.

Feature Summary

Bamboo Soy aims to provide super-fast, no-compromise language support for Soy in IntelliJ.

  • Syntax highlighting with complete HTML support,
  • References, go-to definition, find usage,
  • Structure view,
  • Auto-formatting,
  • Documentation lookup,
  • YCM-style autocompletion (just press Ctrl-Space anywhere to get the suggestions)
    • Template and namespace identifiers,
    • Identifiers in scope,
    • Parameters and types,
    • Keywords and literals,
  • Live templates (snippets) for xid, css, if-else, call, delcall, ...
  • Static analysis inspections for
    • Missing required or invalid parameters,
    • Unused parameters or variables,
    • Wrong usage of double quotes for Soy strings,
  • Understands and preserves doc comment structure on enter,
  • Latest syntax support (@inject, xid and css function expressions, ...),

As a bonus, the parser was designed to support incomplete code constructs & unbalanced tags (things donโ€™t break when you type).

Release notes

See the release notes page.

Contributing

Small and large contributions welcome! For new features or substantial changes, please open an issue beforehand so that it can be discussed.

For all the details, see the contributing page.

bamboo-soy's People

Contributors

crdev avatar denesalmasi avatar thso avatar tntim96 avatar ulitink avatar yorlov 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

bamboo-soy's Issues

<!-- HTML Comments --> Stop all future highlights

It looks like the highlighter is being greedy when highlighting HTML comments using instead of finding the first closing brace it looks to the last occurrence of a closing brace for the comment
image

Indexing times outs when Bamboo is installed.

When I load my IDE it stalls while indexing if I have bamboo installed. Not sure what caused this to trigger but the only way I can seemingly fix this is by uninstalling bamboo :'(

Add "Quick Fix" for adding missing required parameters

When a template function call is missing required parameters

{template .foo}
  {@param a: int}
  {@param b: text}
{/template}

{template .other}
  {let $a: 42 /}

  {call .foo<caret>}
  {/call}
{/template}

a quick fix should add them

{template .other}
  {let $a: 42 /}
  {call .foo}
    {param a: $a /}
    {param b kind="text"}
    
    {/param}
  {/call}
{/template}

Notes:

  • Default is to add the block parameter composed of open and close tags,
  • If there is variable in scope with a name that matches one of the parameters then create a self-closing parameter tag that passes through that variable

Treating "css" in "cssUrl" as a keyword

So, screenshot. The plugin reports an error to IntelliJ while the actual run was fine. I think it thinks the css in cssUrl as a {css} command somehow.

Bamboo Soy version: 1.3
IntelliJ version: 2017.3.2 Community Edition

Private templates should not be suggested

Completion suggestions currently include private templates like

{template foo_ visibility="private"}
  ...
{/template}

This functionality should ideally be based on the visibility="private" marked, but I think it might just be fine use the trailing underscore if easier to implement.

Literal tag parsing broken

The following minimal template fails to parse:
{template .foo}
{literal}{/literal}
^^^^^^^
{/template}

Build correct AST tree for expressions.

The parser should

  1. Never expect a keyword after ., $ or ?.
  2. Build a correct AST tree for expressions with respect to operator precedence.
  3. Be more readable.

Exception

In file: file:///something.soy: com.intellij.psi.impl.source.tree.LeafPsiElement cannot be cast to com.google.bamboo.soy.elements.TagElement

Assertion failed: Too many element types registered. Out of (short) range.

Running on test monster project with 20k Soy files.

Assertion failed: Too many element types registered. Out of (short) range.
java.lang.Throwable
	at com.intellij.openapi.diagnostic.Logger.assertTrue(Logger.java:168)
	at com.intellij.psi.tree.IElementType.<init>(IElementType.java:107)
	at com.intellij.psi.tree.IElementType.<init>(IElementType.java:90)
	at com.intellij.psi.tree.ILazyParseableElementType.<init>(ILazyParseableElementType.java:43)
	at com.intellij.psi.tree.IFileElementType.<init>(IFileElementType.java:34)
	at com.intellij.psi.templateLanguages.TemplateDataElementType.<init>(TemplateDataElementType.java:60)
	at com.google.bamboo.soy.file.SoyFileViewProvider.createFile(SoyFileViewProvider.java:118)
	at com.intellij.psi.MultiplePsiFilesPerDocumentFileViewProvider.getPsiInner(MultiplePsiFilesPerDocumentFileViewProvider.java:92)
	at com.intellij.psi.SingleRootFileViewProvider.getPsi(SingleRootFileViewProvider.java:157)
	at com.intellij.psi.stubs.StubTreeBuilder.getStubbedRoots(StubTreeBuilder.java:130)
	at com.intellij.psi.impl.source.PsiFileImpl.getStubTree(PsiFileImpl.java:690)
	at com.intellij.psi.stubs.StubProcessingHelperBase.processStubsInFile(StubProcessingHelperBase.java:72)
	at com.intellij.psi.stubs.StubProcessingHelperBase.processStubsInFile(StubProcessingHelperBase.java:52)
	at com.intellij.psi.stubs.StubIndexImpl$2.process(StubIndexImpl.java:324)

Namespace formatting is not indented

Source code:

{namespace bamboo.panda.soy.panda autoescape="strict"
    requirecss="bamboo.panda"}

Is auto formatted to:

{namespace bamboo.panda.soy.panda autoescape="strict"
requirecss="bamboo.panda"}

What I'd expect is:

{namespace bamboo.panda.soy.panda autoescape="strict"
    requirecss="bamboo.panda"}

5-4 not parsed correctly.

There are 3 different ways "-4" may be interpreted in different contexts:

  1. A CSS identifier: {css -4}
  2. A number: {-4}
  3. An operator and a number: {5-4}

The latter 2 may be resolved as always being interpreted as "an operator and a number" but then the valid CSS identifier "-4" would be a longer match in lexer.

Plugin seems to be adding an extra ")" to python methods on

Not sure why, but I opened the following issue with the EAR release of Pycharm

https://youtrack.jetbrains.com/issue/PY-30890

where when I type a method (in a python file) and hit tab to autocomplete, it takes the method and adds a ")", so I type:

class test(object):
def foo(

and hit [TAB], and it ends up looking like this:

class test(object):
def foo(self):)

The plugin version I am using is: v1.3

The version of pycharm I am using is:
PyCharm 2018.2 (Professional Edition)
Build #PY-182.3684.58, built on July 18, 2018
Licensed to Dan Strohl
Subscription is active until December 6, 2018
JRE: 1.8.0_152-release-1248-b8 amd64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Windows 10 10.0

(there is a video posted at the pycharm issue linked above).

This was determined to be Bamboo Soy issue by de-activating the plugin, and the problem went away, re-activatin it, and the problem returns.

Hanging indentation with {call} construct is strange

Source code:

<div class="panda-shell"
        id="#panda"
    {call panda.helpers.soy.attrs /}>
</div>

Is formatted to:

<div class="panda-shell"
        id="#panda"
  {call panda.helpers.soy.attrs /}>
</div>

I'd expect:

<div class="panda-shell"
        id="#panda"
    {call panda.helpers.soy.attrs /}> /* Hanging 4 space indent */
</div>

or

<div class="panda-shell"
        id="#panda"
        {call panda.helpers.soy.attrs /}> /* Aligned to other attrs */
</div>

Closing Quote Is Added Twice

What steps will reproduce the issue?

In a Gradle module, create a .gradle file (the default build.gradle is enough).
On a new line type " (double quotation mark).
What is the expected result?
Two " symbols appear, one before the cursor and one after.

What happens instead?
Three " symbols appear, one before the cursor and two after.

IDEA build info:
IntelliJ IDEA 2018.1 (Ultimate Edition)
Build #IU-181.4203.550, built on March 26, 2018
JRE: 1.8.0_152-release-1136-b20 x86_64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Mac OS X 10.11.6

Please see the related issue in IntelliJ IDEA I've submitted earlier.

Expose "Hard wrap at" setting to avoid linebreaks with unintended side effects

Closure templates has a potentially dangerous white space collapsing policy:

Consecutive lines are joined according to the following heuristic: if the join location borders a template or HTML tag on either side, the lines are joined with no space. If the join location does not border a template or HTML tag on either side, the lines are joined with exactly one space.

Right now there's no way to disable hard-wrapping without changing the default IntelliJ setting in Editor >> Code Style >> Hard wrap at.

Example:

Before

Closure templates will render the end of this as:

... some text some text

{template .hardWrap}
<div>Welcome to Bamboo Soy page. Long text that will break at 120 columns by default some text some text some <strong>text</strong></div>
{/template}

After formatting

Closure templates will render this with a missing space:

... some text sometext

{template .hardWrap}
  <div>Welcome to Bamboo Soy page. Long text that will break at 120 columns by default some text some text some
    <strong>text</strong></div>
{/template}

Guessing the change would have to be somewhere here but I'm not sure:

protected void initTabs(CodeStyleSettings settings) {
addIndentOptionsTab(settings);
}

Proper indents for newlines.

Enter press should transform
<div><caret></div>
to

<div>
  <caret>
</div>

and
{template}<caret>{/template}
to

{template}
  <caret>
{/template}

{literal} tag doesn't detect close

The boilerplate for GA doesn't parse correctly. I get a {template} is not closed error on hover. The first {literal} command is highlighted. The second is not.

<script>
    {literal}
      window.dataLayer = window.dataLayer || [];
      function gtag(){dataLayer.push(arguments);}
      gtag('js', new Date());

      gtag('config', 'UA-YadaYada');
    {/literal}
  </script>

Error at lang.Variable.<init>

Internal report:

Seen today with Bamboo Soy 1.1.

null
java.lang.AssertionError
at com.google.bamboo.soy.lang.Variable.(Variable.java:13)
at com.google.bamboo.soy.lang.Parameter.(Parameter.java:10)
at com.google.bamboo.soy.elements.impl.AtParamMixin.toParameter(AtParamMixin.java:81)
at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)
at java.util.Iterator.forEachRemaining(Iterator.java:116)
at java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1801)
at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481)
at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471)
at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708)
at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:499)
at com.google.bamboo.soy.elements.impl.TemplateBlockMixin.getParameters(TemplateBlockMixin.java:85)
at com.google.bamboo.soy.lang.ParamUtils.getParametersForInvocation(ParamUtils.java:41)
at com.google.bamboo.soy.insight.annotators.MissingParametersAnnotator.annotate(MissingParametersAnnotator.java:46)
at com.intellij.codeInsight.daemon.impl.DefaultHighlightVisitor.a(DefaultHighlightVisitor.java:139)
at com.intellij.codeInsight.daemon.impl.DefaultHighlightVisitor.visit(DefaultHighlightVisitor.java:102)
at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.a(GeneralHighlightingPass.java:368)
at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.a(GeneralHighlightingPass.java:307)
at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.a(GeneralHighlightingPass.java:327)
at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.a(GeneralHighlightingPass.java:330)
at com.intellij.codeInsight.daemon.impl.analysis.XmlHighlightVisitor.analyze(XmlHighlightVisitor.java:634)
at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.a(GeneralHighlightingPass.java:330)
at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.a(GeneralHighlightingPass.java:330)
at com.intellij.codeInsight.daemon.impl.DefaultHighlightVisitor.analyze(DefaultHighlightVisitor.java:86)
at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.a(GeneralHighlightingPass.java:330)
at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.a(GeneralHighlightingPass.java:298)
at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.collectInformationWithProgress(GeneralHighlightingPass.java:238)
at com.intellij.codeInsight.daemon.impl.ProgressableTextEditorHighlightingPass.doCollectInformation(ProgressableTextEditorHighlightingPass.java:83)
at com.intellij.codeHighlighting.TextEditorHighlightingPass.collectInformation(TextEditorHighlightingPass.java:70)
at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.c(PassExecutorService.java:438)
at com.intellij.openapi.application.impl.ApplicationImpl.tryRunReadAction(ApplicationImpl.java:1153)
at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.d(PassExecutorService.java:431)
at com.intellij.openapi.progress.impl.CoreProgressManager.a(CoreProgressManager.java:556)
at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:501)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:66)
at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.b(PassExecutorService.java:430)
at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.a(PassExecutorService.java:406)
at com.intellij.openapi.application.impl.ReadMostlyRWLock.executeByImpatientReader(ReadMostlyRWLock.java:142)
at com.intellij.openapi.application.impl.ApplicationImpl.executeByImpatientReader(ApplicationImpl.java:242)
at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.run(PassExecutorService.java:404)
at com.intellij.concurrency.JobLauncherImpl$VoidForkJoinTask$1.exec(JobLauncherImpl.java:165)
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)

java.lang.AssertionError
at com.google.bamboo.soy.lang.Variable.(Variable.java:13)
at com.google.bamboo.soy.lang.Parameter.(Parameter.java:10)
at com.google.bamboo.soy.elements.impl.AtParamMixin.toParameter(AtParamMixin.java:81)
at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)
at java.util.Iterator.forEachRemaining(Iterator.java:116)
at java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1801)
at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481)
at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471)
at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708)
at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:499)
at com.google.bamboo.soy.elements.impl.TemplateBlockMixin.getParameters(TemplateBlockMixin.java:85)
at com.google.bamboo.soy.lang.ParamUtils.getParametersForInvocation(ParamUtils.java:41)
at com.google.bamboo.soy.insight.annotators.MissingParametersAnnotator.annotate(MissingParametersAnnotator.java:46)
at com.intellij.codeInsight.daemon.impl.DefaultHighlightVisitor.a(DefaultHighlightVisitor.java:139)
at com.intellij.codeInsight.daemon.impl.DefaultHighlightVisitor.visit(DefaultHighlightVisitor.java:102)
at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.a(GeneralHighlightingPass.java:368)
at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.a(GeneralHighlightingPass.java:307)
at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.a(GeneralHighlightingPass.java:327)
at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.a(GeneralHighlightingPass.java:330)
at com.intellij.codeInsight.daemon.impl.analysis.XmlHighlightVisitor.analyze(XmlHighlightVisitor.java:634)
at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.a(GeneralHighlightingPass.java:330)
at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.a(GeneralHighlightingPass.java:330)
at com.intellij.codeInsight.daemon.impl.DefaultHighlightVisitor.analyze(DefaultHighlightVisitor.java:86)
at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.a(GeneralHighlightingPass.java:330)
at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.a(GeneralHighlightingPass.java:298)
at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.collectInformationWithProgress(GeneralHighlightingPass.java:238)
at com.intellij.codeInsight.daemon.impl.ProgressableTextEditorHighlightingPass.doCollectInformation(ProgressableTextEditorHighlightingPass.java:83)
at com.intellij.codeHighlighting.TextEditorHighlightingPass.collectInformation(TextEditorHighlightingPass.java:70)
at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.c(PassExecutorService.java:438)
at com.intellij.openapi.application.impl.ApplicationImpl.tryRunReadAction(ApplicationImpl.java:1153)
at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.d(PassExecutorService.java:431)
at com.intellij.openapi.progress.impl.CoreProgressManager.a(CoreProgressManager.java:556)
at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:501)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:66)
at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.b(PassExecutorService.java:430)
at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.a(PassExecutorService.java:406)
at com.intellij.openapi.application.impl.ReadMostlyRWLock.executeByImpatientReader(ReadMostlyRWLock.java:142)
at com.intellij.openapi.application.impl.ApplicationImpl.executeByImpatientReader(ApplicationImpl.java:242)
at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.run(PassExecutorService.java:404)
at com.intellij.concurrency.JobLauncherImpl$VoidForkJoinTask$1.exec(JobLauncherImpl.java:165)
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)

Steps to Reproduce

Don't know what caused this. Routine soy editing. Left for lunch. Came back, saw error dialog.

Version Info

IdeaUltimate: 2017.1.1
G3Plugins: 2017.07.05.0.2
IntelliJ with Blaze: 2017.07.05.0.2

literal block causes `j.l.ClassCastException`

Hey!

I got ClassCastException while I was browsing soy files. The minimal reproducible example is:

{template .name}
  {literal}
  <p/>
  {/literal}
{/template}

Stack trace:

In file: file:///Users/serce/work/.../file.soy: com.intellij.psi.impl.source.tree.LeafPsiElement cannot be cast to com.google.bamboo.soy.elements.TagElement
java.lang.ClassCastException: com.intellij.psi.impl.source.tree.LeafPsiElement cannot be cast to com.google.bamboo.soy.elements.TagElement
	at com.google.bamboo.soy.elements.TagBlockElement.getOpeningTag(TagBlockElement.java:26)
	at com.google.bamboo.soy.insight.annotators.IncompleteBlockAnnotator.annotate(IncompleteBlockAnnotator.java:31)
	at com.intellij.codeInsight.daemon.impl.DefaultHighlightVisitor.a(DefaultHighlightVisitor.java:139)
	at com.intellij.codeInsight.daemon.impl.DefaultHighlightVisitor.visit(DefaultHighlightVisitor.java:102)
	at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.a(GeneralHighlightingPass.java:368)
	at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.a(GeneralHighlightingPass.java:301)
	at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.a(GeneralHighlightingPass.java:327)
	at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.a(GeneralHighlightingPass.java:330)
	at com.intellij.codeInsight.daemon.impl.analysis.XmlHighlightVisitor.analyze(XmlHighlightVisitor.java:634)
	at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.a(GeneralHighlightingPass.java:330)
	at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.a(GeneralHighlightingPass.java:330)
	at com.intellij.codeInsight.daemon.impl.DefaultHighlightVisitor.analyze(DefaultHighlightVisitor.java:86)
	at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.a(GeneralHighlightingPass.java:330)
	at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.a(GeneralHighlightingPass.java:298)
	at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.collectInformationWithProgress(GeneralHighlightingPass.java:238)
	at com.intellij.codeInsight.daemon.impl.ProgressableTextEditorHighlightingPass.doCollectInformation(ProgressableTextEditorHighlightingPass.java:83)
	at com.intellij.codeHighlighting.TextEditorHighlightingPass.collectInformation(TextEditorHighlightingPass.java:70)
	at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.b(PassExecutorService.java:438)
	at com.intellij.openapi.application.impl.ApplicationImpl.tryRunReadAction(ApplicationImpl.java:1160)
	at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.c(PassExecutorService.java:431)
	at com.intellij.openapi.progress.impl.CoreProgressManager.a(CoreProgressManager.java:548)
	at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:493)
	at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:94)
	at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.a(PassExecutorService.java:430)
	at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.d(PassExecutorService.java:406)
	at com.intellij.openapi.application.impl.ReadMostlyRWLock.executeByImpatientReader(ReadMostlyRWLock.java:142)
	at com.intellij.openapi.application.impl.ApplicationImpl.executeByImpatientReader(ApplicationImpl.java:249)
	at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.run(PassExecutorService.java:404)
	at com.intellij.concurrency.JobLauncherImpl$VoidForkJoinTask$1.exec(JobLauncherImpl.java:165)
	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)

My guess is that the problem caused by the presence of the literal block.

Ternary operator broken by auto-formatter

The plugin formats

{let $configObject: $specificConfigOption ? ['myOption': $specificConfigOption]: [] /}
to
{let $configObject: $specificConfigOption?['myOption': $specificConfigOption]: [] /}

which the Soy compiler can't process due to the missing spaces around ?.

Auto formatter adds leading space and/or newline to rest-of-line comment

Firstly, thanks for the great plugin! It has made soy development a lot more enjoyable.

I had a question surrounding auto formatting end-of-line comments. I've observed the following behavior:

{template .test}
   // Above soy block, has extra leading space but no newline.
  {if 1 == 1}

  {/if}

   // Above HTML, has extra leading space and extra line.

  <div></div>

  /* Working as intended. */
  {if 1 == 1}

  {/if}

  /* Working as intended. */
  <div></div>

{/template}

I know the Closure Template comments documentation mentions whitespace being required for end-of-line comments, but I don't believe it requires comments being misaligned/separated with the line they describe, as seen above.

This isn't a pressing issue as single-star comments seem to work as intended, but my preference would be to use end-of-line comments without superfluous and misaligned whitespace.

Thanks!

Q: How to import & run the plugin in IntelliJ?

Hi,
how do you import the plugin in IntelliJ and run in from there?

I chose 'Import project' and then the build.gradle file, which appears to work fine. However, I cannot run the plugin from IntelliJ afterwards (there is no pre-configured run configuration, and the "Plugin" category for new run configurations is not available).

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.