This should be updated to use the new parser directly from the PowerShell APIs in C# and return a proper edit (potentially deprecating the need for an entirely separate custom request).
Actually, are we certain that useLocalScope is defaulting to true? I was looking at the code and that doesn't appear to be the case. The second argument is isScript.
Prerequisites
Summary
In the following code we (repeatedly) define an internal PowerShell script that uses the original parser to expand the alias.
https://github.com/PowerShell/PowerShellEditorServices/blob/37f0648ca28358c1fd2d0688801658948f69090d/src/PowerShellEditorServices/Services/PowerShell/Handlers/ExpandAliasHandler.cs#L32-L71
Proposed Design
This should be updated to use the new parser directly from the PowerShell APIs in C# and return a proper edit (potentially deprecating the need for an entirely separate custom request).