Skip to content

Commit

Permalink
check if its a linesep issue
Browse files Browse the repository at this point in the history
  • Loading branch information
milesziemer committed Jun 12, 2024
1 parent febbf49 commit 603d209
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/test/java/software/amazon/smithy/lsp/TestWorkspace.java
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ public String getUri(String filename) {
*/
public void addModel(String relativePath, String model) {
try {
Files.write(root.resolve(relativePath), model.getBytes(StandardCharsets.UTF_8));
Files.write(root.resolve(relativePath), model.replace("\n", System.lineSeparator())
.getBytes(StandardCharsets.UTF_8));
} catch (IOException e) {
throw new RuntimeException(e);
}
Expand Down Expand Up @@ -172,7 +173,8 @@ protected void writeModels(Path toDir) {

private static void writeModels(Path toDir, Map<String, String> models) throws Exception {
for (Map.Entry<String, String> entry : models.entrySet()) {
Files.write(toDir.resolve(entry.getKey()), entry.getValue().getBytes(StandardCharsets.UTF_8));
Files.write(toDir.resolve(entry.getKey()),
entry.getValue().replace("\n", System.lineSeparator()).getBytes(StandardCharsets.UTF_8));
}
}
}
Expand Down

0 comments on commit 603d209

Please sign in to comment.