File tree Expand file tree Collapse file tree
src/PowerShellEditorServices/Services Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -110,6 +110,9 @@ public Token[] ScriptTokens
110110
111111 internal ReferenceTable References { get ; }
112112
113+ /// <summary>
114+ /// Indicates whether the file is currently open in the editor. PSES may open files for analysis that aren't actually visible in the editor.
115+ /// </summary>
113116 internal bool IsOpen { get ; set ; }
114117
115118 #endregion
Original file line number Diff line number Diff line change @@ -302,7 +302,14 @@ public void CloseFile(ScriptFile scriptFile)
302302 Validate . IsNotNull ( nameof ( scriptFile ) , scriptFile ) ;
303303
304304 string keyName = GetFileKey ( scriptFile . DocumentUri ) ;
305- workspaceFiles . TryRemove ( keyName , out ScriptFile _ ) ;
305+ if ( workspaceFiles . TryRemove ( keyName , out ScriptFile _ ) )
306+ {
307+ logger . LogDebug ( "Closed file: " + scriptFile . DocumentUri ) ;
308+ }
309+ else
310+ {
311+ logger . LogWarning ( "Tried to close file that was not open: " + scriptFile . DocumentUri ) ;
312+ }
306313 }
307314
308315 /// <summary>
You can’t perform that action at this time.
0 commit comments