Open intoverflow opened 2 years ago
This seems related/a duplicate of #257, and the same dev response seems to apply:
Ok, as far as I see, this would require some rewriting, as for example we currently access the file system of the host in the extension using the node package fs. (for example, to look for the _CoqProject).
The OCaml Platform extension has features for detecting & changing your opam switch. It appears to work in remote mode (see screenshot below). It would be amazing if the vscoq plugin could interact with the ocaml plugin to figure out which switch is active, detect when the switch changes, and locate the tools.
Briefly: vscoq works in Remote Development over SSH out of the box except for one little setting: the path to coqtop when coqtop is installed by opam.
Steps to reproduce
Launch vscode and connect to a remote development server per the instructions in Remote Development using SSH.
Open a remote folder containing a Coq project.
Open a file and start the interactive proof mode by interpreting the first sentence.
What happens
An error notification appears, triggered by failure at this line:
https://github.com/coq-community/vscoq/blob/a3025293e77c2b90c38486cb6fc7503b57c4b2bd/server/src/coqtop/CoqTop8.ts#L239
What's going on?
By default, vscoq assumes
coqtop
is in the search path (unless an explicit path is given in the settings, of course).Locally this works fine, even when
coqtop
is installed to some user-localopam
switch. But in a remote context, this strategy fails to locatecoqtop
.Workaround
Specify an explicit "Coqtop: Bin Path" in the vscoq extension settings. Note that you can edit your remote settings separately from your local settings, which makes this workaround livable.
Expected behavior
It would be nice if vscoq could locate
coqtop
automatically in a remote context. The "server" logic runs on the remote host, so in principle it could queryopam env
to figure it out.Relatedly, one might check to see what the ocaml community does about this (if anything).