cairo icon indicating copy to clipboard operation
cairo copied to clipboard

Support multi-root workspaces and detached files in VSCode extension

Open Arcticae opened this issue 6 months ago • 0 comments

Basically, fix this TODO:

https://github.com/starkware-libs/cairo/blob/fdf3d70cd5f2924d74feeb1df89f5be43beffcbc/vscode-cairo/src/cairols.ts#L91-L92

There is an example that we should carefully implement on our side:

https://github.com/microsoft/vscode-extension-samples/blob/main/lsp-multi-server-sample/client/src/extension.ts

We should always try to find a matching Scarb workspaces/cairo_project.toml file for any opened *.cairo file.

How looking for asdf-installed Scarb should look like

If we fail to do so, try to look for any global Scarb installation.

If asdf shim says that it cannot pick any global (for example, there are multiple scarb installed, but none is set as global), we should assume the latest stable installation available on the user's machine.

Example

Image

Example what could go wrong before this task is/was solved

When VSC is opened (from UI) it uses the global scarb because of the context it has been opened in. This behavior should be changed because when we open project with overriden scarb i.e. in .tool-versions - it should be used instead.

Mechanism of determining the version should be universal and not work only with .tool-versions but with other solutions as well (TBD different ones that could potentially be used)

Problems with this solution

  • There is going to be a conflict when 2 dependent packages are going to be opened from within 1 vscode workspace (we cannot determine which diagnostics we should display)

Arcticae avatar Aug 19 '24 10:08 Arcticae