Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support multi-root workspaces and detached files in VSCode extension #6229

Open
Arcticae opened this issue Aug 19, 2024 · 0 comments
Open

Support multi-root workspaces and detached files in VSCode extension #6229

Arcticae opened this issue Aug 19, 2024 · 0 comments
Assignees
Labels
bug Something isn't working ide This issue refers to CairoLS or editor extensions

Comments

@Arcticae
Copy link
Collaborator

Arcticae commented Aug 19, 2024

Basically, fix this TODO:

// TODO(mkaput): Support multi-root workspaces.
const workspaceFolder = vscode.workspace.workspaceFolders?.[0];

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 Arcticae added enhancement New feature or request ide This issue refers to CairoLS or editor extensions labels Aug 19, 2024
@mkaput mkaput added bug Something isn't working and removed enhancement New feature or request labels Aug 19, 2024
@mkaput mkaput changed the title Add support for .tool-versions Support multi-root workspaces and detached files in VSCode extension Aug 19, 2024
@Arcticae Arcticae self-assigned this Aug 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working ide This issue refers to CairoLS or editor extensions
Projects
Status: In Progress
Development

No branches or pull requests

2 participants