Skip to content

Multi-root vscode workspaces not working #1696

@Martomate

Description

@Martomate

Problem

This extension does not seem to work inside multi-root VSCode workspaces. The ocamllsp and ocamlc commands are not found.

Context

I have a VSCode workspace where one of the projects is an OCaml project (using Dune). It looks something like this:

the_workspace
|- ocaml_project
'- another_project

I'm using the global switch and have installed the lsp and formatter. If I open the OCaml project as a folder in VSCode this extension works as expected, but when I open the enclosing workspace it does not work.

Workaround

I have created a custom sandbox and put it into the vscode settings for the workspace, like this:

"settings": {
	"ocaml.sandbox": {
		"kind": "custom",
		"template": "opam exec --switch=default --set-switch -- $prog $args"
	}
}

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions