Minor changes on code review
This commit is contained in:
+1
-3
@@ -171,14 +171,12 @@ class BasicCompletionSession(
|
||||
|
||||
val contextVariableTypesForSmartCompletion = withCollectRequiredContextVariableTypes(::completeWithSmartCompletion)
|
||||
|
||||
fun completeReferenceVariants(lookupElementFactory: LookupElementFactory) {
|
||||
val contextVariableTypesForReferenceVariants = withCollectRequiredContextVariableTypes { lookupElementFactory ->
|
||||
val (imported, notImported) = referenceVariantsWithNonInitializedVarExcluded!!
|
||||
collector.addDescriptorElements(imported, lookupElementFactory)
|
||||
collector.addDescriptorElements(notImported, lookupElementFactory, notImported = true)
|
||||
}
|
||||
|
||||
val contextVariableTypesForReferenceVariants = withCollectRequiredContextVariableTypes(::completeReferenceVariants)
|
||||
|
||||
KEYWORDS_ONLY.doComplete()
|
||||
|
||||
// getting root packages from scope is very slow so we do this in alternative way
|
||||
|
||||
+2
-1
@@ -29,9 +29,10 @@ fun surroundWithBracesIfInStringTemplate(context: InsertionContext) {
|
||||
if (startOffset > 0 && document.charsSequence[startOffset - 1] == '$') {
|
||||
val psiDocumentManager = PsiDocumentManager.getInstance(context.project)
|
||||
psiDocumentManager.commitAllDocuments()
|
||||
psiDocumentManager.doPostponedOperationsAndUnblockDocument(document)
|
||||
|
||||
if (context.file.findElementAt(startOffset - 1)?.node?.elementType == KtTokens.SHORT_TEMPLATE_ENTRY_START) {
|
||||
psiDocumentManager.doPostponedOperationsAndUnblockDocument(document)
|
||||
|
||||
document.insertString(startOffset, "{")
|
||||
context.offsetMap.addOffset(CompletionInitializationContext.START_OFFSET, startOffset + 1)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user