From 16c3f45a932ac83a4e321599de9b9de9eba0d546 Mon Sep 17 00:00:00 2001 From: Emily McMullan Date: Wed, 11 Dec 2024 15:19:07 -0500 Subject: [PATCH] update uri for windows (#115) Signed-off-by: Emily McMullan --- .../tackle/core/internal/symbol/SymbolProvider.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/java-analyzer-bundle.core/src/main/java/io/konveyor/tackle/core/internal/symbol/SymbolProvider.java b/java-analyzer-bundle.core/src/main/java/io/konveyor/tackle/core/internal/symbol/SymbolProvider.java index bc5b928..8da24ea 100644 --- a/java-analyzer-bundle.core/src/main/java/io/konveyor/tackle/core/internal/symbol/SymbolProvider.java +++ b/java-analyzer-bundle.core/src/main/java/io/konveyor/tackle/core/internal/symbol/SymbolProvider.java @@ -111,7 +111,13 @@ default Location getLocation(IJavaElement element, SearchMatch match) throws Jav } else { query = query + "&source-range=false"; } - uriString = new URI("konveyor-jdt", "contents", cf.getPath().toString(), query, null).toASCIIString(); + String cfPath = cf.getPath().toString(); + String os = System.getProperty("os.name").toLowerCase(); + // windows home path will start with C: so need to add beginning '/'' for uri + if (os.indexOf("win") >= 0){ + cfPath = '/' + cfPath; + } + uriString = new URI("konveyor-jdt", "contents", cfPath, query, null).toASCIIString(); } catch (URISyntaxException e) { JavaLanguageServerPlugin.logException("Error generating URI for class ", e);