You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When ucm is auto-run by the extension, it doesn’t run from the directory of the file that triggered ucm, resulting in commands like edit writing to the wrong location.
replication
Open a non-Unison workspace in VS Code.
Make sure the Unison extension has unison.automaticallyOpenUCM set to true.
Open or create a scratch.u file in a different directory.
At this point, ucm should auto-run in a terminal. However, it runs from the directory of the non-Unison workspace. And so edit, etc. will not use the scratch file you opened, but create a new one elsewhere.
notes
If you open VS Code without a workspace, or in a workspace with an existing scratch.u that you are using, it works fine, because the terminal will start in the expected directory, but there are cases where the terminal’s directory doesn’t match the directory we’d like ucm to run from.
solution
Change the launch command from ucm to cd "$(dirname FILE)"; ucm (or use && instead of ; – not sure what the best behavior is if the cd fails somehow).
Alternatively, we could add an option like --scratch-file /path/to/scratch.u or --watch-dir /path/to/to ucm and have the launch command be ucm --watch-dir "$(dirname FILE)". I like this option because it makes ucm more independent of its run context, but it does require more work.
The text was updated successfully, but these errors were encountered:
When
ucm
is auto-run by the extension, it doesn’t run from the directory of the file that triggereducm
, resulting in commands likeedit
writing to the wrong location.replication
unison.automaticallyOpenUCM
set totrue
.At this point,
ucm
should auto-run in a terminal. However, it runs from the directory of the non-Unison workspace. And soedit
, etc. will not use the scratch file you opened, but create a new one elsewhere.notes
If you open VS Code without a workspace, or in a workspace with an existing scratch.u that you are using, it works fine, because the terminal will start in the expected directory, but there are cases where the terminal’s directory doesn’t match the directory we’d like
ucm
to run from.solution
Change the launch command from
ucm
tocd "$(dirname FILE)"; ucm
(or use&&
instead of;
– not sure what the best behavior is if thecd
fails somehow).Alternatively, we could add an option like
--scratch-file /path/to/scratch.u
or--watch-dir /path/to/
toucm
and have the launch command beucm --watch-dir "$(dirname FILE)"
. I like this option because it makesucm
more independent of its run context, but it does require more work.The text was updated successfully, but these errors were encountered: