Skip to content

Commit

Permalink
chore: convenience functions
Browse files Browse the repository at this point in the history
  • Loading branch information
BFergerson committed Mar 19, 2024
1 parent 1e62e32 commit 9b65491
Showing 1 changed file with 16 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,14 @@ object ArtifactTypeService : AbstractSourceMarkerService<IArtifactTypeService>()
return element is FunctionArtifact || getType(element) == ArtifactType.FUNCTION
}

fun isClass(element: PsiElement): Boolean {
return getType(element) == ArtifactType.CLASS
}

fun isFile(element: PsiElement): Boolean {
return getType(element) == ArtifactType.FILE
}

fun isPython(element: PsiElement): Boolean {
return element.language.id == "Python"
}
Expand Down Expand Up @@ -127,6 +135,14 @@ fun PsiElement.isFunction(): Boolean {
return ArtifactTypeService.isFunction(this)
}

fun PsiElement.isClass(): Boolean {
return ArtifactTypeService.isClass(this)
}

fun PsiElement.isFile(): Boolean {
return ArtifactTypeService.isFile(this)
}

fun PsiElement.isPython(): Boolean {
return ArtifactTypeService.isPython(this)
}
Expand Down

0 comments on commit 9b65491

Please sign in to comment.