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

setExternalLibertyInstallation flag getting set wrong due to path mismatch #261

Closed
scottkurz opened this issue Jan 3, 2024 · 1 comment · Fixed by #263
Closed

setExternalLibertyInstallation flag getting set wrong due to path mismatch #261

scottkurz opened this issue Jan 3, 2024 · 1 comment · Fixed by #263

Comments

@scottkurz
Copy link
Member

In io.openliberty.tools.langserver.lemminx.util.LibertyUtils.getLibertyRuntimeInfo(LibertyWorkspace) in version 2.1.1 we go through this path:

                    if (!libertyRuntimeInfo.getRuntimeLocation().startsWith(libertyWorkspace.getWorkspaceStringWithTrailingSlash())) {
                        libertyWorkspace.setExternalLibertyInstallation(true);
                    } else {
                        libertyWorkspace.setExternalLibertyInstallation(false);
                    }

In my case, on Windows, the libertyRuntimeInfo.getRuntimeLocation() returns:
C:\guide-getting-started\finish\target\liberty\wlp while the
libertyWorkspace.getWorkspaceStringWithTrailingSlash() returns file:/C:/guide-getting-started/finish/.

So clearly the intent was that the "startsWith" check would be 'true' so we'd go down the 'else' path and do libertyWorkspace.setExternalLibertyInstallation(false);, however the check is failing and so we're setting it to 'true'.

It doesn't seem like we're doing anything with this 'setExternalLibertyInstallation' flag at the moment, just noting in case we do.

@cherylking
Copy link
Member

I think this isExternalLibertyInstallation boolean can be removed. As you said, nothing is using it. Now that we get the installation directory from the liberty-plugin-config.xml file, whether the installation is local or external to the workspace is irrelevant.

@github-project-automation github-project-automation bot moved this from Target fix release to ✅ Done in Liberty Tools Release Plan Jan 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants