Skip to content

Commit 3515bca

Browse files
committed
Fix Rewrite quick fix/assist on Win
1 parent 1017555 commit 3515bca

File tree

1 file changed

+1
-1
lines changed
  • headless-services/spring-boot-language-server/src/main/java/org/springframework/ide/vscode/boot/java/rewrite

1 file changed

+1
-1
lines changed

headless-services/spring-boot-language-server/src/main/java/org/springframework/ide/vscode/boot/java/rewrite/RewriteRefactorings.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ public WorkspaceEdit createEdit(JsonElement o) {
113113
private WorkspaceEdit applyRecipe(Recipe r, IJavaProject project, List<J.CompilationUnit> cus) {
114114
List<Result> results = r.run(cus);
115115
List<Either<TextDocumentEdit, ResourceOperation>> edits = results.stream().filter(res -> res.getAfter() != null).map(res -> {
116-
URI docUri = project.getLocationUri().resolve(res.getAfter().getSourcePath().toString());
116+
URI docUri = res.getAfter().getSourcePath().isAbsolute() ? res.getAfter().getSourcePath().toUri() : project.getLocationUri().resolve(res.getAfter().getSourcePath().toString());
117117
TextDocument doc = documents.getLatestSnapshot(docUri.toString());
118118
if (doc == null) {
119119
doc = new TextDocument(docUri.toString(), LanguageId.JAVA, 0, res.getBefore() == null ? "" : res.getBefore().printAll());

0 commit comments

Comments
 (0)