title: Getting powershell current line before ENTER is pressed
body: <p>I had an idea to write a visualizer that displays an AST of your PowerShell line as you type it. But to do this, the first step would be to get the text of the current line, <em>before it is submitted</em> (before ENTER is pressed), but I can't find an API function or hook to do this. Does one exist?</p>
  <p>I am using PowerShell Core 7.1.0 on the new Windows Terminal.</p>
  <h3>PredictiveSource</h3>
  <p>It seems like PSReadLine's PredictiveSource option might be able to be used for this, provided that it can be invoked on every letter entry and not just on TAB, but I can't find any info on the type contract for 3rd-party plugins after digging through both the docs and the the C# code...</p>
  <h3>Set-PSReadLineKeyHandler</h3>
  <p>As the legendary @mklement0 has suggested, perhaps <code>Set-PSReadLineKeyHandler</code> could be used. It appears to be intended for keybindings, but I'm still wrapping my head around how it could be used to this purpose.</p>