mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-06 03:21:12 +07:00
[Java] Add filepath for java command and java -cp argument
IDEA-359243 GitOrigin-RevId: 2620b31a4faf92b4d4c6771c5368b8b3270b0863
This commit is contained in:
committed by
intellij-monorepo-bot
parent
ec98448d79
commit
c0178527c1
@@ -10,10 +10,7 @@ import com.intellij.terminal.completion.spec.ShellCommandSpec
|
||||
import com.intellij.terminal.completion.spec.ShellRuntimeContext
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.withContext
|
||||
import org.jetbrains.plugins.terminal.block.completion.spec.ShellCommandSpec
|
||||
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
|
||||
import org.jetbrains.plugins.terminal.block.completion.spec.*
|
||||
import org.jetbrains.plugins.terminal.block.completion.spec.dsl.ShellChildOptionsContext
|
||||
|
||||
class JavaShellCommandSpecsProvider : ShellCommandSpecsProvider {
|
||||
@@ -55,6 +52,7 @@ class JavaShellCommandSpecsProvider : ShellCommandSpecsProvider {
|
||||
description(JavaTerminalBundle.message("java.command.terminal.classpath.option.description"))
|
||||
argument {
|
||||
displayName(JavaTerminalBundle.message("java.command.terminal.classpath.option.argument.path.text", ShellCommandUtils.getClassPathSeparator()))
|
||||
suggestions(ShellDataGenerators.fileSuggestionsGenerator())
|
||||
}
|
||||
}
|
||||
option("-showversion", "--show-version") {
|
||||
@@ -66,6 +64,7 @@ class JavaShellCommandSpecsProvider : ShellCommandSpecsProvider {
|
||||
|
||||
argument {
|
||||
displayName(JavaTerminalBundle.message("java.command.terminal.argument.main.class.text"))
|
||||
suggestions(ShellDataGenerators.fileSuggestionsGenerator())
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.java.terminal.completion
|
||||
|
||||
import com.intellij.terminal.completion.spec.ShellCommandResult
|
||||
import com.intellij.terminal.completion.spec.ShellCompletionSuggestion
|
||||
import com.intellij.testFramework.fixtures.BasePlatformTestCase
|
||||
import kotlinx.coroutines.runBlocking
|
||||
@@ -13,7 +14,9 @@ import org.junit.runners.JUnit4
|
||||
class JavaShellCommandSpecsProviderTest : BasePlatformTestCase() {
|
||||
@Test
|
||||
fun `default options are present`() = runBlocking {
|
||||
val fixture = ShellCompletionTestFixture.builder(project).build()
|
||||
val fixture = ShellCompletionTestFixture.builder(project).mockShellCommandResults { _ ->
|
||||
return@mockShellCommandResults ShellCommandResult.create("", exitCode = 1)
|
||||
}.build()
|
||||
val actual: List<ShellCompletionSuggestion> = fixture.getCompletions("java ")
|
||||
assertSameElements(actual.map { it.name }, listOf("--help", "-help", "-h",
|
||||
"-jar",
|
||||
|
||||
Reference in New Issue
Block a user