Skip to content

Test: Cargo terminal completions #336218

Description

Refs: #336216
Implementation PR: #305309

  • anyOS

Complexity: 2

Authors: Dmitriy Vasyura (@dmitrivMS), Megan Rogge (@meganrogge)


A small smoke test of Cargo terminal completions. One OS and one supported shell (bash, zsh, or PowerShell) are sufficient; no exhaustive command, plugin, or toolchain matrix is needed.

Setup

  • Use a build containing Add upstream Cargo completion spec for terminal suggestions #305309 (a PR build, or Insiders after it lands), with Rust/Cargo available on PATH.
  • Enable terminal.integrated.suggest.enabled and terminal.integrated.shellIntegration.enabled, then open a new integrated terminal.
  • Create a disposable project with cargo new cargo-suggest-smoke --bin --vcs none, then cd cargo-suggest-smoke.
  • Append this to the generated Cargo.toml:
    [features]
    smoke = []

Use Ctrl+Space (or the terminal's Show Suggestions action) to request suggestions. Include a trailing space when completing an argument value. Use Tab to accept without running the command, then clear the line between checks.

Scenarios

  • Subcommands and insertion: At cargo , verify common subcommands such as build, check, run, and test are offered. Type cargo bu and accept build; verify the command becomes cargo build without duplicated text.
  • Build options: At cargo build --, verify --release, --features, --package, and --manifest-path are offered. Accept --release and check that the existing command is preserved and is not executed.
  • Project-aware values: At cargo build --features , verify smoke is suggested. At cargo build --package , verify cargo-suggest-smoke is suggested. Accept one value and check that it is inserted correctly.
  • Manifest file filtering: Create an empty other.toml beside Cargo.toml. At cargo build --manifest-path , verify Cargo's file suggestions include Cargo.toml, not other.toml; directories may still appear. Accept the manifest and verify the inserted path is correct.

For failures, include the OS/shell, the exact command typed, and expected versus actual suggestions. Link reports to this test item and #336216.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions