common: unused marker for marking values as unused intentionally

This commit is contained in:
2023-09-23 16:30:00 -07:00
parent 4ae1d19012
commit 87623505c0
4 changed files with 17 additions and 0 deletions

View File

@ -7,6 +7,7 @@ plugins {
}
dependencies {
implementation(project(":common"))
implementation(project(":parser"))
}

View File

@ -10,6 +10,7 @@ import com.intellij.psi.util.PsiTreeUtil
import com.intellij.psi.util.childrenOfType
import com.intellij.util.PlatformIcons
import gay.pizza.pork.ast.NodeType
import gay.pizza.pork.common.unused
import gay.pizza.pork.idea.PorkElementTypes
import gay.pizza.pork.idea.PorkLanguage
import gay.pizza.pork.idea.psi.gen.*
@ -44,6 +45,7 @@ object PorkElementHelpers {
}
fun referenceOfElement(element: PorkElement, type: NodeType): PsiReference? {
unused(type)
val textRangeOfSymbolInElement = element.childrenOfType<SymbolElement>().firstOrNull()?.textRangeInParent ?: return null
return PorkIdentifierReference(element, textRangeOfSymbolInElement)
}