SnippetPredictor-Help.xml

<?xml version="1.0" encoding="utf-8"?>
<helpItems xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10" schema="maml" xmlns="http://msh">
  <command:command>
    <command:details>
      <command:name>Add-Snippet</command:name>
      <maml:description>
        <maml:para>Add snippets with tooltip to the snippet configuration.</maml:para>
      </maml:description>
      <command:verb>Add</command:verb>
      <command:noun>Snippet</command:noun>
    </command:details>
    <maml:description>
      <maml:para>Add snippets with tooltip to the snippet configuration.
The snippet configuration resides in `~/.snippet-predictor.json`.</maml:para>
    </maml:description>
    <command:syntax>
      <command:syntaxItem>
        <maml:name>Add-Snippet</maml:name>
        <command:parameter required="true" variableLength="false" globbing="false" pipelineInput="false" position="0" aliases="none">
          <maml:name>Snippet</maml:name>
          <maml:description />
          <command:parameterValue required="true" variableLength="false">string</command:parameterValue>
          <dev:type>
            <maml:name>System.String</maml:name>
          </dev:type>
        </command:parameter>
        <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="1" aliases="none">
          <maml:name>Tooltip</maml:name>
          <maml:description />
          <command:parameterValue required="true" variableLength="false">string</command:parameterValue>
          <dev:type>
            <maml:name>System.String</maml:name>
          </dev:type>
        </command:parameter>
        <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="2" aliases="none">
          <maml:name>Group</maml:name>
          <maml:description />
          <command:parameterValue required="true" variableLength="false">string</command:parameterValue>
          <dev:type>
            <maml:name>System.String</maml:name>
          </dev:type>
        </command:parameter>
      </command:syntaxItem>
    </command:syntax>
    <command:parameters>
      <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="true (ByPropertyName)" position="2" aliases="none">
        <maml:name>Group</maml:name>
        <maml:description>
          <maml:para>The group of the snippet</maml:para>
        </maml:description>
        <command:parameterValue required="true" variableLength="true">System.String</command:parameterValue>
        <dev:type>
          <maml:name>System.String</maml:name>
        </dev:type>
      </command:parameter>
      <command:parameter required="true" variableLength="false" globbing="false" pipelineInput="true (ByValue, ByPropertyName)" position="0" aliases="none">
        <maml:name>Snippet</maml:name>
        <maml:description>
          <maml:para>The text of the snippet</maml:para>
        </maml:description>
        <command:parameterValue required="true" variableLength="true">System.String</command:parameterValue>
        <dev:type>
          <maml:name>System.String</maml:name>
        </dev:type>
      </command:parameter>
      <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="true (ByPropertyName)" position="1" aliases="none">
        <maml:name>Tooltip</maml:name>
        <maml:description>
          <maml:para>The tooltip of the snippet</maml:para>
        </maml:description>
        <command:parameterValue required="true" variableLength="true">System.String</command:parameterValue>
        <dev:type>
          <maml:name>System.String</maml:name>
        </dev:type>
      </command:parameter>
    </command:parameters>
    <command:inputTypes>
      <command:inputType>
        <dev:type>
          <maml:name>System.String</maml:name>
        </dev:type>
        <maml:description>
          <maml:para>The snippet string to add.</maml:para>
        </maml:description>
      </command:inputType>
    </command:inputTypes>
    <command:returnValues>
      <command:returnValue>
        <dev:type>
          <maml:name>System.Object</maml:name>
        </dev:type>
        <maml:description>
          <maml:para>No output.</maml:para>
        </maml:description>
      </command:returnValue>
    </command:returnValues>
    <maml:alertSet>
      <maml:alert>
        <maml:para />
      </maml:alert>
    </maml:alertSet>
    <command:examples>
      <command:example>
        <maml:title>--------- Example 1 ---------</maml:title>
        <maml:introduction>
          <maml:para>```powershell
Add-Snippet "echo hello"
```</maml:para>
          <maml:para>&#x80;</maml:para>
          <maml:para>Add a snippet.</maml:para>
        </maml:introduction>
        <dev:code />
        <dev:remarks />
      </command:example>
      <command:example>
        <maml:title>--------- Example 2 ---------</maml:title>
        <maml:introduction>
          <maml:para>```powershell
Add-Snippet 'echo hello' 'say hello'
```</maml:para>
          <maml:para>&#x80;</maml:para>
          <maml:para>Add a snippet with tooltip.</maml:para>
        </maml:introduction>
        <dev:code />
        <dev:remarks />
      </command:example>
      <command:example>
        <maml:title>--------- Example 3 ---------</maml:title>
        <maml:introduction>
          <maml:para>```powershell
{echo hello} | Add-Snippet
```</maml:para>
          <maml:para>&#x80;</maml:para>
          <maml:para>Add a snippet.
