initial commit
This commit is contained in:
@@ -5,7 +5,7 @@ import com.intellij.psi.TokenType
|
||||
import com.intellij.psi.impl.source.codeStyle.SemanticEditorPosition.SyntaxElement
|
||||
import com.intellij.psi.impl.source.codeStyle.lineIndent.JavaLikeLangLineIndentProvider
|
||||
import com.intellij.psi.tree.IElementType
|
||||
import me.zhouxi.slint.lang.Slint
|
||||
import me.zhouxi.slint.lang.SlintLanguage
|
||||
import me.zhouxi.slint.lang.psi.SlintTypes
|
||||
|
||||
class SlintLineIndentProvider : JavaLikeLangLineIndentProvider() {
|
||||
@@ -16,7 +16,7 @@ class SlintLineIndentProvider : JavaLikeLangLineIndentProvider() {
|
||||
|
||||
|
||||
override fun isSuitableForLanguage(language: Language): Boolean {
|
||||
return language.isKindOf(Slint.INSTANCE)
|
||||
return language.isKindOf(SlintLanguage.INSTANCE)
|
||||
}
|
||||
|
||||
companion object {
|
||||
|
||||
@@ -12,7 +12,7 @@ import me.zhouxi.slint.lang.psi.SlintFile
|
||||
|
||||
fun createIdentifier(project: Project?, text: String): PsiElement {
|
||||
val factory = PsiFileFactory.getInstance(project)
|
||||
val file = factory.createFileFromText("dummy.slint", Slint.INSTANCE, "component $text{}") as SlintFile
|
||||
val file = factory.createFileFromText("dummy.slint", SlintLanguage.INSTANCE, "component $text{}") as SlintFile
|
||||
return file.findChildByClass(SlintComponent::class.java)!!.componentName!!.identifier
|
||||
}
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ package me.zhouxi.slint.preview
|
||||
|
||||
import com.intellij.execution.configurations.ConfigurationTypeBase
|
||||
import com.intellij.openapi.util.NotNullLazyValue
|
||||
import me.zhouxi.slint.lang.Slint
|
||||
import me.zhouxi.slint.lang.SlintLanguage
|
||||
|
||||
/**
|
||||
* @author zhouxi 2024/5/16
|
||||
@@ -11,7 +11,7 @@ object PreviewConfigurationType : ConfigurationTypeBase(
|
||||
"SlintViewerConfiguration",
|
||||
"Slint viewer",
|
||||
"Slint component preview",
|
||||
NotNullLazyValue.createValue { Slint.ICON }
|
||||
NotNullLazyValue.createValue { SlintLanguage.ICON }
|
||||
) {
|
||||
init {
|
||||
addFactory(PreviewConfigurationFactory(this))
|
||||
|
||||
@@ -3,7 +3,7 @@ package me.zhouxi.slint.preview
|
||||
import com.intellij.execution.lineMarker.ExecutorAction
|
||||
import com.intellij.execution.lineMarker.RunLineMarkerContributor
|
||||
import com.intellij.psi.PsiElement
|
||||
import me.zhouxi.slint.lang.Slint
|
||||
import me.zhouxi.slint.lang.SlintLanguage
|
||||
import me.zhouxi.slint.lang.psi.SlintComponentName
|
||||
|
||||
/**
|
||||
@@ -13,7 +13,7 @@ class PreviewRunLineMarkerContributor : RunLineMarkerContributor() {
|
||||
override fun getInfo(element: PsiElement): Info? {
|
||||
if (element.parent is SlintComponentName) {
|
||||
return Info(
|
||||
Slint.ICON, null,
|
||||
SlintLanguage.ICON, null,
|
||||
*ExecutorAction.getActions(1)
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user