Fix "infix modifier required" errors in project

This commit is contained in:
Yan Zhulanow
2015-11-24 17:27:48 +03:00
parent d1c5bd4526
commit 46ac3571d5
44 changed files with 65 additions and 65 deletions
@@ -103,8 +103,8 @@ abstract class CompletionSession(
protected val bindingContext = resolutionFacade.analyze(position.parentsWithSelf.firstIsInstance<KtElement>(), BodyResolveMode.PARTIAL_FOR_COMPLETION)
protected val inDescriptor = position.getResolutionScope(bindingContext, resolutionFacade).ownerDescriptor
private val kotlinIdentifierStartPattern = StandardPatterns.character().javaIdentifierStart() andNot singleCharPattern('$')
private val kotlinIdentifierPartPattern = StandardPatterns.character().javaIdentifierPart() andNot singleCharPattern('$')
private val kotlinIdentifierStartPattern = StandardPatterns.character().javaIdentifierStart().andNot(singleCharPattern('$'))
private val kotlinIdentifierPartPattern = StandardPatterns.character().javaIdentifierPart().andNot(singleCharPattern('$'))
protected val prefix = CompletionUtil.findIdentifierPrefix(
parameters.getPosition().getContainingFile(),
@@ -123,7 +123,7 @@ abstract class CompletionSession(
nameFilter
}
private fun ((Name) -> Boolean).or(otherFilter: (Name) -> Boolean): (Name) -> Boolean
private infix fun ((Name) -> Boolean).or(otherFilter: (Name) -> Boolean): (Name) -> Boolean
= { this(it) || otherFilter(it) }
protected val isVisibleFilter: (DeclarationDescriptor) -> Boolean = { isVisibleDescriptor(it, completeNonAccessible = configuration.completeNonAccessibleDeclarations) }
@@ -345,9 +345,9 @@ fun shortenReferences(context: InsertionContext, startOffset: Int, endOffset: In
ShortenReferences.DEFAULT.process(context.file as KtFile, startOffset, endOffset)
}
fun <T> ElementPattern<T>.and(rhs: ElementPattern<T>) = StandardPatterns.and(this, rhs)
infix fun <T> ElementPattern<T>.and(rhs: ElementPattern<T>) = StandardPatterns.and(this, rhs)
fun <T> ElementPattern<T>.andNot(rhs: ElementPattern<T>) = StandardPatterns.and(this, StandardPatterns.not(rhs))
fun <T> ElementPattern<T>.or(rhs: ElementPattern<T>) = StandardPatterns.or(this, rhs)
infix fun <T> ElementPattern<T>.or(rhs: ElementPattern<T>) = StandardPatterns.or(this, rhs)
fun singleCharPattern(char: Char) = StandardPatterns.character().equalTo(char)
@@ -215,7 +215,7 @@ public class KotlinCompletionContributor : CompletionContributor() {
if (tokenType == KtTokens.FUN_KEYWORD) {
tail += "()"
}
builder append tail
builder.append(tail)
val text = builder.toString()
val file = KtPsiFactory(tokenBefore.getProject()).createFile(text)