Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove "Unresolved module attribute" error annotation #1786

Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Remove "Unresolved module attribute" error annotation
  • Loading branch information
odk211 committed May 30, 2020
commit 22226ce3bebc4e5129aa8101fb6cda5fcfb102f6
18 changes: 0 additions & 18 deletions src/org/elixir_lang/annotator/ModuleAttribute.kt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import com.intellij.openapi.editor.markup.TextAttributes
import com.intellij.openapi.project.DumbAware
import com.intellij.openapi.util.TextRange
import com.intellij.psi.PsiElement
import com.intellij.psi.PsiPolyVariantReference
import com.intellij.psi.PsiRecursiveElementVisitor
import com.intellij.psi.tree.TokenSet
import org.elixir_lang.ElixirSyntaxHighlighter
Expand All @@ -25,7 +24,6 @@ import org.elixir_lang.psi.impl.stripAccessExpression
import org.elixir_lang.psi.operation.*
import org.elixir_lang.reference.ModuleAttribute.Companion.isCallbackName
import org.elixir_lang.reference.ModuleAttribute.Companion.isDocumentationName
import org.elixir_lang.reference.ModuleAttribute.Companion.isNonReferencing
import org.elixir_lang.reference.ModuleAttribute.Companion.isSpecificationName
import org.elixir_lang.reference.ModuleAttribute.Companion.isTypeName
import org.elixir_lang.structure_view.element.CallDefinitionHead.Companion.stripAllOuterParentheses
Expand Down Expand Up @@ -112,22 +110,6 @@ class ModuleAttribute : Annotator, DumbAware {
holder,
ElixirSyntaxHighlighter.MODULE_ATTRIBUTE
)

if (!isNonReferencing(atNonNumericOperation)) {
atNonNumericOperation.reference?.let { reference ->
val hasValidResults = when (reference) {
is PsiPolyVariantReference -> reference.multiResolve(false).any { it.isValidResult }
else -> reference.resolve() != null
}

if (!hasValidResults) {
holder
.newAnnotation(HighlightSeverity.ERROR, "Unresolved module attribute")
.range(atNonNumericOperation)
.create()
}
}
}
}
}
)
Expand Down