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

Which versions of projects are loaded in the REPL? #537

Open
2 tasks
sungshik opened this issue Dec 4, 2024 · 0 comments
Open
2 tasks

Which versions of projects are loaded in the REPL? #537

sungshik opened this issue Dec 4, 2024 · 0 comments

Comments

@sungshik
Copy link
Contributor

sungshik commented Dec 4, 2024

Scope (branches)

Problem

Situation

Suppose a REPL is created in project p (i.e., p is open in the workspace). The question is which version of p, and which version of any other project q, is loaded in the REPL for p. There are several options:

  • Regarding the version of p:
    • If p ∉ {rascal, rascal-lsp}, then there is one option: the version of p in the workspace.
    • If p ∈ {rascal, rascal-lsp}, then there's a second option: the version of p in the VS Code extension.
  • Regarding the version of q:
    • If q ∉ {rascal, rascal-lsp}, then there are three options:
      • no version of q;
      • the version of q in the workspace;
      • a version of q in the local Maven repository, when q is a dependency of p (declared in the POM of p).
    • If q ∈ {rascal, rascal-lsp}, then there's a fourth option: the version of q in the VS Code extension.

Expectation

  • The version of p in the workspace is loaded in the REPL.
  • The version of q is/isn't loaded in the REPL according to this table:
    q is a dependency of p q is open in the workspace
    ☑️ ☑️ the version of q in the workspace
    ☑️ 🟪 a version of q in the local Maven repository
    🟪 ☑️ no version of q
    🟪 🟪 no version of q
    • † Exceptions: if q ∈ {rascal, rascal-lsp}, then
      • If q = rascal, then the version in the workspace is loaded.
      • If q = rascal-lsp, then the version in the VS Code extension is loaded.
    • ‡ Exceptions:
      • If q = rascal, then the version in the VS Code extension is loaded.
      • If q = rascal-lsp, then the version in the VS Code extension is loaded.

These expectations are based on the following underlying assumptions:

  • If multiple projects are open in the workspace, then it matters in which project a REPL is created.
  • If a project is open in the workspace, then it's impossible to load a different version of that project, because:
    • If a project is open, then it's under active development.
    • If a project is under active development, then the developer should observe the latest changes in the REPL.
    • (If a version in the local Maven repository should be loaded, then the project can be closed and/or (re)opened in another workspace.)
  • Some versions of rascal and rascal-lsp are always loaded.

Actual

Currently (= in the branches listed above), there are several anomalous cases in which the actual version isn't the expected version. See the following issues for details:

Tasks

  • Fix the anomalous cases
  • Document which version a user should expect in which situation

Related work

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant