Open
Description
$psEditor.GetEditorContext
currently throws a AggregateException
wrapping a NullReferenceException
when not supported by the editor. It should throw a NotSupportedException
instead.
In Atom:
$psEditor.GetEditorContext()
# Exception calling "GetEditorContext" with "0" argument(s): "One or more errors occurred."
# At line:1 char:1
# + $psEditor.GetEditorContext()
# + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# + CategoryInfo : NotSpecified: (:) [], MethodInvocationException
# + FullyQualifiedErrorId : AggregateException
$Error[0].Exception.GetBaseException() | Format-List * -Force
# Message : Object reference not set to an instance of an object.
# Data : {}
# InnerException :
# TargetSite : Microsoft.PowerShell.EditorServices.Extensions.EditorContext
# ConvertClientEditorContext(Microsoft.PowerShell.EditorServices.Protocol.LanguageServer.ClientEditorContext)
# StackTrace : at Microsoft.PowerShell.EditorServices.Protocol.Server.LanguageServerEditorOperations.ConvertClientEditorContext(ClientEditorContext
# clientContext)
# at Microsoft.PowerShell.EditorServices.Protocol.Server.LanguageServerEditorOperations.<GetEditorContext>d__3.MoveNext()
# HelpLink :
# Source : Microsoft.PowerShell.EditorServices.Protocol
# HResult : -2147467261