Skip to content

Commit

Permalink
do not export intellij.javascript
Browse files Browse the repository at this point in the history
GitOrigin-RevId: 46e90418af541eda841f11ae8cc0239ebda1b2c1
  • Loading branch information
develar authored and intellij-monorepo-bot committed Dec 26, 2024
1 parent 602bfdd commit 5f5ff17
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
1 change: 1 addition & 0 deletions intellij.styled.components.iml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
<orderEntry type="module" module-name="intellij.platform.ide.impl" />
<orderEntry type="module" module-name="intellij.platform.lang.impl" />
<orderEntry type="module" module-name="intellij.javascript.frontback" />
<orderEntry type="module" module-name="intellij.javascript" />
<orderEntry type="module" module-name="intellij.platform.core" />
<orderEntry type="module" module-name="intellij.platform.core.ui" />
<orderEntry type="module" module-name="intellij.xml.impl" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ private const val STYLED_COMPONENTS_PACKAGE_NAME = "styled-components"

private val JS_STRING_TYPE = JSNamedTypeFactory.createStringPrimitiveType(JSTypeSource.EMPTY)

class CssPropAttributeDescriptorProvider : XmlAttributeDescriptorsProvider {
private class CssPropAttributeDescriptorProvider : XmlAttributeDescriptorsProvider {
override fun getAttributeDescriptors(tag: XmlTag?): Array<XmlAttributeDescriptor> {
if (tag != null && isCssPropSupported(tag)) {
return arrayOf(createCssPropertyDescriptor(tag))
Expand Down
14 changes: 7 additions & 7 deletions src/main/kotlin/com/intellij/styledComponents/Patterns.kt
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,17 @@ import com.intellij.util.SmartList
import com.intellij.util.containers.ContainerUtil
import java.util.*

fun taggedTemplate(name: String): ElementPattern<JSStringTemplateExpression> {
internal fun taggedTemplate(name: String): ElementPattern<JSStringTemplateExpression> {
return taggedTemplate(referenceExpression().withText(name))
}

fun taggedTemplate(tagPattern: ElementPattern<out JSExpression>): ElementPattern<JSStringTemplateExpression> {
internal fun taggedTemplate(tagPattern: ElementPattern<out JSExpression>): ElementPattern<JSStringTemplateExpression> {
return PlatformPatterns.psiElement(JSStringTemplateExpression::class.java)
.withParent(PlatformPatterns.psiElement(ES6TaggedTemplateExpression::class.java)
.withChild(tagPattern))
}

fun withReferenceName(name: String): ElementPattern<JSReferenceExpression> {
internal fun withReferenceName(name: String): ElementPattern<JSReferenceExpression> {
return referenceExpression()
.with(object : PatternCondition<JSReferenceExpression>("referenceName") {
override fun accepts(referenceExpression: JSReferenceExpression, context: ProcessingContext): Boolean {
Expand All @@ -38,18 +38,18 @@ fun withReferenceName(name: String): ElementPattern<JSReferenceExpression> {
})
}

fun referenceExpression() = PlatformPatterns.psiElement(JSReferenceExpression::class.java)!!
fun callExpression() = PlatformPatterns.psiElement(JSCallExpression::class.java)!!
internal fun referenceExpression() = PlatformPatterns.psiElement(JSReferenceExpression::class.java)!!
internal fun callExpression() = PlatformPatterns.psiElement(JSCallExpression::class.java)!!

fun withNameStartingWith(names: List<String>): ElementPattern<JSReferenceExpression> {
internal fun withNameStartingWith(names: List<String>): ElementPattern<JSReferenceExpression> {
return referenceExpression().with(object : PatternCondition<JSReferenceExpression>("nameStartingWith") {
override fun accepts(referenceExpression: JSReferenceExpression, context: ProcessingContext): Boolean {
return ContainerUtil.startsWith(getReferenceParts(referenceExpression), names)
}
})
}

fun getReferenceParts(jsReferenceExpression: JSReferenceExpression): List<String> {
internal fun getReferenceParts(jsReferenceExpression: JSReferenceExpression): List<String> {
val nameParts = SmartList<String>()

var ref: JSReferenceExpression? = jsReferenceExpression
Expand Down

0 comments on commit 5f5ff17

Please sign in to comment.