This commit is contained in:
Valentin Kipyatkov
2014-12-26 21:55:28 +03:00
parent 4b2ee7e645
commit d297f4ad8f
3 changed files with 3 additions and 5 deletions
@@ -194,7 +194,7 @@ abstract class CompletionSessionBase(protected val configuration: CompletionSess
}
protected fun shouldRunExtensionsCompletion(): Boolean
= configuration.completeNonImportedDeclarations || prefixMatcher.getPrefix().length() >= 3
= configuration.completeNonImportedDeclarations || prefix.length() >= 3
protected fun getKotlinTopLevelCallables(): Collection<DeclarationDescriptor>
= indicesHelper.getTopLevelCallables({ prefixMatcher.prefixMatches(it) }, reference!!.expression)
@@ -210,10 +210,7 @@ fun InsertionContext.isAfterDot(): Boolean {
fun shouldCompleteThisItems(prefixMatcher: PrefixMatcher): Boolean {
val prefix = prefixMatcher.getPrefix()
val s = "this@"
return if (prefix.length() > s.length())
prefix.startsWith(s)
else
s.startsWith(prefix)
return prefix.startsWith(s) || s.startsWith(prefix)
}
data class ThisItemInfo(val factory: () -> LookupElement, val type: FuzzyType)
@@ -160,6 +160,7 @@ public class KotlinTypedHandler extends TypedHandlerDelegate {
}
private static boolean endsWith(CharSequence chars, int offset, String text) {
if (offset < text.length()) return false;
return chars.subSequence(offset - text.length(), offset).toString().equals(text);
}