diff --git a/.run/Run Generate Parser.run.xml b/.run/Run Generate Parser.run.xml
index ad88f45..f824831 100644
--- a/.run/Run Generate Parser.run.xml
+++ b/.run/Run Generate Parser.run.xml
@@ -10,7 +10,7 @@
diff --git a/build.gradle.kts b/build.gradle.kts
index 07ea489..390075e 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -68,10 +68,23 @@ koverReport {
tasks {
generateLexer {
- sourceFile = file("src/main/grammars/TLShcema.flex")
- targetDir = "src/main/gen/com/vk/tlschema"
- targetClass = "TLSchemaLexer"
- purgeOldFiles = true
+ sourceFile.set(file("src/main/grammars/TLShcema.flex"))
+ targetOutputDir.set(file("src/main/gen/com/vk/tlschema"))
+ purgeOldFiles.set(true)
+ }
+
+ generateParser {
+ dependsOn(generateLexer)
+
+ sourceFile.set(file("src/main/grammars/TLSchema.bnf"))
+ targetRootOutputDir.set(file("src/main/gen"))
+ pathToParser.set("/com/vk/tlschema/parser/TLSchemaParser.java")
+ pathToPsiRoot.set("/com/vk/tlschema/psi")
+ purgeOldFiles.set(true)
+ }
+
+ withType {
+ dependsOn(generateParser)
}
wrapper {
diff --git a/gradle.properties b/gradle.properties
index a75376e..28660ac 100644
--- a/gradle.properties
+++ b/gradle.properties
@@ -4,11 +4,11 @@ pluginGroup = com.vk.tlschema
pluginName = TL Schema Support
pluginRepositoryUrl = https://github.com/VKCOM/TL-Schema-idea-plugin
# SemVer format -> https://semver.org
-pluginVersion = 1.4.0
+pluginVersion = 1.4.1
# Supported build number ranges and IntelliJ Platform versions -> https://plugins.jetbrains.com/docs/intellij/build-number-ranges.html
pluginSinceBuild = 223
-pluginUntilBuild = 233.*
+pluginUntilBuild =
# IntelliJ Platform Properties -> https://plugins.jetbrains.com/docs/intellij/tools-gradle-intellij-plugin.html#configuration-intellij-extension
platformType = IC
diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml
index 219daa9..0384615 100644
--- a/gradle/libs.versions.toml
+++ b/gradle/libs.versions.toml
@@ -7,7 +7,7 @@ kotlin = "1.9.21"
changelog = "2.2.0"
gradleIntelliJPlugin = "1.16.1"
kover = "0.7.5"
-grammarkit = "2022.3.2.1"
+grammarkit = "2022.3.2.2"
[libraries]
annotations = { group = "org.jetbrains", name = "annotations", version.ref = "annotations" }
diff --git a/src/main/grammars/TLSchema.bnf b/src/main/grammars/TLSchema.bnf
index 34fb509..1b7967e 100644
--- a/src/main/grammars/TLSchema.bnf
+++ b/src/main/grammars/TLSchema.bnf
@@ -11,12 +11,10 @@
elementTypeHolderClass="com.vk.tlschema.psi.TLSchemaTypes"
elementTypeClass="com.vk.tlschema.psi.TLSchemaElementType"
tokenTypeClass="com.vk.tlschema.psi.TLSchemaTokenType"
-
- psiImplUtilClass="com.vk.tlschema.psi.impl.TLSchemaPsiImplUtil"
}
-TLShemaFile ::= constructor_declarations [ ((TRIPPLE_MINUS FUNCTIONS_KW TRIPPLE_MINUS fun_declarations) | (TRIPPLE_MINUS TYPES_KW TRIPPLE_MINUS constructor_declarations)) *]
+TLSchemaFile ::= constructor_declarations [ ((TRIPPLE_MINUS FUNCTIONS_KW TRIPPLE_MINUS fun_declarations) | (TRIPPLE_MINUS TYPES_KW TRIPPLE_MINUS constructor_declarations)) *]
comment_node ::= COMMENT
@@ -26,20 +24,42 @@ lc_ident_node ::= LC_IDENT
attribute_node ::= ATTRIBUTE;
namespace_ident ::= LC_IDENT
+
lc_ident_ns ::= [ namespace_ident DOT ] lc_ident_node {
- mixin="com.vk.tlschema.psi.impl.TLSchemaNamedElementImpl"
- implements="com.vk.tlschema.psi.TLSchemaNamedElement"
- methods=[getName setName getReference getReferences getPresentation getDeclaration]}
+ implements=[
+ "com.vk.tlschema.psi.TLSchemaNamedElement"
+ "com.vk.tlschema.psi.TLSchemaDeclarationBase"
+ ]
+ mixin="com.vk.tlschema.psi.mixins.TLSchemaLcIdentNsMixin"
+}
+
uc_ident_ns ::= [ namespace_ident DOT ] uc_ident_node {
- mixin="com.vk.tlschema.psi.impl.TLSchemaNamedElementImpl"
- implements="com.vk.tlschema.psi.TLSchemaNamedElement"
- methods=[getName setName getReference getReferences getPresentation getDeclaration]}
-lc_ident_full ::= lc_ident_ns [ SHARP_HEX_NUMBER ] {methods=[getDeclaration]}
+ implements=[
+ "com.vk.tlschema.psi.TLSchemaNamedElement"
+ "com.vk.tlschema.psi.TLSchemaDeclarationBase"
+ ]
+ mixin="com.vk.tlschema.psi.mixins.TLSchemaUcIdentNsMixin"
+}
+
+lc_ident_full ::= lc_ident_ns [ SHARP_HEX_NUMBER ] {
+ implements="com.vk.tlschema.psi.TLSchemaDeclarationBase"
+ mixin="com.vk.tlschema.psi.mixins.TLSchemaLcIdentFullMixin"
+}
+
+constructor_declarations ::= [ declaration * ] {
+ implements="com.vk.tlschema.psi.TLSchemaNamespacesElement"
+ mixin="com.vk.tlschema.psi.mixins.TLSchemaConstructorDeclarationsMixin"
+}
-constructor_declarations ::= [ declaration * ] {methods=[getNamespaces]}
-fun_declarations ::= [ declaration * ] {methods=[getNamespaces]}
+fun_declarations ::= [ declaration * ] {
+ implements="com.vk.tlschema.psi.TLSchemaNamespacesElement"
+ mixin="com.vk.tlschema.psi.mixins.TLSchemaFunDeclarationsMixin"
+}
-declaration ::= combinator_decl | combinator_decl_builtin {methods=[getCombinator getResultType getNumVars getTypeVars haveConditionalArgs getNamespace]}
+declaration ::= combinator_decl | combinator_decl_builtin {
+ implements="com.vk.tlschema.psi.TLSchemaDeclarationElement"
+ mixin="com.vk.tlschema.psi.mixins.TLSchemaDeclarationMixin"
+}
combinator_decl_builtin ::= combinator_decl_builtin_type;
@@ -55,10 +75,15 @@ type_with_triangle_braces ::= type_ident LEQ type_expr [ (COMA type_expr) * ] GE
percent_term ::= PERCENT term
type_ident ::= boxed_type_ident | lc_ident_ns | SHARP
boxed_type_ident ::= uc_ident_ns
+
var_ident ::= lc_ident_node | uc_ident_node {
- mixin="com.vk.tlschema.psi.impl.TLSchemaNamedElementImpl"
- implements="com.vk.tlschema.psi.TLSchemaNamedElement"
- methods=[getName setName getReference getReferences getPresentation getDeclaration]}
+ implements=[
+ "com.vk.tlschema.psi.TLSchemaNamedElement"
+ "com.vk.tlschema.psi.TLSchemaDeclarationBase"
+ ]
+ mixin="com.vk.tlschema.psi.mixins.TLSchemaVarIdentMixin"
+}
+
type_term ::= term
nat_term ::= nat_expr
@@ -75,4 +100,8 @@ type_term_exc ::= type_term | EXCMARK type_term
multiplicity ::= nat_term
var_ident_opt ::= var_ident | UNDERSCORE
conditional_def ::= var_ident [ DOT NAT_CONST ] QMARK
-result_type ::= (boxed_type_ident LEQ type_expr [ (COMA type_expr ) * ] GEQ) | (boxed_type_ident [type_expr]) {methods=[getDeclaration]}
\ No newline at end of file
+
+result_type ::= (boxed_type_ident LEQ type_expr [ (COMA type_expr ) * ] GEQ) | (boxed_type_ident [type_expr]) {
+ implements="com.vk.tlschema.psi.TLSchemaDeclarationBase"
+ mixin="com.vk.tlschema.psi.mixins.TLSchemaResultTypeMixin"
+}
diff --git a/src/main/java/com/vk/tlschema/psi/TLSchemaNamedElement.java b/src/main/java/com/vk/tlschema/psi/TLSchemaNamedElement.java
deleted file mode 100644
index 6b8da0a..0000000
--- a/src/main/java/com/vk/tlschema/psi/TLSchemaNamedElement.java
+++ /dev/null
@@ -1,7 +0,0 @@
-package com.vk.tlschema.psi;
-
-import com.intellij.navigation.NavigationItem;
-import com.intellij.psi.PsiNamedElement;
-
-public interface TLSchemaNamedElement extends PsiNamedElement, NavigationItem {
-}
\ No newline at end of file
diff --git a/src/main/java/com/vk/tlschema/psi/impl/TLSchemaNamedElementImpl.java b/src/main/java/com/vk/tlschema/psi/impl/TLSchemaNamedElementImpl.java
deleted file mode 100644
index aa61cfe..0000000
--- a/src/main/java/com/vk/tlschema/psi/impl/TLSchemaNamedElementImpl.java
+++ /dev/null
@@ -1,12 +0,0 @@
-package com.vk.tlschema.psi.impl;
-
-import com.intellij.extapi.psi.ASTWrapperPsiElement;
-import com.intellij.lang.ASTNode;
-import com.vk.tlschema.psi.TLSchemaNamedElement;
-import org.jetbrains.annotations.NotNull;
-
-public abstract class TLSchemaNamedElementImpl extends ASTWrapperPsiElement implements TLSchemaNamedElement {
- public TLSchemaNamedElementImpl(@NotNull ASTNode node) {
- super(node);
- }
-}
\ No newline at end of file
diff --git a/src/main/java/com/vk/tlschema/psi/impl/TLSchemaPsiImplUtil.java b/src/main/java/com/vk/tlschema/psi/impl/TLSchemaPsiImplUtil.java
index 1238fed..f3b81f6 100644
--- a/src/main/java/com/vk/tlschema/psi/impl/TLSchemaPsiImplUtil.java
+++ b/src/main/java/com/vk/tlschema/psi/impl/TLSchemaPsiImplUtil.java
@@ -17,7 +17,9 @@
import java.util.List;
import java.util.Set;
+@Deprecated
public class TLSchemaPsiImplUtil {
+ @Nullable
public static TLSchemaLcIdentNs getCombinator(TLSchemaDeclaration decl) {
TLSchemaFullCombinatorId type;
if (decl.getCombinatorDecl() != null) {
@@ -37,6 +39,7 @@ public static TLSchemaLcIdentNs getCombinator(TLSchemaDeclaration decl) {
}
}
+ @Nullable
public static List getNumVars(TLSchemaDeclaration _decl) {
if (_decl.getCombinatorDeclBuiltin() != null) {
return null;
@@ -87,7 +90,7 @@ public static boolean haveConditionalArgs(TLSchemaDeclaration _decl) {
return false;
}
-
+ @Nullable
public static List getTypeVars(TLSchemaDeclaration _decl) {
if (_decl.getCombinatorDeclBuiltin() != null) {
return null;
@@ -123,6 +126,7 @@ public static TLSchemaResultType getResultType(TLSchemaDeclaration decl) {
return type;
}
+ @Nullable
public static TLSchemaDeclaration getDeclaration(@NotNull PsiElement element) {
return PsiTreeUtil.getParentOfType(element, TLSchemaDeclaration.class);
}
@@ -183,6 +187,7 @@ public static PsiReference[] getReferences(PsiElement element) {
return ReferenceProvidersRegistry.getReferencesFromProviders(element);
}
+ @Nullable
public static PsiReference getReference(PsiElement element) {
PsiReference[] references = getReferences(element);
return references.length == 1 ? references[0] : null;
@@ -256,4 +261,4 @@ public Icon getIcon(boolean unused) {
}
};
}
-}
\ No newline at end of file
+}
diff --git a/src/main/kotlin/com/vk/tlschema/highlighting/TLSchemaBreadcrumbsProvider.kt b/src/main/kotlin/com/vk/tlschema/highlighting/TLSchemaBreadcrumbsProvider.kt
index 7452f4b..82b4904 100644
--- a/src/main/kotlin/com/vk/tlschema/highlighting/TLSchemaBreadcrumbsProvider.kt
+++ b/src/main/kotlin/com/vk/tlschema/highlighting/TLSchemaBreadcrumbsProvider.kt
@@ -21,7 +21,7 @@ class TLSchemaBreadcrumbsProvider : BreadcrumbsProvider {
override fun getElementInfo(element: PsiElement): String = when (element) {
is TLSchemaFunDeclarations -> "functions"
is TLSchemaConstructorDeclarations -> "types"
- is TLSchemaDeclaration -> element.getCombinator().getName()!!
+ is TLSchemaDeclaration -> element.getCombinator()?.getName()!!
else -> throw IllegalArgumentException("Not supported")
}
}
diff --git a/src/main/kotlin/com/vk/tlschema/psi/TLSchemaDeclarationBase.kt b/src/main/kotlin/com/vk/tlschema/psi/TLSchemaDeclarationBase.kt
new file mode 100644
index 0000000..f1db6e1
--- /dev/null
+++ b/src/main/kotlin/com/vk/tlschema/psi/TLSchemaDeclarationBase.kt
@@ -0,0 +1,5 @@
+package com.vk.tlschema.psi
+
+interface TLSchemaDeclarationBase : TLSchemaElement {
+ fun getDeclaration(): TLSchemaDeclaration?
+}
diff --git a/src/main/kotlin/com/vk/tlschema/psi/TLSchemaDeclarationElement.kt b/src/main/kotlin/com/vk/tlschema/psi/TLSchemaDeclarationElement.kt
new file mode 100644
index 0000000..006a773
--- /dev/null
+++ b/src/main/kotlin/com/vk/tlschema/psi/TLSchemaDeclarationElement.kt
@@ -0,0 +1,15 @@
+package com.vk.tlschema.psi
+
+interface TLSchemaDeclarationElement : TLSchemaElement {
+ fun getCombinator(): TLSchemaLcIdentNs?
+
+ fun getResultType(): TLSchemaResultType
+
+ fun getNumVars(): List?
+
+ fun getTypeVars(): List?
+
+ fun haveConditionalArgs(): Boolean
+
+ fun getNamespace(): String
+}
diff --git a/src/main/kotlin/com/vk/tlschema/psi/TLSchemaElement.kt b/src/main/kotlin/com/vk/tlschema/psi/TLSchemaElement.kt
new file mode 100644
index 0000000..e546f1e
--- /dev/null
+++ b/src/main/kotlin/com/vk/tlschema/psi/TLSchemaElement.kt
@@ -0,0 +1,5 @@
+package com.vk.tlschema.psi
+
+import com.intellij.psi.PsiElement
+
+interface TLSchemaElement : PsiElement
diff --git a/src/main/kotlin/com/vk/tlschema/psi/TLSchemaNamedElement.kt b/src/main/kotlin/com/vk/tlschema/psi/TLSchemaNamedElement.kt
new file mode 100644
index 0000000..f8ab8c3
--- /dev/null
+++ b/src/main/kotlin/com/vk/tlschema/psi/TLSchemaNamedElement.kt
@@ -0,0 +1,19 @@
+package com.vk.tlschema.psi
+
+import com.intellij.navigation.ItemPresentation
+import com.intellij.navigation.NavigationItem
+import com.intellij.psi.PsiElement
+import com.intellij.psi.PsiNamedElement
+import com.intellij.psi.PsiReference
+
+interface TLSchemaNamedElement : TLSchemaElement, PsiNamedElement, NavigationItem {
+ override fun getName(): String?
+
+ override fun setName(newName: String): PsiElement
+
+ override fun getReference(): PsiReference?
+
+ override fun getReferences(): Array
+
+ override fun getPresentation(): ItemPresentation?
+}
diff --git a/src/main/kotlin/com/vk/tlschema/psi/TLSchemaNamespacesElement.kt b/src/main/kotlin/com/vk/tlschema/psi/TLSchemaNamespacesElement.kt
new file mode 100644
index 0000000..04efd0c
--- /dev/null
+++ b/src/main/kotlin/com/vk/tlschema/psi/TLSchemaNamespacesElement.kt
@@ -0,0 +1,5 @@
+package com.vk.tlschema.psi
+
+interface TLSchemaNamespacesElement : TLSchemaElement {
+ fun getNamespaces(result: Set)
+}
diff --git a/src/main/kotlin/com/vk/tlschema/psi/mixins/TLSchemaConstructorDeclarationsMixin.kt b/src/main/kotlin/com/vk/tlschema/psi/mixins/TLSchemaConstructorDeclarationsMixin.kt
new file mode 100644
index 0000000..6931693
--- /dev/null
+++ b/src/main/kotlin/com/vk/tlschema/psi/mixins/TLSchemaConstructorDeclarationsMixin.kt
@@ -0,0 +1,12 @@
+package com.vk.tlschema.psi.mixins
+
+import com.intellij.lang.ASTNode
+import com.vk.tlschema.psi.TLSchemaConstructorDeclarations
+import com.vk.tlschema.psi.impl.TLSchemaPsiImplUtil
+
+internal abstract class TLSchemaConstructorDeclarationsMixin(node: ASTNode) :
+ TLSchemaElementMixin(node), TLSchemaConstructorDeclarations {
+ override fun getNamespaces(result: Set) {
+ TLSchemaPsiImplUtil.getNamespaces(this, result)
+ }
+}
diff --git a/src/main/kotlin/com/vk/tlschema/psi/mixins/TLSchemaDeclarationMixin.kt b/src/main/kotlin/com/vk/tlschema/psi/mixins/TLSchemaDeclarationMixin.kt
new file mode 100644
index 0000000..81b0a0a
--- /dev/null
+++ b/src/main/kotlin/com/vk/tlschema/psi/mixins/TLSchemaDeclarationMixin.kt
@@ -0,0 +1,34 @@
+package com.vk.tlschema.psi.mixins
+
+import com.intellij.lang.ASTNode
+import com.vk.tlschema.psi.TLSchemaDeclaration
+import com.vk.tlschema.psi.TLSchemaLcIdentNs
+import com.vk.tlschema.psi.TLSchemaResultType
+import com.vk.tlschema.psi.TLSchemaVarIdent
+import com.vk.tlschema.psi.impl.TLSchemaPsiImplUtil
+
+internal abstract class TLSchemaDeclarationMixin(node: ASTNode) : TLSchemaElementMixin(node), TLSchemaDeclaration {
+ override fun getCombinator(): TLSchemaLcIdentNs? {
+ return TLSchemaPsiImplUtil.getCombinator(this)
+ }
+
+ override fun getResultType(): TLSchemaResultType {
+ return TLSchemaPsiImplUtil.getResultType(this)
+ }
+
+ override fun getNumVars(): List? {
+ return TLSchemaPsiImplUtil.getNumVars(this)
+ }
+
+ override fun getTypeVars(): List? {
+ return TLSchemaPsiImplUtil.getTypeVars(this)
+ }
+
+ override fun haveConditionalArgs(): Boolean {
+ return TLSchemaPsiImplUtil.haveConditionalArgs(this)
+ }
+
+ override fun getNamespace(): String {
+ return TLSchemaPsiImplUtil.getNamespace(this)
+ }
+}
diff --git a/src/main/kotlin/com/vk/tlschema/psi/mixins/TLSchemaElementMixin.kt b/src/main/kotlin/com/vk/tlschema/psi/mixins/TLSchemaElementMixin.kt
new file mode 100644
index 0000000..9a5f8ee
--- /dev/null
+++ b/src/main/kotlin/com/vk/tlschema/psi/mixins/TLSchemaElementMixin.kt
@@ -0,0 +1,7 @@
+package com.vk.tlschema.psi.mixins
+
+import com.intellij.extapi.psi.ASTWrapperPsiElement
+import com.intellij.lang.ASTNode
+import com.vk.tlschema.psi.TLSchemaElement
+
+internal abstract class TLSchemaElementMixin(node: ASTNode) : ASTWrapperPsiElement(node), TLSchemaElement
diff --git a/src/main/kotlin/com/vk/tlschema/psi/mixins/TLSchemaFunDeclarationsMixin.kt b/src/main/kotlin/com/vk/tlschema/psi/mixins/TLSchemaFunDeclarationsMixin.kt
new file mode 100644
index 0000000..ab304e9
--- /dev/null
+++ b/src/main/kotlin/com/vk/tlschema/psi/mixins/TLSchemaFunDeclarationsMixin.kt
@@ -0,0 +1,12 @@
+package com.vk.tlschema.psi.mixins
+
+import com.intellij.lang.ASTNode
+import com.vk.tlschema.psi.TLSchemaFunDeclarations
+import com.vk.tlschema.psi.impl.TLSchemaPsiImplUtil
+
+internal abstract class TLSchemaFunDeclarationsMixin(node: ASTNode) :
+ TLSchemaElementMixin(node), TLSchemaFunDeclarations {
+ override fun getNamespaces(result: Set) {
+ TLSchemaPsiImplUtil.getNamespaces(this, result)
+ }
+}
diff --git a/src/main/kotlin/com/vk/tlschema/psi/mixins/TLSchemaLcIdentFullMixin.kt b/src/main/kotlin/com/vk/tlschema/psi/mixins/TLSchemaLcIdentFullMixin.kt
new file mode 100644
index 0000000..4e94747
--- /dev/null
+++ b/src/main/kotlin/com/vk/tlschema/psi/mixins/TLSchemaLcIdentFullMixin.kt
@@ -0,0 +1,12 @@
+package com.vk.tlschema.psi.mixins
+
+import com.intellij.lang.ASTNode
+import com.vk.tlschema.psi.TLSchemaDeclaration
+import com.vk.tlschema.psi.TLSchemaLcIdentFull
+import com.vk.tlschema.psi.impl.TLSchemaPsiImplUtil
+
+internal abstract class TLSchemaLcIdentFullMixin(node: ASTNode) : TLSchemaElementMixin(node), TLSchemaLcIdentFull {
+ override fun getDeclaration(): TLSchemaDeclaration? {
+ return TLSchemaPsiImplUtil.getDeclaration(this)
+ }
+}
diff --git a/src/main/kotlin/com/vk/tlschema/psi/mixins/TLSchemaLcIdentNsMixin.kt b/src/main/kotlin/com/vk/tlschema/psi/mixins/TLSchemaLcIdentNsMixin.kt
new file mode 100644
index 0000000..8141ea8
--- /dev/null
+++ b/src/main/kotlin/com/vk/tlschema/psi/mixins/TLSchemaLcIdentNsMixin.kt
@@ -0,0 +1,35 @@
+package com.vk.tlschema.psi.mixins
+
+import com.intellij.lang.ASTNode
+import com.intellij.navigation.ItemPresentation
+import com.intellij.psi.PsiElement
+import com.intellij.psi.PsiReference
+import com.vk.tlschema.psi.TLSchemaDeclaration
+import com.vk.tlschema.psi.TLSchemaLcIdentNs
+import com.vk.tlschema.psi.impl.TLSchemaPsiImplUtil
+
+internal abstract class TLSchemaLcIdentNsMixin(node: ASTNode) : TLSchemaElementMixin(node), TLSchemaLcIdentNs {
+ override fun setName(newName: String): PsiElement {
+ return TLSchemaPsiImplUtil.setName(this, newName)
+ }
+
+ override fun getName(): String? {
+ return TLSchemaPsiImplUtil.getName(this)
+ }
+
+ override fun getDeclaration(): TLSchemaDeclaration? {
+ return TLSchemaPsiImplUtil.getDeclaration(this)
+ }
+
+ override fun getReference(): PsiReference? {
+ return TLSchemaPsiImplUtil.getReference(this)
+ }
+
+ override fun getReferences(): Array {
+ return TLSchemaPsiImplUtil.getReferences(this)
+ }
+
+ override fun getPresentation(): ItemPresentation? {
+ return TLSchemaPsiImplUtil.getPresentation(this)
+ }
+}
diff --git a/src/main/kotlin/com/vk/tlschema/psi/mixins/TLSchemaResultTypeMixin.kt b/src/main/kotlin/com/vk/tlschema/psi/mixins/TLSchemaResultTypeMixin.kt
new file mode 100644
index 0000000..324b261
--- /dev/null
+++ b/src/main/kotlin/com/vk/tlschema/psi/mixins/TLSchemaResultTypeMixin.kt
@@ -0,0 +1,12 @@
+package com.vk.tlschema.psi.mixins
+
+import com.intellij.lang.ASTNode
+import com.vk.tlschema.psi.TLSchemaDeclaration
+import com.vk.tlschema.psi.TLSchemaResultType
+import com.vk.tlschema.psi.impl.TLSchemaPsiImplUtil
+
+internal abstract class TLSchemaResultTypeMixin(node: ASTNode) : TLSchemaElementMixin(node), TLSchemaResultType {
+ override fun getDeclaration(): TLSchemaDeclaration? {
+ return TLSchemaPsiImplUtil.getDeclaration(this)
+ }
+}
diff --git a/src/main/kotlin/com/vk/tlschema/psi/mixins/TLSchemaUcIdentNsMixin.kt b/src/main/kotlin/com/vk/tlschema/psi/mixins/TLSchemaUcIdentNsMixin.kt
new file mode 100644
index 0000000..42f8d9c
--- /dev/null
+++ b/src/main/kotlin/com/vk/tlschema/psi/mixins/TLSchemaUcIdentNsMixin.kt
@@ -0,0 +1,35 @@
+package com.vk.tlschema.psi.mixins
+
+import com.intellij.lang.ASTNode
+import com.intellij.navigation.ItemPresentation
+import com.intellij.psi.PsiElement
+import com.intellij.psi.PsiReference
+import com.vk.tlschema.psi.TLSchemaDeclaration
+import com.vk.tlschema.psi.TLSchemaUcIdentNs
+import com.vk.tlschema.psi.impl.TLSchemaPsiImplUtil
+
+internal abstract class TLSchemaUcIdentNsMixin(node: ASTNode) : TLSchemaElementMixin(node), TLSchemaUcIdentNs {
+ override fun setName(newName: String): PsiElement {
+ return TLSchemaPsiImplUtil.setName(this, newName)
+ }
+
+ override fun getName(): String? {
+ return TLSchemaPsiImplUtil.getName(this)
+ }
+
+ override fun getDeclaration(): TLSchemaDeclaration? {
+ return TLSchemaPsiImplUtil.getDeclaration(this)
+ }
+
+ override fun getReference(): PsiReference? {
+ return TLSchemaPsiImplUtil.getReference(this)
+ }
+
+ override fun getReferences(): Array {
+ return TLSchemaPsiImplUtil.getReferences(this)
+ }
+
+ override fun getPresentation(): ItemPresentation? {
+ return TLSchemaPsiImplUtil.getPresentation(this)
+ }
+}
diff --git a/src/main/kotlin/com/vk/tlschema/psi/mixins/TLSchemaVarIdentMixin.kt b/src/main/kotlin/com/vk/tlschema/psi/mixins/TLSchemaVarIdentMixin.kt
new file mode 100644
index 0000000..3e77324
--- /dev/null
+++ b/src/main/kotlin/com/vk/tlschema/psi/mixins/TLSchemaVarIdentMixin.kt
@@ -0,0 +1,35 @@
+package com.vk.tlschema.psi.mixins
+
+import com.intellij.lang.ASTNode
+import com.intellij.navigation.ItemPresentation
+import com.intellij.psi.PsiElement
+import com.intellij.psi.PsiReference
+import com.vk.tlschema.psi.TLSchemaDeclaration
+import com.vk.tlschema.psi.TLSchemaVarIdent
+import com.vk.tlschema.psi.impl.TLSchemaPsiImplUtil
+
+internal abstract class TLSchemaVarIdentMixin(node: ASTNode) : TLSchemaElementMixin(node), TLSchemaVarIdent {
+ override fun setName(newName: String): PsiElement {
+ return TLSchemaPsiImplUtil.setName(this, newName)
+ }
+
+ override fun getName(): String? {
+ return TLSchemaPsiImplUtil.getName(this)
+ }
+
+ override fun getDeclaration(): TLSchemaDeclaration? {
+ return TLSchemaPsiImplUtil.getDeclaration(this)
+ }
+
+ override fun getReference(): PsiReference? {
+ return TLSchemaPsiImplUtil.getReference(this)
+ }
+
+ override fun getReferences(): Array {
+ return TLSchemaPsiImplUtil.getReferences(this)
+ }
+
+ override fun getPresentation(): ItemPresentation? {
+ return TLSchemaPsiImplUtil.getPresentation(this)
+ }
+}
diff --git a/src/test/kotlin/com/vk/tlschema/lang/TLSchemaFileTypeTest.kt b/src/test/kotlin/com/vk/tlschema/lang/TLSchemaFileTypeTest.kt
index 7065e7b..d2d6a03 100644
--- a/src/test/kotlin/com/vk/tlschema/lang/TLSchemaFileTypeTest.kt
+++ b/src/test/kotlin/com/vk/tlschema/lang/TLSchemaFileTypeTest.kt
@@ -4,7 +4,7 @@ import com.intellij.testFramework.fixtures.BasePlatformTestCase
import com.vk.tlschema.TLSchemaFileType
class TLSchemaFileTypeTest : BasePlatformTestCase() {
- private val fileType = TLSchemaFileType.INSTANCE
+ private val fileType = TLSchemaFileType
fun `test combined_tl file`() = toTest("combined.tl")