You can pass code blocks. Code blocks are implicitly converted to strings through the pipeline.</maml:para>
        </maml:introduction>
        <dev:code />
        <dev:remarks />
      </command:example>
      <command:example>
        <maml:title>--------- Example 4 ---------</maml:title>
        <maml:introduction>
          <maml:para>```powershell
@{Snippet='echo hello'; Tooltip='say hello'},@{Snippet='echo goodbye'; Tooltip='say goobye'} | % {[pscustomobject]$_} | Add-Snippet
```</maml:para>
          <maml:para>&#x80;</maml:para>
          <maml:para>Add a snippet through pipeline.</maml:para>
        </maml:introduction>
        <dev:code />
        <dev:remarks />
      </command:example>
    </command:examples>
    <command:relatedLinks>
      <maml:navigationLink>
        <maml:linkText>Online Version</maml:linkText>
        <maml:uri>https://github.com/krymtkts/SnippetPredictor/blob/main/docs/SnippetPredictor/Add-Snippet.md</maml:uri>
      </maml:navigationLink>
      <maml:navigationLink>
        <maml:linkText>SnippetPredictor.md</maml:linkText>
        <maml:uri>https://github.com/krymtkts/SnippetPredictor/blob/main/docs/SnippetPredictor/SnippetPredictor.md</maml:uri>
      </maml:navigationLink>
    </command:relatedLinks>
  </command:command>
  <command:command>
    <command:details>
      <command:name>Disable-SnippetPredictorKeyHandler</command:name>
      <maml:description>
        <maml:para>Removes PSReadLine key bindings registered by SnippetPredictor.</maml:para>
      </maml:description>
      <command:verb>Disable</command:verb>
      <command:noun>SnippetPredictorKeyHandler</command:noun>
    </command:details>
    <maml:description>
      <maml:para>Removes the PSReadLine key bindings registered by `Enable-SnippetPredictorKeyHandler`.
The command checks ownership before cleanup and leaves user-owned bindings unchanged.
It preserves a binding that the user replaced after enabling the handlers.

For registered PSReadLine default chords, the command restores the corresponding default functions.
It assigns `TabCompleteNext` to Tab, `TabCompletePrevious` to Shift+Tab, and `AcceptLine` to Enter.
The command removes bindings for custom chords.

The command doesn't restore a custom binding that `Enable-SnippetPredictorKeyHandler` overwrote.
PSReadLine doesn't expose the original script block required to restore an arbitrary custom action.

Removing the SnippetPredictor module performs the same cleanup automatically.
Calling this command more than once is safe.</maml:para>
    </maml:description>
    <command:syntax>
      <command:syntaxItem>
        <maml:name>Disable-SnippetPredictorKeyHandler</maml:name>
      </command:syntaxItem>
    </command:syntax>
    <command:parameters />
    <command:inputTypes />
    <command:returnValues>
      <command:returnValue>
        <dev:type>
          <maml:name>System.Object</maml:name>
        </dev:type>
        <maml:description>
          <maml:para>No output.</maml:para>
        </maml:description>
      </command:returnValue>
    </command:returnValues>
    <maml:alertSet>
      <maml:alert>
        <maml:para>The binding state applies to the current PowerShell session.
