[git-term] Add an initial terminal git autocompletion specification

GitOrigin-RevId: 74057c98261777f7b260e13c15a706ef388e48d5
This commit is contained in:
Chris Lemaire
2024-05-21 18:21:35 +02:00
committed by intellij-monorepo-bot
parent 1a73332b29
commit 3322621879
5 changed files with 38 additions and 0 deletions

View File

@@ -90,5 +90,7 @@
<orderEntry type="module" module-name="intellij.platform.ide.newUiOnboarding" />
<orderEntry type="module" module-name="intellij.platform.backend.observation" />
<orderEntry type="module" module-name="intellij.platform.util.coroutines" />
<orderEntry type="module" module-name="intellij.terminal" />
<orderEntry type="module" module-name="intellij.terminal.completion" />
</component>
</module>

View File

@@ -25,6 +25,7 @@
<content>
<module name="intellij.vcs.git/newUiOnboarding"/>
<module name="intellij.vcs.git/terminal"/>
</content>
<actions>

View File

@@ -0,0 +1,9 @@
<idea-plugin package="git4idea.terminal">
<dependencies>
<plugin id="org.jetbrains.plugins.terminal"/>
</dependencies>
<extensions defaultExtensionNs="org.jetbrains.plugins.terminal">
<commandSpecsProvider implementation="git4idea.terminal.GitCommandSpecsProvider"/>
</extensions>
</idea-plugin>

View File

@@ -0,0 +1,13 @@
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
package git4idea.terminal
import org.jetbrains.annotations.ApiStatus.Experimental
import org.jetbrains.plugins.terminal.block.completion.spec.ShellCommandSpecConflictStrategy
import org.jetbrains.plugins.terminal.block.completion.spec.ShellCommandSpecInfo
import org.jetbrains.plugins.terminal.block.completion.spec.ShellCommandSpecsProvider
internal class GitCommandSpecsProvider : ShellCommandSpecsProvider {
override fun getCommandSpecs(): List<ShellCommandSpecInfo> = listOf(
ShellCommandSpecInfo.create(gitOverrideSpec, ShellCommandSpecConflictStrategy.OVERRIDE)
)
}

View File

@@ -0,0 +1,13 @@
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
@file:Suppress("HardCodedStringLiteral")
package git4idea.terminal
import com.intellij.terminal.completion.spec.ShellCommandParserOptions
import org.jetbrains.plugins.terminal.block.completion.spec.ShellCommandSpec
internal val gitOverrideSpec = ShellCommandSpec("git") {
subcommands {
// ...
}
}