diff --git a/src/main/kotlin/com/intellij/StyledComponents/Patterns.kt b/src/main/kotlin/com/intellij/StyledComponents/Patterns.kt index dfcd44e..7e8c582 100644 --- a/src/main/kotlin/com/intellij/StyledComponents/Patterns.kt +++ b/src/main/kotlin/com/intellij/StyledComponents/Patterns.kt @@ -8,6 +8,7 @@ import com.intellij.openapi.util.text.StringUtil import com.intellij.patterns.ElementPattern import com.intellij.patterns.PatternCondition import com.intellij.patterns.PlatformPatterns +import com.intellij.psi.util.PsiTreeUtil import com.intellij.util.ProcessingContext import com.intellij.util.SmartList import com.intellij.util.containers.ContainerUtil @@ -51,7 +52,9 @@ fun getReferenceParts(jsReferenceExpression: JSReferenceExpression): List com.deadlock.scsyntax Styled Components - 1.0 + 1.0.1 Kodehouse @@ -11,8 +11,7 @@ JavaScript org.jetbrains.plugins.less React Styled Components ]]> props.primary ? 'white' : 'palevioletred'};\n" + " " + " font-size: 1em;\n" + - "`;", - "div {\n" + + "`;","div {\n" + " /* Adapt the colours based on primary prop */\n" + " background: EXTERNAL_FRAGMENT;\n" + " color: EXTERNAL_FRAGMENT;\n" + @@ -47,6 +45,15 @@ class InjectionTest : LightCodeInsightFixtureTestCase() { " color: palevioletred;\n" + "}") } + + fun testComplexExpression2() { + doTest("const ContactMenuIcon = ((styled(Icon)))" + + ".attrs({ iconName: 'contact_card' })`\n" + + " line-height: 0;\n" + + "`", "div {\n" + + " line-height: 0;\n" + + "}") + } fun testKeyframes() { doTest("const rotate360 = keyframes`\n" + diff --git a/webstorm-styled-components.zip b/webstorm-styled-components.zip index 1a515ea..7e3ffc8 100644 Binary files a/webstorm-styled-components.zip and b/webstorm-styled-components.zip differ