This command doesn't manage key bindings created by user code.
This includes bindings that use handlers returned by `New-SnippetPredictorKeyHandler`.
User code controls those bindings.</maml:para>
      </maml:alert>
    </maml:alertSet>
    <command:examples>
      <command:example>
        <maml:title>--------- Example 1 ---------</maml:title>
        <maml:introduction>
          <maml:para>```powershell
Disable-SnippetPredictorKeyHandler
```</maml:para>
          <maml:para>&#x80;</maml:para>
          <maml:para>Removes the current SnippetPredictor key bindings.</maml:para>
        </maml:introduction>
        <dev:code />
        <dev:remarks />
      </command:example>
    </command:examples>
    <command:relatedLinks>
      <maml:navigationLink>
        <maml:linkText>Online Version</maml:linkText>
        <maml:uri>https://github.com/krymtkts/SnippetPredictor/blob/main/docs/SnippetPredictor/Disable-SnippetPredictorKeyHandler.md</maml:uri>
      </maml:navigationLink>
      <maml:navigationLink>
        <maml:linkText>Enable-SnippetPredictorKeyHandler</maml:linkText>
        <maml:uri>https://github.com/krymtkts/SnippetPredictor/blob/main/docs/SnippetPredictor/Enable-SnippetPredictorKeyHandler.md</maml:uri>
      </maml:navigationLink>
      <maml:navigationLink>
        <maml:linkText>New-SnippetPredictorKeyHandler</maml:linkText>
        <maml:uri>https://github.com/krymtkts/SnippetPredictor/blob/main/docs/SnippetPredictor/New-SnippetPredictorKeyHandler.md</maml:uri>
      </maml:navigationLink>
      <maml:navigationLink>
        <maml:linkText>SnippetPredictor.md</maml:linkText>
        <maml:uri>https://github.com/krymtkts/SnippetPredictor/blob/main/docs/SnippetPredictor/SnippetPredictor.md</maml:uri>
      </maml:navigationLink>
    </command:relatedLinks>
  </command:command>
  <command:command>
    <command:details>
      <command:name>Enable-SnippetPredictorKeyHandler</command:name>
      <maml:description>
        <maml:para>Registers opt-in PSReadLine key bindings for SnippetPredictor.</maml:para>
      </maml:description>
      <command:verb>Enable</command:verb>
      <command:noun>SnippetPredictorKeyHandler</command:noun>
    </command:details>
    <maml:description>
      <maml:para>Registers PSReadLine key bindings for SnippetPredictor completion.
A chord is the key or sequence of keys assigned to a handler.

By default, the command binds Tab and Shift+Tab.
Use `-NextChord` and `-PreviousChord` to select other chords.

The handlers accept `:` or a partial identifier.
They complete `:snp` and matching group identifiers.
After a complete identifier, they complete matching snippets.
The `:tip` identifier isn't included.

Repeated Tab or Shift+Tab presses cycle through matching candidates.
When one candidate remains, the next press starts a new lookup using the replaced input.
For example, press Tab twice after `:sn`.
The first press completes `:snp`; the second starts snippet completion.

The cursor must be at the end of the line.
Every character before the identifier must be whitespace.
Unsupported input delegates to standard PSReadLine completion.

Specify `-AcceptChord` to register an accept handler.
For a partial identifier, it replaces the command line with the first matching complete identifier.
For a complete identifier with one matching snippet, it replaces the command line with that snippet.
When more than one snippet matches a complete identifier, it invokes `NextSuggestion`.
This selects the first item in the prediction ListView.
Replacement and prediction selection leave the line open.
No matching candidate or unsupported input delegates to the standard PSReadLine `AcceptLine` action.
In Vi mode, the command registers the accept handler in Insert mode.

