Skip to content

Commit

Permalink
update uri for windows
Browse files Browse the repository at this point in the history
Signed-off-by: Emily McMullan <[email protected]>
  • Loading branch information
eemcmullan committed Dec 9, 2024
1 parent d6ca37c commit 3d99be0
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 3d99be0

Please sign in to comment.