Theia API Documentation v1.76.0
    Preparing search index...
    • Generates allowlist/denylist pattern suggestions from parsed sub-commands.

      Suggestions are ordered from broadest to most specific:

      1. First-word prefix (e.g., "git *") — if all sub-commands share the first word
      2. First-two-words prefix (e.g., "git log *") — if all share the first two words
      3. Combined prefixes (e.g., ["find *", "head *"]) — if exactly 2 sub-commands with different first words. Single-word sub-commands use the exact command.
      4. Exact match — only for single sub-commands shorter than 50 characters

      For allow: use suggestions as-is (combined means both patterns are needed). For deny: flatten combined suggestions into individual patterns (either suffices).

      Examples (with pre-parsed sub-commands):

      • ["git log --oneline -20"] → [{["git *"]}, {["git log *"]}, {["git log --oneline -20"]}]
      • ["git rev-parse --show-toplevel", "git log -n 15 ..."] → [{["git *"]}]
      • ["npm run build", "npm run test"] → [{["npm *"]}, {["npm run *"]}]
      • ["find . -name '*.ts'", "head -5"] → [{["find *", "head *"]}]
      • ["find . -type f", "sort"] → [{["find *", "sort"]}]
      • ["git status", "npm test"] → [{["git *", "npm *"]}]
      • ["ls"] → [{["ls"]}]

      Parameters

      • subCommands: string[]

      Returns PatternSuggestion[]