@@ -50,8 +50,10 @@ public PsesConfigurationHandler(
50
50
public override async Task < Unit > Handle ( DidChangeConfigurationParams request , CancellationToken cancellationToken )
51
51
{
52
52
LanguageServerSettingsWrapper incomingSettings = request . Settings . ToObject < LanguageServerSettingsWrapper > ( ) ;
53
- if ( incomingSettings == null )
53
+ this . _logger . LogTrace ( "Handling DidChangeConfiguration" ) ;
54
+ if ( incomingSettings == null )
54
55
{
56
+ this . _logger . LogTrace ( "Incoming settings were null" ) ;
55
57
return await Unit . Task . ConfigureAwait ( false ) ;
56
58
}
57
59
@@ -73,16 +75,20 @@ public override async Task<Unit> Handle(DidChangeConfigurationParams request, Ca
73
75
if ( ! string . IsNullOrEmpty ( _configurationService . CurrentSettings . Cwd )
74
76
&& Directory . Exists ( _configurationService . CurrentSettings . Cwd ) )
75
77
{
78
+ this . _logger . LogTrace ( $ "Setting CWD (from config) to { _configurationService . CurrentSettings . Cwd } ") ;
76
79
await _powerShellContextService . SetWorkingDirectoryAsync (
77
80
_configurationService . CurrentSettings . Cwd ,
78
81
isPathAlreadyEscaped : false ) . ConfigureAwait ( false ) ;
79
82
80
83
} else if ( _workspaceService . WorkspacePath != null
81
84
&& Directory . Exists ( _workspaceService . WorkspacePath ) )
82
85
{
86
+ this . _logger . LogTrace ( $ "Setting CWD (from workspace) to { _workspaceService . WorkspacePath } ") ;
83
87
await _powerShellContextService . SetWorkingDirectoryAsync (
84
88
_workspaceService . WorkspacePath ,
85
89
isPathAlreadyEscaped : false ) . ConfigureAwait ( false ) ;
90
+ } else {
91
+ this . _logger . LogTrace ( "Tried to set CWD but in bad state" ) ;
86
92
}
87
93
88
94
this . _cwdSet = true ;
@@ -95,20 +101,24 @@ await _powerShellContextService.SetWorkingDirectoryAsync(
95
101
if ( _configurationService . CurrentSettings . EnableProfileLoading
96
102
&& ( ! this . _profilesLoaded || ! profileLoadingPreviouslyEnabled ) )
97
103
{
104
+ this . _logger . LogTrace ( "Loading profiles..." ) ;
98
105
await _powerShellContextService . LoadHostProfilesAsync ( ) . ConfigureAwait ( false ) ;
99
106
this . _profilesLoaded = true ;
107
+ this . _logger . LogTrace ( "Loaded!" ) ;
100
108
}
101
109
102
110
// Wait until after profiles are loaded (or not, if that's the
103
111
// case) before starting the interactive console.
104
112
if ( ! this . _consoleReplStarted )
105
113
{
106
114
// Start the interactive terminal
115
+ this . _logger . LogTrace ( "Starting command loop" ) ;
107
116
_powerShellContextService . ConsoleReader . StartCommandLoop ( ) ;
108
117
this . _consoleReplStarted = true ;
109
118
}
110
119
111
120
// Run any events subscribed to configuration updates
121
+ this . _logger . LogTrace ( "Running configuration update event handlers" ) ;
112
122
ConfigurationUpdated ( this , _configurationService . CurrentSettings ) ;
113
123
114
124
// Convert the editor file glob patterns into an array for the Workspace
0 commit comments