File tree 1 file changed +16
-0
lines changed
core/src/main/kotlin/spp/jetbrains/artifact/service
1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -72,6 +72,14 @@ object ArtifactTypeService : AbstractSourceMarkerService<IArtifactTypeService>()
72
72
return element is FunctionArtifact || getType(element) == ArtifactType .FUNCTION
73
73
}
74
74
75
+ fun isClass (element : PsiElement ): Boolean {
76
+ return getType(element) == ArtifactType .CLASS
77
+ }
78
+
79
+ fun isFile (element : PsiElement ): Boolean {
80
+ return getType(element) == ArtifactType .FILE
81
+ }
82
+
75
83
fun isPython (element : PsiElement ): Boolean {
76
84
return element.language.id == " Python"
77
85
}
@@ -127,6 +135,14 @@ fun PsiElement.isFunction(): Boolean {
127
135
return ArtifactTypeService .isFunction(this )
128
136
}
129
137
138
+ fun PsiElement.isClass (): Boolean {
139
+ return ArtifactTypeService .isClass(this )
140
+ }
141
+
142
+ fun PsiElement.isFile (): Boolean {
143
+ return ArtifactTypeService .isFile(this )
144
+ }
145
+
130
146
fun PsiElement.isPython (): Boolean {
131
147
return ArtifactTypeService .isPython(this )
132
148
}
You can’t perform that action at this time.
0 commit comments