Skip to content

Commit

Permalink
oops
Browse files Browse the repository at this point in the history
  • Loading branch information
CoolMineman committed Oct 12, 2021
1 parent c2691ff commit aec5ee9
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public void updateProject(Path projectDir, IdeProject ideProject) {
updateSettingsJson(settingsJsonFile, projectDir, ideProject);
if (!ideProject.runConfigs.isEmpty()) {
Path launchJsonFile = vscodeDir.resolve("launch.json");
updateLaunchJson(launchJsonFile, ideProject);
updateLaunchJson(launchJsonFile, ideProject, projectDir);
}
} catch (Exception e) {
throw Util.sneak(e);
Expand All @@ -56,7 +56,7 @@ void updateSettingsJson(Path settingsJsonFile, Path projectDir, IdeProject idePr
if (settingsJson == null || !settingsJson.isJsonObject()) {
settingsJson = new JsonObject();
}
settingsJson.addProperty("java.project.outputPath", projectDir.resolve(".brachyura").resolve("vscodeout").toString());
settingsJson.addProperty("java.project.outputPath", "./brachyura/vscodeout");
JsonArray sourcePaths = new JsonArray();
settingsJson.add("java.project.sourcePaths", sourcePaths);
for (Path path : ideProject.sourcePaths) {
Expand Down Expand Up @@ -86,7 +86,7 @@ void updateSettingsJson(Path settingsJsonFile, Path projectDir, IdeProject idePr
}
}

void updateLaunchJson(Path launchJsonFile, IdeProject ideProject) throws IOException {
void updateLaunchJson(Path launchJsonFile, IdeProject ideProject, Path projectDir) throws IOException {
try (AtomicFile atomicFile = new AtomicFile(launchJsonFile)) {
try (JsonWriter jsonWriter = new JsonWriter(PathUtil.newBufferedWriter(atomicFile.tempPath))) {
jsonWriter.setIndent(" ");
Expand Down Expand Up @@ -117,7 +117,7 @@ void updateLaunchJson(Path launchJsonFile, IdeProject ideProject) throws IOExcep
jsonWriter.name("stopOnEntry").value(false);
jsonWriter.name("classPaths");
jsonWriter.beginArray();
jsonWriter.value(".brachyura/vscodeout");
jsonWriter.value(projectDir.resolve(".brachyura").resolve("vscodeout").toString());
for (Path path : ideProject.resourcePaths) {
jsonWriter.value(path.toString());
}
Expand Down

0 comments on commit aec5ee9

Please sign in to comment.