Skip to content

Commit

Permalink
Merge pull request #83 from anboralabs/restyled/psi-impl
Browse files Browse the repository at this point in the history
Restyle Annotators
  • Loading branch information
dalgarins authored Sep 25, 2021
2 parents fdc4610 + 81553fb commit 5c9eee0
Show file tree
Hide file tree
Showing 13 changed files with 13 additions and 13 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package co.anbora.labs.firebase.ide.annotator

class HighlightingAnnotator {
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,4 @@ class PathVariableHighlightAnnotator : FirebaseAnnotator() {
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ package co.anbora.labs.firebase.ide.editor
import co.anbora.labs.firebase.lang.core.psi.FirebaseRulesTypes.STRING
import com.intellij.codeInsight.editorActions.SimpleTokenSetQuoteHandler

class FirebaseQuoteHandler: SimpleTokenSetQuoteHandler(STRING)
class FirebaseQuoteHandler: SimpleTokenSetQuoteHandler(STRING)
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,4 @@ private fun checkPathVariable(element: FirebaseRulesFullPathStatement, holder: P

private fun markDuplicate(element: FirebaseElement, holder: ProblemsHolder) {
holder.registerProblem(element, "Duplicate definitions with name `${element.text}`", ProblemHighlightType.ERROR)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@ private fun checkWeakRule(element: FirebaseRulesConditionalBlock, holder: Proble
if (booleanStm?.text == FIREBASE_TRUE) {
holder.registerProblem(booleanStm, "Weak rule, this is not recommended for production environments.", ProblemHighlightType.WEAK_WARNING)
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ package co.anbora.labs.firebase.lang.core.psi
import com.intellij.psi.PsiNameIdentifierOwner

interface FirebaseNameIdentifierOwner : FirebaseNamedElement,
PsiNameIdentifierOwner
PsiNameIdentifierOwner
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ interface FirebaseNamedElement : FirebaseElement,

val nameElement: PsiElement?
get() = findLastChildByType(IDENTIFIER)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ fun PsiElement.childrenByType(type: IElementType): Sequence<PsiElement> =
childrenWithLeaves.filter { it.elementType == type }

fun PsiElement.findLastChildByType(type: IElementType): PsiElement? =
childrenByType(type).lastOrNull()
childrenByType(type).lastOrNull()
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ abstract class FirebaseNameIdentifierOwnerImpl(
node: ASTNode
) : FirebaseNamedElementImpl(node), FirebaseNameIdentifierOwner {
override fun getNameIdentifier(): PsiElement? = nameElement
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ abstract class FirebaseNamedElementImpl(
override fun getNavigationElement(): PsiElement = nameElement ?: this

override fun getTextOffset(): Int = nameElement?.textOffset ?: super.getTextOffset()
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ import co.anbora.labs.firebase.lang.core.psi.impl.FirebaseNameIdentifierOwnerImp
import com.intellij.lang.ASTNode

abstract class IdentifierMixing(node: ASTNode): FirebaseNameIdentifierOwnerImpl(node), FirebaseRulesIdentifierExpr {
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
<body>
Multiple functions has the same name and arguments.
</body>
</html>
</html>
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@

See https://firebase.google.com/docs/rules/rules-behavior.
</body>
</html>
</html>

0 comments on commit 5c9eee0

Please sign in to comment.