Skip to content

Commit

Permalink
Fix for VS Code debug console: view opens sdfg in VS Code and not in …
Browse files Browse the repository at this point in the history
…browser (#1419)

* Fix for VS Code debug console: view opens sdfg in VS Code and not in browser

* Fix for VS Code debug console: view opens sdfg in VS Code and not in browser

---------

Co-authored-by: Christos Kotsalos <[email protected]>
  • Loading branch information
kotsaloscv and kotsaloscv authored Nov 1, 2023
1 parent 3ddd2cc commit 9ff33a7
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion dace/cli/sdfv.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,11 @@ def view(sdfg: dace.SDFG, filename: Optional[Union[str, int]] = None):
"""
# If vscode is open, try to open it inside vscode
if filename is None:
if 'VSCODE_IPC_HOOK_CLI' in os.environ or 'VSCODE_GIT_IPC_HANDLE' in os.environ:
if (
'VSCODE_IPC_HOOK' in os.environ
or 'VSCODE_IPC_HOOK_CLI' in os.environ
or 'VSCODE_GIT_IPC_HANDLE' in os.environ
):
filename = tempfile.mktemp(suffix='.sdfg')
sdfg.save(filename)
os.system(f'code {filename}')
Expand Down

0 comments on commit 9ff33a7

Please sign in to comment.