Skip to content

fix builtin ambiguous classpath for rascal-lsp #2612

Description

@jurgenvinju

This practically always leads to two rascal-lsp jars on the classpath. This is problematic when developing Java code, or when maintaining the rascal-lsp itself. Say you rename a class, then the old class will always still be on the path. All kinds of tricky things can happen that can be avoided by not including the rascal-lsp jar if it is already there by configuration.

See PathConfig.java:

 // We add rascal-lsp to the PathConfig if it is present on the classpath
        // This version of rascal-lsp is added last, so an explicit rascal-lsp dependency takes precedence
        try {
            var lsp = PathConfig.resolveProjectOnClasspath("rascal-lsp");
            if (mode == RascalConfigMode.INTERPRETER) {
                srcs.append(URIUtil.getChildLocation(JarURIResolver.jarify(lsp), "library"));
            }
            // the interpreter must load the Java parts for calling util::IDEServices and registerLanguage
            addLibraryToLibPath(libs, mode, lsp);
        }
        catch (IOException e) {
            // This is expected when rascal-lsp is not on the classpath
        }

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions