File tree 1 file changed +17
-2
lines changed
src/PowerShellEditorServices/Language
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(
90
90
command . AddParameter ( "PositionOfCursor" , cursorPosition ) ;
91
91
command . AddParameter ( "Options" , null ) ;
92
92
93
- commandCompletion =
94
- ( await powerShellContext . ExecuteCommand < CommandCompletion > ( command , false , false ) )
93
+ PSObject outputObject =
94
+ ( await powerShellContext . ExecuteCommand < PSObject > ( command , false , false ) )
95
95
. 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
+ }
96
111
}
97
112
else if ( powerShellContext . CurrentRunspace . Runspace . RunspaceAvailability ==
98
113
RunspaceAvailability . Available )
You can’t perform that action at this time.
0 commit comments