The command doesn't change prediction ListView navigation.
Use the standard PSReadLine UpArrow and DownArrow bindings to navigate the ListView.</maml:para>
    </maml:description>
    <command:syntax>
      <command:syntaxItem>
        <maml:name>Enable-SnippetPredictorKeyHandler</maml:name>
        <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="0" aliases="none">
          <maml:name>NextChord</maml:name>
          <maml:description />
          <command:parameterValue required="true" variableLength="false">string</command:parameterValue>
          <dev:type>
            <maml:name>System.String</maml:name>
          </dev:type>
        </command:parameter>
        <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="1" aliases="none">
          <maml:name>PreviousChord</maml:name>
          <maml:description />
          <command:parameterValue required="true" variableLength="false">string</command:parameterValue>
          <dev:type>
            <maml:name>System.String</maml:name>
          </dev:type>
        </command:parameter>
        <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="2" aliases="none">
          <maml:name>AcceptChord</maml:name>
          <maml:description />
          <command:parameterValue required="true" variableLength="false">string</command:parameterValue>
          <dev:type>
            <maml:name>System.String</maml:name>
          </dev:type>
        </command:parameter>
      </command:syntaxItem>
    </command:syntax>
    <command:parameters>
      <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="2" aliases="none">
        <maml:name>AcceptChord</maml:name>
        <maml:description>
          <maml:para>Specifies the key or sequence of keys to bind to the accept handler.
If omitted, the command doesn't register an accept handler.</maml:para>
        </maml:description>
        <command:parameterValue required="true" variableLength="true">System.String</command:parameterValue>
        <dev:type>
          <maml:name>System.String</maml:name>
        </dev:type>
      </command:parameter>
      <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="0" aliases="none">
        <maml:name>NextChord</maml:name>
        <maml:description>
          <maml:para>Specifies the key or sequence of keys to bind to the next completion handler.</maml:para>
        </maml:description>
        <command:parameterValue required="true" variableLength="true">System.String</command:parameterValue>
        <dev:type>
          <maml:name>System.String</maml:name>
        </dev:type>
      </command:parameter>
      <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="1" aliases="none">
        <maml:name>PreviousChord</maml:name>
        <maml:description>
          <maml:para>Specifies the key or sequence of keys to bind to the previous completion handler.</maml:para>
        </maml:description>
        <command:parameterValue required="true" variableLength="true">System.String</command:parameterValue>
        <dev:type>
          <maml:name>System.String</maml:name>
        </dev:type>
      </command:parameter>
    </command:parameters>
    <command:inputTypes />
    <command:returnValues>
      <command:returnValue>
        <dev:type>
          <maml:name>System.Object</maml:name>
        </dev:type>
        <maml:description>
          <maml:para>No output.</maml:para>
        </maml:description>
      </command:returnValue>
    </command:returnValues>
    <maml:alertSet>
      <maml:alert>
        <maml:para>The command doesn't change the PSReadLine prediction source or view style.
The command overwrites existing bindings for the selected chords.
It doesn't preserve an arbitrary custom action for later restoration.
The bindings apply to the current PowerShell session.
Enabling the handlers again first cleans up bindings from the previous call.
Use `Disable-SnippetPredictorKeyHandler` to remove the registered bindings explicitly.
Removing the SnippetPredictor module performs the same cleanup automatically.
Identifier matching is case-sensitive.
Snippet matching follows the `SearchCaseSensitive` configuration value.
Input such as `x :` isn't handled because a non-whitespace character precedes the identifier.
During cleanup, the command assigns `TabCompleteNext` to Tab and `TabCompletePrevious` to Shift+Tab.
It assigns `AcceptLine` to Enter when Enter is a registered chord.
The command removes bindings for other registered chords.
A binding replaced by the user after this command runs isn't changed during cleanup.</maml:para>
      </maml:alert>
    </maml:alertSet>
    <command:examples>
      <command:example>
        <maml:title>--------- Example 1 ---------</maml:title>
        <maml:introduction>
          <maml:para>```powershell
Enable-SnippetPredictorKeyHandler
```</maml:para>
          <maml:para>&#x80;</maml:para>
          <maml:para>Registers completion bindings for the default Tab and Shift+Tab chords.
