Minor: add bunch directives for better discoverability banched code

This commit is contained in:
Nikolay Krasko
2019-11-19 15:32:12 +03:00
parent 027bc671c1
commit 9356155f60
4 changed files with 6 additions and 0 deletions
@@ -5,4 +5,5 @@
package org.jetbrains.kotlin.idea.scratch.output package org.jetbrains.kotlin.idea.scratch.output
// BUNCH: 183
inline fun executeCommand(crossinline command: () -> Unit) = com.intellij.openapi.command.executeCommand(command = command) inline fun executeCommand(crossinline command: () -> Unit) = com.intellij.openapi.command.executeCommand(command = command)
@@ -7,6 +7,7 @@ package org.jetbrains.kotlin.idea.scratch.output
import com.intellij.openapi.command.CommandProcessor import com.intellij.openapi.command.CommandProcessor
// BUNCH: 183
fun executeCommand(command: () -> Unit) { fun executeCommand(command: () -> Unit) {
CommandProcessor.getInstance().executeCommand(null, command, null, null) CommandProcessor.getInstance().executeCommand(null, command, null, null)
} }
@@ -9,9 +9,11 @@ package org.jetbrains.kotlin.idea.scratch.output
import com.intellij.openapi.editor.InlayModel import com.intellij.openapi.editor.InlayModel
// BUNCH: 183
fun InlayModel.addInlay(offset: Int, renderer: InlayScratchFileRenderer) { fun InlayModel.addInlay(offset: Int, renderer: InlayScratchFileRenderer) {
addAfterLineEndElement(offset, false, renderer) addAfterLineEndElement(offset, false, renderer)
} }
// BUNCH: 183
fun InlayModel.getInlays(start: Int, end: Int) = fun InlayModel.getInlays(start: Int, end: Int) =
getAfterLineEndElementsInRange(start, end).filter { it.renderer is InlayScratchFileRenderer } getAfterLineEndElementsInRange(start, end).filter { it.renderer is InlayScratchFileRenderer }
@@ -9,9 +9,11 @@ package org.jetbrains.kotlin.idea.scratch.output
import com.intellij.openapi.editor.InlayModel import com.intellij.openapi.editor.InlayModel
// BUNCH: 183
fun InlayModel.addInlay(offset: Int, renderer: InlayScratchFileRenderer) { fun InlayModel.addInlay(offset: Int, renderer: InlayScratchFileRenderer) {
addInlineElement(offset, true, renderer) addInlineElement(offset, true, renderer)
} }
// BUNCH: 183
fun InlayModel.getInlays(start: Int, end: Int) = fun InlayModel.getInlays(start: Int, end: Int) =
getInlineElementsInRange(start, end).filter { it.renderer is InlayScratchFileRenderer } getInlineElementsInRange(start, end).filter { it.renderer is InlayScratchFileRenderer }