<p dir="auto">For the VS Code API tests I have a clean up function that signals that it is done when all editors are closed. Currently the solution is hacky, it needs to install a setInterval to periodically check on the <code class="notranslate">vscode.window.visibleTextEditors</code> property to eventually become 0 (see <a href="https://github.com/Microsoft/vscode/blob/master/extensions/vscode-api-tests/src/utils.ts#L52">https://github.com/Microsoft/vscode/blob/master/extensions/vscode-api-tests/src/utils.ts#L52</a>).</p>
<p dir="auto">The issue is that the <code class="notranslate">window.onDidChangeActiveTextEditor</code> event is not good enough for testing on the visible text editors as shown by the following test:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="test('visibleTextEditors', () =&gt; {
    return workspace.openTextDocument(join(workspace.rootPath, './far.js')).then(doc =&gt; {
        return window.showTextDocument(doc).then((editor) =&gt; {
            return new Promise((c, e) =&gt; {
                const listener = window.onDidChangeActiveTextEditor(d =&gt; {
                    console.log('editor is null?: ' + !d);
                    if (window.visibleTextEditors.length &gt; 0) {
                        console.log('visibleTextEditors count is: ' + window.visibleTextEditors.length);
                        return;
                    }

                    listener.dispose();
                    c();
                });

                commands.executeCommand('workbench.action.closeAllEditors').then(null, e);
            });
        });
    });
});"><pre class="notranslate"><code class="notranslate">test('visibleTextEditors', () =&gt; {
    return workspace.openTextDocument(join(workspace.rootPath, './far.js')).then(doc =&gt; {
        return window.showTextDocument(doc).then((editor) =&gt; {
            return new Promise((c, e) =&gt; {
                const listener = window.onDidChangeActiveTextEditor(d =&gt; {
                    console.log('editor is null?: ' + !d);
                    if (window.visibleTextEditors.length &gt; 0) {
                        console.log('visibleTextEditors count is: ' + window.visibleTextEditors.length);
                        return;
                    }

                    listener.dispose();
                    c();
                });

                commands.executeCommand('workbench.action.closeAllEditors').then(null, e);
            });
        });
    });
});
</code></pre></div>
<p dir="auto">The value passed in from the event is null as expected because I am running the close all editors action. However, <code class="notranslate">window.visibleTextEditors.length</code> is still 1 at that point.</p>
<ul dir="auto">
<li>VSCode Version: 0.10.11</li>
<li>OS Version: Windows Server 2008 R2</li>
</ul>
<p dir="auto">Steps to Reproduce:</p>
<ol dir="auto">
<li>Log in as a unprivileged user</li>
<li>Run the VS Code installer as Administrator and enter password</li>
<li>Tap both "Open with Code" checkboxes in the wizard</li>
<li>Right-click on a file or folder</li>
</ol>
<p dir="auto">The "Open with Code" option is missing. I have not investigated this more than the reproduce steps above so it may be unrelated to the user being unprivileged.</p>