From 4e36f4ead115aef70fc5c01d9f2d77fe7ec0b2fd Mon Sep 17 00:00:00 2001 From: Sergey Simonchik Date: Thu, 6 Feb 2025 12:15:21 +0100 Subject: [PATCH] [terminal] rename `ShLangService` to `TerminalShLangService`, reduce visibility by making it `internal` GitOrigin-RevId: 2389635907546f8e3ad3c9c7a4d3436c654495d9 --- plugins/terminal/sh/resources/intellij.terminal.sh.xml | 4 ++-- .../{ShLangServiceImpl.kt => TerminalShLangServiceImpl.kt} | 4 ++-- .../plugins/terminal/block/shellSupport/BaseShSupport.kt | 4 ++-- .../{ShLangService.kt => TerminalShLangService.kt} | 4 +++- .../block/shellSupport/powershell/PowerShellSupport.kt | 6 +++--- 5 files changed, 12 insertions(+), 10 deletions(-) rename plugins/terminal/sh/src/org/jetbrains/plugins/terminal/sh/prompt/{ShLangServiceImpl.kt => TerminalShLangServiceImpl.kt} (93%) rename plugins/terminal/src/org/jetbrains/plugins/terminal/block/shellSupport/{ShLangService.kt => TerminalShLangService.kt} (80%) diff --git a/plugins/terminal/sh/resources/intellij.terminal.sh.xml b/plugins/terminal/sh/resources/intellij.terminal.sh.xml index 89ba3296515c..ccc949741aed 100644 --- a/plugins/terminal/sh/resources/intellij.terminal.sh.xml +++ b/plugins/terminal/sh/resources/intellij.terminal.sh.xml @@ -5,7 +5,7 @@ - + \ No newline at end of file diff --git a/plugins/terminal/sh/src/org/jetbrains/plugins/terminal/sh/prompt/ShLangServiceImpl.kt b/plugins/terminal/sh/src/org/jetbrains/plugins/terminal/sh/prompt/TerminalShLangServiceImpl.kt similarity index 93% rename from plugins/terminal/sh/src/org/jetbrains/plugins/terminal/sh/prompt/ShLangServiceImpl.kt rename to plugins/terminal/sh/src/org/jetbrains/plugins/terminal/sh/prompt/TerminalShLangServiceImpl.kt index 196d9546ba11..fb17554ede7b 100644 --- a/plugins/terminal/sh/src/org/jetbrains/plugins/terminal/sh/prompt/ShLangServiceImpl.kt +++ b/plugins/terminal/sh/src/org/jetbrains/plugins/terminal/sh/prompt/TerminalShLangServiceImpl.kt @@ -9,9 +9,9 @@ import com.intellij.sh.ShLanguage import com.intellij.sh.psi.ShCommandsList import com.intellij.sh.psi.ShFileElementType import com.intellij.sh.psi.ShSimpleCommand -import org.jetbrains.plugins.terminal.block.shellSupport.ShLangService +import org.jetbrains.plugins.terminal.block.shellSupport.TerminalShLangService -class ShLangServiceImpl : ShLangService { +internal class TerminalShLangServiceImpl : TerminalShLangService { override val promptContentElementType: IElementType get() = ShFileElementType.INSTANCE diff --git a/plugins/terminal/src/org/jetbrains/plugins/terminal/block/shellSupport/BaseShSupport.kt b/plugins/terminal/src/org/jetbrains/plugins/terminal/block/shellSupport/BaseShSupport.kt index a4f19f24d74b..c30a74aa6676 100644 --- a/plugins/terminal/src/org/jetbrains/plugins/terminal/block/shellSupport/BaseShSupport.kt +++ b/plugins/terminal/src/org/jetbrains/plugins/terminal/block/shellSupport/BaseShSupport.kt @@ -11,12 +11,12 @@ import org.jetbrains.plugins.terminal.exp.completion.TerminalShellSupport internal abstract class BaseShSupport : TerminalShellSupport { override val promptContentElementType: IElementType? - get() = serviceOrNull()?.promptContentElementType + get() = serviceOrNull()?.promptContentElementType override val lineContinuationChar: Char = '\\' override fun getCommandTokens(project: Project, command: String): List? { - return serviceOrNull()?.getShellCommandTokens(project, command) + return serviceOrNull()?.getShellCommandTokens(project, command) } override fun parseAliases(aliasesDefinition: String): Map { diff --git a/plugins/terminal/src/org/jetbrains/plugins/terminal/block/shellSupport/ShLangService.kt b/plugins/terminal/src/org/jetbrains/plugins/terminal/block/shellSupport/TerminalShLangService.kt similarity index 80% rename from plugins/terminal/src/org/jetbrains/plugins/terminal/block/shellSupport/ShLangService.kt rename to plugins/terminal/src/org/jetbrains/plugins/terminal/block/shellSupport/TerminalShLangService.kt index 776699d56a06..1f97652fb058 100644 --- a/plugins/terminal/src/org/jetbrains/plugins/terminal/block/shellSupport/ShLangService.kt +++ b/plugins/terminal/src/org/jetbrains/plugins/terminal/block/shellSupport/TerminalShLangService.kt @@ -3,8 +3,10 @@ package org.jetbrains.plugins.terminal.block.shellSupport import com.intellij.openapi.project.Project import com.intellij.psi.tree.IElementType +import org.jetbrains.annotations.ApiStatus -interface ShLangService { +@ApiStatus.Internal +interface TerminalShLangService { val promptContentElementType: IElementType fun getShellCommandTokens(project: Project, command: String): List? diff --git a/plugins/terminal/src/org/jetbrains/plugins/terminal/block/shellSupport/powershell/PowerShellSupport.kt b/plugins/terminal/src/org/jetbrains/plugins/terminal/block/shellSupport/powershell/PowerShellSupport.kt index 12bdcd86379c..2ed62dfd78c7 100644 --- a/plugins/terminal/src/org/jetbrains/plugins/terminal/block/shellSupport/powershell/PowerShellSupport.kt +++ b/plugins/terminal/src/org/jetbrains/plugins/terminal/block/shellSupport/powershell/PowerShellSupport.kt @@ -9,17 +9,17 @@ import com.intellij.openapi.util.text.StringUtil import com.intellij.psi.tree.IElementType import kotlinx.serialization.Serializable import kotlinx.serialization.json.Json -import org.jetbrains.plugins.terminal.block.shellSupport.ShLangService +import org.jetbrains.plugins.terminal.block.shellSupport.TerminalShLangService import org.jetbrains.plugins.terminal.exp.completion.TerminalShellSupport internal class PowerShellSupport : TerminalShellSupport { override val promptContentElementType: IElementType? - get() = serviceOrNull()?.promptContentElementType + get() = serviceOrNull()?.promptContentElementType override val lineContinuationChar: Char = '`' override fun getCommandTokens(project: Project, command: String): List? { - return serviceOrNull()?.getShellCommandTokens(project, command) + return serviceOrNull()?.getShellCommandTokens(project, command) } override fun parseCommandHistory(history: String): List {