File tree Expand file tree Collapse file tree 4 files changed +1
-417
lines changed
Microsoft.PowerShell.ConsoleHost/host/msh
System.Management.Automation Expand file tree Collapse file tree 4 files changed +1
-417
lines changed Original file line number Diff line number Diff line change @@ -2568,14 +2568,7 @@ internal void Run(bool inputLoopIsNested)
25682568 // Evaluate any suggestions
25692569 if ( previousResponseWasEmpty == false )
25702570 {
2571- if ( ExperimentalFeature . IsEnabled ( ExperimentalFeature . PSFeedbackProvider ) )
2572- {
2573- EvaluateFeedbacks ( ui ) ;
2574- }
2575- else
2576- {
2577- EvaluateSuggestions ( ui ) ;
2578- }
2571+ EvaluateFeedbacks ( ui ) ;
25792572 }
25802573
25812574 // Then output the prompt
@@ -2899,44 +2892,6 @@ private void EvaluateFeedbacks(ConsoleHostUserInterface ui)
28992892 }
29002893 }
29012894
2902- private void EvaluateSuggestions ( ConsoleHostUserInterface ui )
2903- {
2904- // Output any training suggestions
2905- try
2906- {
2907- List < string > suggestions = HostUtilities . GetSuggestion ( _parent . Runspace ) ;
2908-
2909- if ( suggestions . Count > 0 )
2910- {
2911- ui . WriteLine ( ) ;
2912- }
2913-
2914- bool first = true ;
2915- foreach ( string suggestion in suggestions )
2916- {
2917- if ( ! first )
2918- ui . WriteLine ( ) ;
2919-
2920- ui . WriteLine ( suggestion ) ;
2921-
2922- first = false ;
2923- }
2924- }
2925- catch ( TerminateException )
2926- {
2927- // A variable breakpoint may be hit by HostUtilities.GetSuggestion. The debugger throws TerminateExceptions to stop the execution
2928- // of the current statement; we do not want to treat these exceptions as errors.
2929- }
2930- catch ( Exception e )
2931- {
2932- // Catch-all OK. This is a third-party call-out.
2933- ui . WriteErrorLine ( e . Message ) ;
2934-
2935- LocalRunspace localRunspace = ( LocalRunspace ) _parent . Runspace ;
2936- localRunspace . GetExecutionContext . AppendDollarError ( e ) ;
2937- }
2938- }
2939-
29402895 private string EvaluatePrompt ( )
29412896 {
29422897 string promptString = _promptExec . ExecuteCommandAndGetResultAsString ( "prompt" , out _ ) ;
Original file line number Diff line number Diff line change 11// Copyright (c) Microsoft Corporation.
22// Licensed under the MIT License.
33
4- using System . Collections ;
54using System . Collections . Generic ;
65using System . Collections . ObjectModel ;
76using System . Linq ;
@@ -21,7 +20,6 @@ public class ExperimentalFeature
2120 #region Const Members
2221
2322 internal const string EngineSource = "PSEngine" ;
24- internal const string PSFeedbackProvider = "PSFeedbackProvider" ;
2523 internal const string PSSerializeJSONLongEnumAsNumber = nameof ( PSSerializeJSONLongEnumAsNumber ) ;
2624
2725 #endregion
@@ -108,9 +106,6 @@ static ExperimentalFeature()
108106 new ExperimentalFeature (
109107 name : "PSLoadAssemblyFromNativeCode" ,
110108 description : "Expose an API to allow assembly loading from native code" ) ,
111- new ExperimentalFeature (
112- name : PSFeedbackProvider ,
113- description : "Replace the hard-coded suggestion framework with the extensible feedback provider" ) ,
114109 new ExperimentalFeature (
115110 name : PSSerializeJSONLongEnumAsNumber ,
116111 description : "Serialize enums based on long or ulong as an numeric value rather than the string representation when using ConvertTo-Json."
You can’t perform that action at this time.
0 commit comments