feat: 避免打开同一个项目(home、open with vscode)
This commit is contained in:
		@@ -30,7 +30,7 @@ export default class RemoteContainer {
 | 
			
		||||
      .then((res) => {
 | 
			
		||||
        if (res === 'success') {
 | 
			
		||||
          //  only success then open folder
 | 
			
		||||
          this.openRemoteFolder(host, port, username, path);
 | 
			
		||||
          this.openRemoteFolder(host, port, username, path, context);
 | 
			
		||||
        }
 | 
			
		||||
      })
 | 
			
		||||
  }
 | 
			
		||||
@@ -232,7 +232,7 @@ export default class RemoteContainer {
 | 
			
		||||
   * 
 | 
			
		||||
   * @host 表示project name
 | 
			
		||||
   */
 | 
			
		||||
  openRemoteFolder(host: string, port: number, username: string, path: string): void {
 | 
			
		||||
  openRemoteFolder(host: string, port: number, username: string, path: string, context:vscode.ExtensionContext): void {
 | 
			
		||||
    if (vscode.env.remoteName) {
 | 
			
		||||
      // 远程环境,打开local terminal
 | 
			
		||||
      vscode.commands.executeCommand('workbench.action.terminal.newLocal').then(() => {
 | 
			
		||||
@@ -245,6 +245,9 @@ export default class RemoteContainer {
 | 
			
		||||
      })
 | 
			
		||||
    } else {
 | 
			
		||||
      // 本地环境
 | 
			
		||||
      // 在打开之前,需要先将host的信息记录到global state中,让home能够确认打开的host是哪个project的
 | 
			
		||||
      context.globalState.update('currentHost', host)
 | 
			
		||||
 | 
			
		||||
      let terminal = vscode.window.activeTerminal || vscode.window.createTerminal(`Ext Terminal`);
 | 
			
		||||
      terminal.show(true);
 | 
			
		||||
      // 在原窗口打开
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user