Skip to content

Commit

Permalink
start vscode with a default application
Browse files Browse the repository at this point in the history
  • Loading branch information
midays committed Apr 17, 2024
1 parent 25d1bb7 commit 084f09b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/fixtures/ide.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,9 @@ def setup_vscode(vscode_config, config):
Fixture to setup vs code application
"""
vscode = VisualStudioCode()
path = vscode_config["ide_path"]
vscode.open_application(path)
vscode_path = vscode_config["ide_path"]
default_application = config["project_path"]
vscode.open_application(vscode_path, default_application)
vscode.set_default_timeout(timeout=config["timeout_in_seconds"])
time.sleep(3)
yield vscode
Expand Down
4 changes: 4 additions & 0 deletions src/models/IDE/VisualStudioCode.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ def __init__(self):
self.chrome = Chrome()
super().__init__()

def open_application(self, vscode_path, default_application):
subprocess.run(f'{vscode_path} {default_application}', shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)


def cmd_palette_exec_command(self, command: VSCodeCommandEnum):
"""
Execute commands in the command palette in vscode
Expand Down

0 comments on commit 084f09b

Please sign in to comment.