Code cleanup: get rid of _ (mostly renamed to arg)

This commit is contained in:
Mikhail Glukhikh
2015-10-19 11:00:03 +03:00
parent 059175560c
commit f61aa18a05
9 changed files with 18 additions and 18 deletions
@@ -81,24 +81,24 @@ private object DeclarationKindDetector : JetVisitor<AnnotationHostKind?, Unit?>(
fun detect(declaration: JetDeclaration) = declaration.accept(this, null)
override fun visitDeclaration(d: JetDeclaration, _: Unit?) = null
override fun visitDeclaration(d: JetDeclaration, data: Unit?) = null
override fun visitClass(d: JetClass, _: Unit?) = detect(d, if (d.isInterface()) "interface" else "class")
override fun visitClass(d: JetClass, data: Unit?) = detect(d, if (d.isInterface()) "interface" else "class")
override fun visitNamedFunction(d: JetNamedFunction, _: Unit?) = detect(d, "fun")
override fun visitNamedFunction(d: JetNamedFunction, data: Unit?) = detect(d, "fun")
override fun visitProperty(d: JetProperty, _: Unit?) = detect(d, d.getValOrVarKeyword().getText()!!)
override fun visitProperty(d: JetProperty, data: Unit?) = detect(d, d.getValOrVarKeyword().getText()!!)
override fun visitMultiDeclaration(d: JetMultiDeclaration, _: Unit?) = detect(d, d.getValOrVarKeyword()?.getText() ?: "val",
override fun visitMultiDeclaration(d: JetMultiDeclaration, data: Unit?) = detect(d, d.getValOrVarKeyword()?.getText() ?: "val",
name = d.getEntries().map { it.getName()!! }.join(", ", "(", ")"))
override fun visitTypeParameter(d: JetTypeParameter, _: Unit?) = detect(d, "type parameter", newLineNeeded = false)
override fun visitTypeParameter(d: JetTypeParameter, data: Unit?) = detect(d, "type parameter", newLineNeeded = false)
override fun visitEnumEntry(d: JetEnumEntry, _: Unit?) = detect(d, "enum entry")
override fun visitEnumEntry(d: JetEnumEntry, data: Unit?) = detect(d, "enum entry")
override fun visitParameter(d: JetParameter, _: Unit?) = detect(d, "parameter", newLineNeeded = false)
override fun visitParameter(d: JetParameter, data: Unit?) = detect(d, "parameter", newLineNeeded = false)
override fun visitObjectDeclaration(d: JetObjectDeclaration, _: Unit?): AnnotationHostKind? {
override fun visitObjectDeclaration(d: JetObjectDeclaration, data: Unit?): AnnotationHostKind? {
if (d.isCompanion()) return detect(d, "companion object", name = "${d.getName()} of ${d.getStrictParentOfType<JetClass>()?.getName()}")
if (d.getParent() is JetObjectLiteralExpression) return null
return detect(d, "object")
@@ -114,7 +114,7 @@ public class KotlinConsoleRunner(
keeper.putVirtualFileToConsole(consoleFile, this)
processHandler.addProcessListener(object : ProcessAdapter() {
override fun processTerminated(_: ProcessEvent) {
override fun processTerminated(event: ProcessEvent) {
keeper.removeConsole(consoleFile)
}
})
@@ -123,7 +123,7 @@ public class KotlinConsoleRunner(
}
override fun createExecuteActionHandler() = object : ProcessBackedConsoleExecuteActionHandler(processHandler, false) {
override fun runExecuteAction(_: LanguageConsoleView) = executor.executeCommand()
override fun runExecuteAction(consoleView: LanguageConsoleView) = executor.executeCommand()
}
override fun fillToolBarActions(toolbarActions: DefaultActionGroup,
@@ -60,6 +60,6 @@ public class KotlinConsoleModuleDialog(private val project: Project) {
}
private fun createRunAction(module: Module) = object : AnAction(module.name) {
override fun actionPerformed(_: AnActionEvent) = runConsole(module)
override fun actionPerformed(e: AnActionEvent) = runConsole(module)
}
}
@@ -57,5 +57,5 @@ public class BuildAndRestartConsoleAction(
private val runner: KotlinConsoleRunner
) : AnAction("Build and restart", "Build module '${runner.module.name}' and restart", AllIcons.Actions.Restart) {
override fun actionPerformed(_: AnActionEvent) = runner.compilerHelper.compileModule()
override fun actionPerformed(e: AnActionEvent) = runner.compilerHelper.compileModule()
}
@@ -24,5 +24,5 @@ public class KotlinConsoleGutterContentProvider : BasicGutterContentProvider() {
* This method overriding is needed to prevent [BasicGutterContentProvider] from adding some strange unicode
* symbols of zero width and to ease range highlighting.
*/
override fun beforeEvaluate(_: Editor) = Unit
override fun beforeEvaluate(editor: Editor) = Unit
}