Skip to content

Commit

Permalink
cleanups for completion providers
Browse files Browse the repository at this point in the history
  • Loading branch information
mkurnikov committed Nov 8, 2024
1 parent e9dc260 commit 467499f
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@ package org.move.lang.core.completion
import com.intellij.codeInsight.completion.*
import com.intellij.codeInsight.completion.impl.CompletionSorterImpl
import com.intellij.psi.util.elementType
import org.move.lang.MvElementTypes.IDENTIFIER
import org.move.lang.MvElementTypes.MODULE_KW
import org.move.lang.core.MvPsiPattern
import org.move.lang.core.completion.providers.*
import org.move.lang.core.completion.sort.COMPLETION_WEIGHERS_GROUPED
import org.move.lang.core.psi.MvModule
Expand All @@ -14,7 +12,6 @@ import org.move.lang.core.psi.ext.prevNonWsSibling
class CommonCompletionContributor: CompletionContributor() {
init {
extend(CompletionType.BASIC, PrimitiveTypesCompletionProvider)
// extend(CompletionType.BASIC, SpecItemCompletionProvider)

// addresses
extend(CompletionType.BASIC, NamedAddressInUseStmtCompletionProvider)
Expand All @@ -26,11 +23,9 @@ class CommonCompletionContributor: CompletionContributor() {
extend(CompletionType.BASIC, SchemaFieldsCompletionProvider)
extend(CompletionType.BASIC, MvPathCompletionProvider2)

extend(CompletionType.BASIC, MvPsiPattern.ability(), AbilitiesCompletionProvider)
// extend(CompletionType.BASIC, MvPsiPattern.refExpr(), BoolsCompletionProvider)

extend(CompletionType.BASIC, AbilitiesCompletionProvider)
extend(CompletionType.BASIC, BoolsCompletionProvider)
extend(CompletionType.BASIC, MacrosCompletionProvider)
extend(CompletionType.BASIC, AssertMacroCompletionProvider)
extend(CompletionType.BASIC, VectorLiteralCompletionProvider)
extend(CompletionType.BASIC, MethodOrFieldCompletionProvider)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,15 @@ import com.intellij.codeInsight.completion.CompletionProvider
import com.intellij.codeInsight.completion.CompletionResultSet
import com.intellij.codeInsight.completion.PrioritizedLookupElement
import com.intellij.codeInsight.lookup.LookupElementBuilder
import com.intellij.patterns.ElementPattern
import com.intellij.psi.PsiElement
import com.intellij.util.ProcessingContext
import org.move.lang.core.MvPsiPattern
import org.move.lang.core.completion.KEYWORD_PRIORITY

object AbilitiesCompletionProvider : CompletionProvider<CompletionParameters>() {
object AbilitiesCompletionProvider : MvCompletionProvider() {
override val elementPattern: ElementPattern<out PsiElement> get() = MvPsiPattern.ability()

override fun addCompletions(
parameters: CompletionParameters,
context: ProcessingContext,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import org.move.lang.core.MvPsiPattern
import org.move.lang.core.completion.MACRO_PRIORITY
import org.move.lang.core.psi.MvPath

object MacrosCompletionProvider : MvCompletionProvider() {
object AssertMacroCompletionProvider : MvCompletionProvider() {
override val elementPattern: ElementPattern<out PsiElement>
get() = MvPsiPattern.path()
.andNot(MvPsiPattern.pathType())
Expand Down

0 comments on commit 467499f

Please sign in to comment.