From 603d2097a9b2250fb0c9de8fcc800050f45796e5 Mon Sep 17 00:00:00 2001 From: Miles Ziemer Date: Wed, 12 Jun 2024 15:02:18 -0400 Subject: [PATCH] check if its a linesep issue --- src/test/java/software/amazon/smithy/lsp/TestWorkspace.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/test/java/software/amazon/smithy/lsp/TestWorkspace.java b/src/test/java/software/amazon/smithy/lsp/TestWorkspace.java index 4ce11c70..90090834 100644 --- a/src/test/java/software/amazon/smithy/lsp/TestWorkspace.java +++ b/src/test/java/software/amazon/smithy/lsp/TestWorkspace.java @@ -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); } @@ -172,7 +173,8 @@ protected void writeModels(Path toDir) { private static void writeModels(Path toDir, Map models) throws Exception { for (Map.Entry 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)); } } }