Skip to content

Commit

Permalink
refactor: remove ApiStatus annotations where they don't make sense
Browse files Browse the repository at this point in the history
  • Loading branch information
lppedd committed Apr 11, 2020
1 parent 04a65df commit b5c38d1
Show file tree
Hide file tree
Showing 28 changed files with 0 additions and 60 deletions.
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
package com.github.lppedd.cc.collection

import org.jetbrains.annotations.ApiStatus

/**
* @author Edoardo Luppi
*/
@ApiStatus.Internal
internal object NoopIterator : MutableIterator<Any?> {
override fun hasNext(): Boolean = false
override fun next(): Any? = null
Expand Down
3 changes: 0 additions & 3 deletions src/main/kotlin/com/github/lppedd/cc/collection/NoopList.kt
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
package com.github.lppedd.cc.collection

import org.jetbrains.annotations.ApiStatus

/**
* @author Edoardo Luppi
*/
@ApiStatus.Internal
internal object NoopList : MutableList<Any?> {
override val size: Int = 0
override fun contains(element: Any?): Boolean = false
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
package com.github.lppedd.cc.collection

import org.jetbrains.annotations.ApiStatus

/**
* @author Edoardo Luppi
*/
@ApiStatus.Internal
internal object NoopListIterator : MutableListIterator<Any?> {
override fun hasNext(): Boolean = false
override fun hasPrevious(): Boolean = false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package com.github.lppedd.cc.completion
import com.github.lppedd.cc.flattenWhitespaces
import com.intellij.codeInsight.completion.PlainPrefixMatcher
import com.intellij.codeInsight.completion.PrefixMatcher
import org.jetbrains.annotations.ApiStatus

/**
* A prefix matcher for completion items which strips whitespaces characters from lookup string.
Expand All @@ -12,7 +11,6 @@ import org.jetbrains.annotations.ApiStatus
* @see flattenWhitespaces
* @author Edoardo Luppi
*/
@ApiStatus.Internal
internal class FlatPrefixMatcher(prefix: String) : PlainPrefixMatcher(prefix) {
override fun isStartMatch(name: String): Boolean =
name.flattenWhitespaces().startsWith(prefix, true)
Expand Down
3 changes: 0 additions & 3 deletions src/main/kotlin/com/github/lppedd/cc/completion/Priority.kt
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
package com.github.lppedd.cc.completion

import org.jetbrains.annotations.ApiStatus

/**
* @author Edoardo Luppi
*/
@ApiStatus.Internal
internal inline class Priority(val value: Int) : Comparable<Priority> {
override fun compareTo(other: Priority): Int =
value.compareTo(other.value)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,12 @@ package com.github.lppedd.cc.completion.menu

import com.intellij.codeInsight.completion.PrefixMatcher
import com.intellij.codeInsight.lookup.LookupElement
import org.jetbrains.annotations.ApiStatus

/**
* A prefix matcher which simply filters out lookup elements.
*
* @author Edoardo Luppi
*/
@ApiStatus.Internal
internal class FilterPrefixMatcher(
private val delegate: PrefixMatcher,
prefix: String? = null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,11 @@ import com.intellij.codeInsight.completion.PlainPrefixMatcher
import com.intellij.codeInsight.lookup.impl.LookupImpl
import com.intellij.openapi.actionSystem.AnAction
import com.intellij.openapi.actionSystem.AnActionEvent
import org.jetbrains.annotations.ApiStatus
import java.util.*

/**
* @author Edoardo Luppi
*/
@ApiStatus.Internal
internal class FilterProviderAction(
private val enhancer: MenuEnhancerLookupListener,
private val lookup: LookupImpl,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,10 @@ import com.intellij.openapi.actionSystem.AnAction
import com.intellij.openapi.actionSystem.DefaultActionGroup
import com.intellij.openapi.actionSystem.impl.ActionButton
import com.intellij.util.ReflectionUtil.getField
import org.jetbrains.annotations.ApiStatus

/**
* @author Edoardo Luppi
*/
@ApiStatus.Internal
internal class MenuEnhancerLookupListener(private val lookup: LookupImpl) :
LookupListener,
PrefixChangeListener {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,10 @@ import com.github.lppedd.cc.parser.ValidToken
import com.github.lppedd.cc.psiElement.CommitBodyPsiElement
import com.github.lppedd.cc.safeRunWithCheckCanceled
import com.intellij.openapi.project.Project
import org.jetbrains.annotations.ApiStatus

/**
* @author Edoardo Luppi
*/
@ApiStatus.Internal
internal class BodyCompletionProvider(
private val project: Project,
private val context: FooterTypeContext,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,10 @@ package com.github.lppedd.cc.completion.providers

import com.github.lppedd.cc.api.CommitTokenProvider
import com.github.lppedd.cc.completion.resultset.ResultSet
import org.jetbrains.annotations.ApiStatus

/**
* @author Edoardo Luppi
*/
@ApiStatus.Internal
internal interface CompletionProvider<out T : CommitTokenProvider> {
val providers: Collection<T>
val stopHere: Boolean
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,10 @@ import com.github.lppedd.cc.parser.FooterContext.FooterTypeContext
import com.github.lppedd.cc.psiElement.CommitFooterTypePsiElement
import com.github.lppedd.cc.safeRunWithCheckCanceled
import com.intellij.openapi.project.Project
import org.jetbrains.annotations.ApiStatus

/**
* @author Edoardo Luppi
*/
@ApiStatus.Internal
internal class FooterTypeCompletionProvider(
private val project: Project,
private val context: FooterTypeContext,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,10 @@ import com.github.lppedd.cc.api.ProviderPresentation
import com.github.lppedd.cc.completion.Priority
import com.github.lppedd.cc.configuration.CCConfigService
import com.intellij.openapi.project.Project
import org.jetbrains.annotations.ApiStatus

/**
* @author Edoardo Luppi
*/
@ApiStatus.Internal
internal class FooterTypeProviderWrapper(
project: Project,
private val provider: CommitFooterTypeProvider,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,10 @@ import com.github.lppedd.cc.safeRunWithCheckCanceled
import com.intellij.codeInsight.completion.CompletionProcess
import com.intellij.codeInsight.completion.CompletionProgressIndicator
import com.intellij.openapi.project.Project
import org.jetbrains.annotations.ApiStatus

/**
* @author Edoardo Luppi
*/
@ApiStatus.Internal
internal class FooterValueCompletionProvider(
private val project: Project,
private val context: FooterValueContext,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,10 @@ import com.github.lppedd.cc.api.ProviderPresentation
import com.github.lppedd.cc.completion.Priority
import com.github.lppedd.cc.configuration.CCConfigService
import com.intellij.openapi.project.Project
import org.jetbrains.annotations.ApiStatus

/**
* @author Edoardo Luppi
*/
@ApiStatus.Internal
internal class FooterValueProviderWrapper(
project: Project,
private val provider: CommitFooterValueProvider,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,10 @@ import com.github.lppedd.cc.emptyCollection
import com.github.lppedd.cc.lookupElement.CommitNoScopeLookupElement
import com.intellij.codeInsight.completion.PrefixMatcher
import com.intellij.openapi.project.Project
import org.jetbrains.annotations.ApiStatus

/**
* @author Edoardo Luppi
*/
@ApiStatus.Internal
internal class NoScopeCompletionProvider(project: Project) : CompletionProvider<CommitScopeProvider> {
private val commitNoScopeLookupElement = CommitNoScopeLookupElement(project)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,10 @@ package com.github.lppedd.cc.completion.providers

import com.github.lppedd.cc.api.CommitTokenProvider
import com.github.lppedd.cc.completion.Priority
import org.jetbrains.annotations.ApiStatus

/**
* @author Edoardo Luppi
*/
@ApiStatus.Internal
internal interface ProviderWrapper : CommitTokenProvider {
fun getPriority(): Priority
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,10 @@ import com.github.lppedd.cc.parser.CommitContext.ScopeCommitContext
import com.github.lppedd.cc.psiElement.CommitScopePsiElement
import com.github.lppedd.cc.safeRunWithCheckCanceled
import com.intellij.openapi.project.Project
import org.jetbrains.annotations.ApiStatus

/**
* @author Edoardo Luppi
*/
@ApiStatus.Internal
internal class ScopeCompletionProvider(
private val project: Project,
private val context: ScopeCommitContext,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,10 @@ import com.github.lppedd.cc.api.ProviderPresentation
import com.github.lppedd.cc.completion.Priority
import com.github.lppedd.cc.configuration.CCConfigService
import com.intellij.openapi.project.Project
import org.jetbrains.annotations.ApiStatus

/**
* @author Edoardo Luppi
*/
@ApiStatus.Internal
internal class ScopeProviderWrapper(
project: Project,
private val provider: CommitScopeProvider,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,10 @@ import com.github.lppedd.cc.parser.CommitContext.SubjectCommitContext
import com.github.lppedd.cc.psiElement.CommitSubjectPsiElement
import com.github.lppedd.cc.safeRunWithCheckCanceled
import com.intellij.openapi.project.Project
import org.jetbrains.annotations.ApiStatus

/**
* @author Edoardo Luppi
*/
@ApiStatus.Internal
internal class SubjectCompletionProvider(
private val project: Project,
private val context: SubjectCommitContext,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,10 @@ import com.github.lppedd.cc.api.ProviderPresentation
import com.github.lppedd.cc.completion.Priority
import com.github.lppedd.cc.configuration.CCConfigService
import com.intellij.openapi.project.Project
import org.jetbrains.annotations.ApiStatus

/**
* @author Edoardo Luppi
*/
@ApiStatus.Internal
internal class SubjectProviderWrapper(
project: Project,
private val provider: CommitSubjectProvider,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,10 @@ import com.github.lppedd.cc.parser.CommitContext.TypeCommitContext
import com.github.lppedd.cc.psiElement.CommitTypePsiElement
import com.github.lppedd.cc.safeRunWithCheckCanceled
import com.intellij.openapi.project.Project
import org.jetbrains.annotations.ApiStatus

/**
* @author Edoardo Luppi
*/
@ApiStatus.Internal
internal class TemplateTypeCompletionProvider(
private val project: Project,
private val context: TypeCommitContext,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,10 @@ import com.github.lppedd.cc.parser.CommitContext.TypeCommitContext
import com.github.lppedd.cc.psiElement.CommitTypePsiElement
import com.github.lppedd.cc.safeRunWithCheckCanceled
import com.intellij.openapi.project.Project
import org.jetbrains.annotations.ApiStatus

/**
* @author Edoardo Luppi
*/
@ApiStatus.Internal
internal class TypeCompletionProvider(
private val project: Project,
private val context: TypeCommitContext,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,10 @@ import com.github.lppedd.cc.api.ProviderPresentation
import com.github.lppedd.cc.completion.Priority
import com.github.lppedd.cc.configuration.CCConfigService
import com.intellij.openapi.project.Project
import org.jetbrains.annotations.ApiStatus

/**
* @author Edoardo Luppi
*/
@ApiStatus.Internal
internal class TypeProviderWrapper(
project: Project,
private val provider: CommitTypeProvider,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,10 @@ package com.github.lppedd.cc.completion.resultset
import com.intellij.codeInsight.completion.CompletionResultSet
import com.intellij.codeInsight.completion.PrefixMatcher
import com.intellij.codeInsight.lookup.LookupElement
import org.jetbrains.annotations.ApiStatus

/**
* @author Edoardo Luppi
*/
@ApiStatus.Internal
internal open class DelegateResultSet(private var resultSet: CompletionResultSet) : ResultSet {
override fun addElement(lookupElement: LookupElement) {
resultSet.addElement(lookupElement)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,10 @@ package com.github.lppedd.cc.completion.resultset

import com.intellij.codeInsight.completion.PrefixMatcher
import com.intellij.codeInsight.lookup.LookupElement
import org.jetbrains.annotations.ApiStatus

/**
* @author Edoardo Luppi
*/
@ApiStatus.Internal
internal interface ResultSet {
fun addElement(lookupElement: LookupElement)
fun withPrefixMatcher(prefix: String): ResultSet
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,10 @@ package com.github.lppedd.cc.completion.resultset
import com.github.lppedd.cc.lookupElement.CommitLookupElement
import com.intellij.codeInsight.completion.CompletionResultSet
import com.intellij.codeInsight.lookup.LookupElement
import org.jetbrains.annotations.ApiStatus

/**
* @author Edoardo Luppi
*/
@ApiStatus.Internal
internal class TemplateDelegateResultSet(resultSet: CompletionResultSet) : DelegateResultSet(resultSet) {
override fun addElement(lookupElement: LookupElement) {
super.addElement(decorateIfPossible(lookupElement))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,10 @@ import com.intellij.openapi.editor.Editor
import com.intellij.openapi.util.ClassConditionKey
import com.intellij.openapi.util.Key
import com.intellij.openapi.util.UserDataHolderBase
import org.jetbrains.annotations.ApiStatus

/**
* @author Edoardo Luppi
*/
@ApiStatus.Internal
internal class TemplateElementDecorator(private val delegate: CommitLookupElement) : CommitLookupElement() {
override val index = delegate.index
override val priority = delegate.priority
Expand Down
2 changes: 0 additions & 2 deletions src/main/kotlin/com/github/lppedd/cc/parser/CCTextRange.kt
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
package com.github.lppedd.cc.parser

import com.intellij.openapi.util.TextRange
import org.jetbrains.annotations.ApiStatus

/**
* @author Edoardo Luppi
*/
@ApiStatus.Internal
internal class CCTextRange(startOffset: Int, endOffset: Int) : TextRange(startOffset, endOffset) {
@Suppress("ConvertTwoComparisonsToRangeCheck")
override fun contains(offset: Int): Boolean =
Expand Down

0 comments on commit b5c38d1

Please sign in to comment.