Type `:` and press Tab to cycle through `:snp` and configured group identifiers.</maml:para>
        </maml:introduction>
        <dev:code />
        <dev:remarks />
      </command:example>
      <command:example>
        <maml:title>--------- Example 2 ---------</maml:title>
        <maml:introduction>
          <maml:para>```powershell
Enable-SnippetPredictorKeyHandler -AcceptChord Enter
```</maml:para>
          <maml:para>&#x80;</maml:para>
          <maml:para>Registers the accept handler on Enter with the default completion bindings.
For a partial identifier with matches, pressing Enter replaces the command line.</maml:para>
        </maml:introduction>
        <dev:code />
        <dev:remarks />
      </command:example>
      <command:example>
        <maml:title>--------- Example 3 ---------</maml:title>
        <maml:introduction>
          <maml:para>```powershell
Enable-SnippetPredictorKeyHandler -NextChord Ctrl+j -PreviousChord Ctrl+k
Disable-SnippetPredictorKeyHandler
```</maml:para>
          <maml:para>&#x80;</maml:para>
          <maml:para>Registers and then removes completion bindings for custom chords.</maml:para>
        </maml:introduction>
        <dev:code />
        <dev:remarks />
      </command:example>
    </command:examples>
    <command:relatedLinks>
      <maml:navigationLink>
        <maml:linkText>Online Version</maml:linkText>
        <maml:uri>https://github.com/krymtkts/SnippetPredictor/blob/main/docs/SnippetPredictor/Enable-SnippetPredictorKeyHandler.md</maml:uri>
      </maml:navigationLink>
      <maml:navigationLink>
        <maml:linkText>Disable-SnippetPredictorKeyHandler</maml:linkText>
        <maml:uri>https://github.com/krymtkts/SnippetPredictor/blob/main/docs/SnippetPredictor/Disable-SnippetPredictorKeyHandler.md</maml:uri>
      </maml:navigationLink>
      <maml:navigationLink>
        <maml:linkText>New-SnippetPredictorKeyHandler</maml:linkText>
        <maml:uri>https://github.com/krymtkts/SnippetPredictor/blob/main/docs/SnippetPredictor/New-SnippetPredictorKeyHandler.md</maml:uri>
      </maml:navigationLink>
      <maml:navigationLink>
        <maml:linkText>SnippetPredictor.md</maml:linkText>
        <maml:uri>https://github.com/krymtkts/SnippetPredictor/blob/main/docs/SnippetPredictor/SnippetPredictor.md</maml:uri>
      </maml:navigationLink>
    </command:relatedLinks>
  </command:command>
  <command:command>
    <command:details>
      <command:name>Get-Snippet</command:name>
      <maml:description>
        <maml:para>Retrieves a saved snippets.</maml:para>
      </maml:description>
      <command:verb>Get</command:verb>
      <command:noun>Snippet</command:noun>
    </command:details>
    <maml:description>
      <maml:para>Retrieves a saved snippets.
The save snippets stored in the snippet configuration.
The snippet configuration resides in `~/.snippet-predictor.json`.</maml:para>
    </maml:description>
    <command:syntax>
      <command:syntaxItem>
        <maml:name>Get-Snippet</maml:name>
      </command:syntaxItem>
    </command:syntax>
    <command:parameters />
    <command:inputTypes />
    <command:returnValues>
      <command:returnValue>
        <dev:type>
          <maml:name>SnippetPredictor.SnippetEntry</maml:name>
        </dev:type>
        <maml:description>
          <maml:para>A record containing a snippet and its tooltip.</maml:para>
        </maml:description>
      </command:returnValue>
    </command:returnValues>
    <maml:alertSet>
      <maml:alert>
        <maml:para />
      </maml:alert>
    </maml:alertSet>
    <command:examples>
      <command:example>
        <maml:title>--------- Example 1 ---------</maml:title>
        <maml:introduction>
          <maml:para>```powershell
Get-Snippet
```</maml:para>
          <maml:para>&#x80;</maml:para>
          <maml:para>Retrieves a saved snippets.</maml:para>
        </maml:introduction>
        <dev:code />
        <dev:remarks />
      </command:example>
    </command:examples>
    <command:relatedLinks>
      <maml:navigationLink>
        <maml:linkText>Online Version</maml:linkText>
        <maml:uri>https://github.com/krymtkts/SnippetPredictor/blob/main/docs/SnippetPredictor/Get-Snippet.md</maml:uri>
      </maml:navigationLink>
      <maml:navigationLink>
        <maml:linkText>SnippetPredictor.md</maml:linkText>
        <maml:uri>https://github.com/krymtkts/SnippetPredictor/blob/main/docs/SnippetPredictor/SnippetPredictor.md</maml:uri>
      </maml:navigationLink>
    </command:relatedLinks>
  </command:command>
  <command:command>
    <command:details>
      <command:name>New-SnippetPredictorKeyHandler</command:name>
      <maml:description>
        <maml:para>Returns a composable SnippetPredictor key handler for custom key bindings.</maml:para>
      </maml:description>
      <command:verb>New</command:verb>
      <command:noun>SnippetPredictorKeyHandler</command:noun>
    </command:details>
    <maml:description>
      <maml:para>Returns a composable script block for the selected SnippetPredictor action.

