Fix "infix modifier required" errors in project
This commit is contained in:
@@ -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)
|
||||
|
||||
|
||||
+1
-1
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user