title: How to open file in same VSCode window instance tab after opening folder
body: <p>I tried to open folder first in new VScode window and then open file in same VScode window, but the folder is opening and the file is not opening. For reference I tried like <a href="https://stackoverflow.com/questions/44123722/vscode-opening-a-folder-and-a-file-from-the-same-routine">this</a>.
  It will be great if you provide any suggestion to handle this case.</p>
  <p>Here is my code, how i tried.</p>
  <p><strong>Case1</strong>: Only folder is opening.</p>
  <pre class="lang-js prettyprint-override"><code>let uri =  vscode.Uri.file(apiPath);
  await vscode.commands.executeCommand(&quot;vscode.openFolder&quot;, uri, {
       forceNewWindow: true,
  }).then(async function(){
       let filePath = vscode.Uri.file(path.join(apiPath, &quot;Abc.java&quot;));
       await vscode.commands.executeCommand(&quot;vscode.open&quot;, filePath);
  })
  
  </code></pre>
  <p><strong>Case2</strong>: Both folder and file is opening but in different VScode windows.</p>
  <pre class="lang-js prettyprint-override"><code>let uri =  vscode.Uri.file(apiPath);
  await vscode.commands.executeCommand(&quot;vscode.openFolder&quot;, uri, {
       forceNewWindow: true,
  });
  
  let filePath = vscode.Uri.file(path.join(apiPath, &quot;Abc.java&quot;));
  await vscode.commands.executeCommand(&quot;vscode.open&quot;, filePath);
  
  </code></pre>