The script block returns `$true` when it handles the current input and `$false` otherwise.
The caller must use the result to choose fallback behavior.

The completion actions use the same input scope as `Enable-SnippetPredictorKeyHandler`.
The suggestion actions navigate the prediction ListView.

This command doesn't register or manage a PSReadLine key binding.
Do not register the returned script block directly with `Set-PSReadLineKeyHandler`.
The caller owns any binding created from the returned script block.</maml:para>
    </maml:description>
    <command:syntax>
      <command:syntaxItem>
        <maml:name>New-SnippetPredictorKeyHandler</maml:name>
        <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="0" aliases="none">
          <maml:name>Action</maml:name>
          <maml:description />
          <command:parameterValueGroup>
            <command:parameterValue required="false" variableLength="false">TabCompleteNext</command:parameterValue>
            <command:parameterValue required="false" variableLength="false">TabCompletePrevious</command:parameterValue>
            <command:parameterValue required="false" variableLength="false">NextSuggestion</command:parameterValue>
            <command:parameterValue required="false" variableLength="false">PreviousSuggestion</command:parameterValue>
          </command:parameterValueGroup>
          <command:parameterValue required="true" variableLength="false">string</command:parameterValue>
          <dev:type>
            <maml:name>System.String</maml:name>
          </dev:type>
        </command:parameter>
      </command:syntaxItem>
    </command:syntax>
    <command:parameters>
      <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="0" aliases="none">
        <maml:name>Action</maml:name>
        <maml:description>
          <maml:para>Specifies the SnippetPredictor action implemented by the returned script block.</maml:para>
        </maml:description>
        <command:parameterValueGroup>
          <command:parameterValue required="false" variableLength="false">TabCompleteNext</command:parameterValue>
          <command:parameterValue required="false" variableLength="false">TabCompletePrevious</command:parameterValue>
          <command:parameterValue required="false" variableLength="false">NextSuggestion</command:parameterValue>
          <command:parameterValue required="false" variableLength="false">PreviousSuggestion</command:parameterValue>
        </command:parameterValueGroup>
        <command:parameterValue required="true" variableLength="true">System.String</command:parameterValue>
        <dev:type>
          <maml:name>System.String</maml:name>
        </dev:type>
      </command:parameter>
    </command:parameters>
    <command:inputTypes />
    <command:returnValues>
      <command:returnValue>
        <dev:type>
          <maml:name>System.Object</maml:name>
        </dev:type>
        <maml:description>
          <maml:para>A fixed `System.Management.Automation.ScriptBlock`.
The script block returns whether SnippetPredictor handled the input.</maml:para>
        </maml:description>
      </command:returnValue>
    </command:returnValues>
    <maml:alertSet>
      <maml:alert>
        <maml:para>The returned script block belongs to the SnippetPredictor script module.
