File tree Expand file tree Collapse file tree 1 file changed +17
-2
lines changed
src/PowerShellEditorServices/Language Expand file tree Collapse file tree 1 file changed +17
-2
lines changed Original file line number Diff line number Diff line change @@ -90,9 +90,24 @@ static public async Task<CommandCompletion> GetCompletions(
9090 command . AddParameter ( "PositionOfCursor" , cursorPosition ) ;
9191 command . AddParameter ( "Options" , null ) ;
9292
93- commandCompletion =
94- ( await powerShellContext . ExecuteCommand < CommandCompletion > ( command , false , false ) )
93+ PSObject outputObject =
94+ ( await powerShellContext . ExecuteCommand < PSObject > ( command , false , false ) )
9595 . FirstOrDefault ( ) ;
96+
97+ if ( outputObject != null )
98+ {
99+ ErrorRecord errorRecord = outputObject . BaseObject as ErrorRecord ;
100+ if ( errorRecord != null )
101+ {
102+ Logger . WriteException (
103+ "Encountered an error while invoking TabExpansion2 in the debugger" ,
104+ errorRecord . Exception ) ;
105+ }
106+ else
107+ {
108+ commandCompletion = outputObject . BaseObject as CommandCompletion ;
109+ }
110+ }
96111 }
97112 else if ( powerShellContext . CurrentRunspace . Runspace . RunspaceAvailability ==
98113 RunspaceAvailability . Available )
You can’t perform that action at this time.
0 commit comments