Skip to content

Commit

Permalink
cleanup: deprecated API (part of #532)
Browse files Browse the repository at this point in the history
  • Loading branch information
iromeo committed Oct 7, 2024
1 parent 0028e62 commit fb6b2d6
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ object SmkWrapperArgsCompletionProvider : CompletionProvider<CompletionParameter

val wrapperSection = containingRuleLike?.getSectionByName(SnakemakeNames.SECTION_WRAPPER) ?: return

val wrappers = SmkWrapperStorage.getInstance(parameters.position.project)?.wrappers ?: return
val wrappers = SmkWrapperStorage.getInstance(parameters.position.project).wrappers

val wrapperFstArg = wrapperSection.argumentList?.arguments?.firstOrNull()
if (wrapperFstArg !is PyStringLiteralExpression) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import com.intellij.codeInspection.ProblemsHolder
import com.intellij.openapi.project.Project
import com.intellij.psi.*
import com.intellij.psi.util.elementType
import com.intellij.refactoring.suggested.startOffset
import com.intellij.psi.util.startOffset
import com.jetbrains.python.PyTokenTypes
import com.jetbrains.python.psi.PyCallExpression
import com.jetbrains.snakecharm.SnakemakeBundle
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import com.intellij.openapi.project.Project
import com.intellij.psi.PsiDocumentManager
import com.intellij.psi.PsiElement
import com.intellij.psi.PsiFile
import com.intellij.refactoring.suggested.endOffset
import com.intellij.psi.util.endOffset
import com.jetbrains.snakecharm.SnakemakeBundle
import com.jetbrains.snakecharm.lang.psi.SmkUse

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ import com.intellij.openapi.project.Project
import com.intellij.psi.PsiDocumentManager
import com.intellij.psi.PsiElement
import com.intellij.psi.PsiFile
import com.intellij.psi.util.endOffset
import com.intellij.psi.util.parentOfType
import com.intellij.refactoring.suggested.endOffset
import com.intellij.refactoring.suggested.startOffset
import com.intellij.psi.util.startOffset
import com.jetbrains.python.psi.PyBinaryExpression
import com.jetbrains.python.psi.PyStringElement
import com.jetbrains.python.psi.PyStringLiteralExpression
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,7 @@ class SmkWrapperMissedArgumentsInspection : SnakemakeInspection() {
fun visitSmkRuleOrCheckpoint(ruleOrCheckpoint: SmkRuleOrCheckpoint) {
val wrapper = ruleOrCheckpoint.getSectionByName(SnakemakeNames.SECTION_WRAPPER) ?: return

val wrappers = SmkWrapperStorage.getInstance(ruleOrCheckpoint.project)
?.wrappers ?: return
val wrappers = SmkWrapperStorage.getInstance(ruleOrCheckpoint.project).wrappers
val wrapperName = wrapper.argumentList?.text ?: return
val wrapperInfo = wrappers.find { wrapperName.contains(it.path) } ?: return

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@ class SmkWrapperDocumentation : AbstractDocumentationProvider() {
} else {
text.substringAfter("/")
}
val wrappers = SmkWrapperStorage.getInstance(node.navigationElement.project)
?.wrappers ?: return ""
val wrappers = SmkWrapperStorage.getInstance(node.navigationElement.project).wrappers
val wrapper = wrappers.find { wrapper -> wrapper.path.contains(result) }
if (text.startsWith("file://")) {
return if (wrapper != null)
Expand Down

0 comments on commit fb6b2d6

Please sign in to comment.