It shares the module's handler state.
Tab completion requires the cursor at the end of the line.
Every character before the identifier must be whitespace.
Identifier matching is case-sensitive.
Snippet matching follows the `SearchCaseSensitive` configuration value.</maml:para>
      </maml:alert>
    </maml:alertSet>
    <command:examples>
      <command:example>
        <maml:title>--------- Example 1 ---------</maml:title>
        <maml:introduction>
          <maml:para>```powershell
$handler = New-SnippetPredictorKeyHandler -Action NextSuggestion
```</maml:para>
          <maml:para>&#x80;</maml:para>
          <maml:para>Returns the fixed handler for selecting the next prediction.</maml:para>
        </maml:introduction>
        <dev:code />
        <dev:remarks />
      </command:example>
      <command:example>
        <maml:title>--------- Example 2 ---------</maml:title>
        <maml:introduction>
          <maml:para>```powershell
$snippetHandler = New-SnippetPredictorKeyHandler -Action TabCompleteNext
$userAction = {
    param($key, $arg)</maml:para>
          <maml:para>&#x80;</maml:para>
          <maml:para>[Microsoft.PowerShell.PSConsoleReadLine]::Insert((Get-Date -Format 'yyyy-MM-dd'))
}
$composedHandler = {
    param($key, $arg)</maml:para>
          <maml:para>&#x80;</maml:para>
          <maml:para>if (-not (&amp; $snippetHandler $key $arg)) {
        &amp; $userAction $key $arg
    }
}.GetNewClosure()</maml:para>
          <maml:para>&#x80;</maml:para>
          <maml:para>Set-PSReadLineKeyHandler `
    -Chord Ctrl+Alt+d `
    -ScriptBlock $composedHandler `
    -BriefDescription 'SnippetPredictorOrUserAction' `
    -Description 'Complete SnippetPredictor input or run the user action'
```</maml:para>
          <maml:para>&#x80;</maml:para>
          <maml:para>Registers a caller-owned key binding for the composed handler.
The composed handler first tries SnippetPredictor completion.
When the input isn't supported, it invokes the user action.
The user action inserts the current date into the command line.
The wrapper forwards the PSReadLine key and argument to the SnippetPredictor handler.
When completion isn't supported, it forwards them to the user action.
It uses `GetNewClosure()` to keep both script blocks accessible after registration.
`Set-PSReadLineKeyHandler` replaces any existing `Ctrl+Alt+d` binding.
The caller removes or replaces that binding.</maml:para>
        </maml:introduction>
        <dev:code />
        <dev:remarks />
      </command:example>
    </command:examples>
    <command:relatedLinks>
      <maml:navigationLink>
        <maml:linkText>Online Version</maml:linkText>
        <maml:uri>https://github.com/krymtkts/SnippetPredictor/blob/main/docs/SnippetPredictor/New-SnippetPredictorKeyHandler.md</maml:uri>
      </maml:navigationLink>
      <maml:navigationLink>
        <maml:linkText>Disable-SnippetPredictorKeyHandler</maml:linkText>
        <maml:uri>https://github.com/krymtkts/SnippetPredictor/blob/main/docs/SnippetPredictor/Disable-SnippetPredictorKeyHandler.md</maml:uri>
      </maml:navigationLink>
      <maml:navigationLink>
        <maml:linkText>Enable-SnippetPredictorKeyHandler</maml:linkText>
        <maml:uri>https://github.com/krymtkts/SnippetPredictor/blob/main/docs/SnippetPredictor/Enable-SnippetPredictorKeyHandler.md</maml:uri>
      </maml:navigationLink>
      <maml:navigationLink>
        <maml:linkText>SnippetPredictor.md</maml:linkText>
        <maml:uri>https://github.com/krymtkts/SnippetPredictor/blob/main/docs/SnippetPredictor/SnippetPredictor.md</maml:uri>
      </maml:navigationLink>
    </command:relatedLinks>
  </command:command>
  <command:command>
    <command:details>
      <command:name>Remove-Snippet</command:name>
      <maml:description>
        <maml:para>Remove specified snippets from the snippet configuration.</maml:para>
      </maml:description>
      <command:verb>Remove</command:verb>
      <command:noun>Snippet</command:noun>
    </command:details>
    <maml:description>
      <maml:para>Remove specified snippets from the snippet configuration. The snippet
configuration resides in `~/.snippet-predictor.json`.</maml:para>
    </maml:description>
    <command:syntax>
      <command:syntaxItem>
        <maml:name>Remove-Snippet</maml:name>
        <command:parameter required="true" variableLength="false" globbing="false" pipelineInput="false" position="0" aliases="none">
          <maml:name>Snippet</maml:name>
          <maml:description />
          <command:parameterValue required="true" variableLength="false">string</command:parameterValue>
          <dev:type>
            <maml:name>System.String</maml:name>
          </dev:type>
        </command:parameter>
      </command:syntaxItem>
    </command:syntax>
    <command:parameters>
      <command:parameter required="true" variableLength="false" globbing="false" pipelineInput="true (ByValue, ByPropertyName)" position="0" aliases="none">
        <maml:name>Snippet</maml:name>
        <maml:description>
          <maml:para>The text of the snippet to remove</maml:para>
        </maml:description>
        <command:parameterValue required="true" variableLength="true">System.String</command:parameterValue>
        <dev:type>
          <maml:name>System.String</maml:name>
        </dev:type>
      </command:parameter>
    </command:parameters>
    <command:inputTypes>
      <command:inputType>
        <dev:type>
          <maml:name>System.String</maml:name>
        </dev:type>
        <maml:description>
          <maml:para>The snippet string to remove.</maml:para>
        </maml:description>
      </command:inputType>
    </command:inputTypes>
    <command:returnValues>
      <command:returnValue>
        <dev:type>
          <maml:name>System.Object</maml:name>
        </dev:type>
        <maml:description>
          <maml:para>No output.</maml:para>
        </maml:description>
      </command:returnValue>
    </command:returnValues>
    <maml:alertSet>
      <maml:alert>
        <maml:para />
      </maml:alert>
    </maml:alertSet>
    <command:examples>
      <command:example>
        <maml:title>--------- Example 1 ---------</maml:title>
        <maml:introduction>
          <maml:para>```powershell
Remove-Snippet "echo hello"
```</maml:para>
          <maml:para>&#x80;</maml:para>
          <maml:para>Remove the snippet.</maml:para>
        </maml:introduction>
        <dev:code />
        <dev:remarks />
      </command:example>
      <command:example>
        <maml:title>--------- Example 2 ---------</maml:title>
        <maml:introduction>
          <maml:para>```powershell
{echo hello} | Remove-Snippet
```</maml:para>
          <maml:para>&#x80;</maml:para>
          <maml:para>Remove the snippet. You can pass code blocks. Code blocks are implicitly
converted to strings through the pipeline.</maml:para>
        </maml:introduction>
        <dev:code />
        <dev:remarks />
      </command:example>
      <command:example>
        <maml:title>--------- Example 3 ---------</maml:title>
        <maml:introduction>
          <maml:para>```powershell
Get-Snippet | ? tooltip -like *test* | Remove-Snippet
```</maml:para>
          <maml:para>&#x80;</maml:para>
          <maml:para>Remove snippets whose tooltip contains "test".</maml:para>
        </maml:introduction>
        <dev:code />
        <dev:remarks />
      </command:example>
    </command:examples>
    <command:relatedLinks>
      <maml:navigationLink>
        <maml:linkText>Online Version</maml:linkText>
        <maml:uri>https://github.com/krymtkts/SnippetPredictor/blob/main/docs/SnippetPredictor/Remove-Snippet.md</maml:uri>
      </maml:navigationLink>
      <maml:navigationLink>
        <maml:linkText>SnippetPredictor.md</maml:linkText>
        <maml:uri>https://github.com/krymtkts/SnippetPredictor/blob/main/docs/SnippetPredictor/SnippetPredictor.md</maml:uri>
      </maml:navigationLink>
    </command:relatedLinks>
  </command:command>
</helpItems>