Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update main (2024.03) #52

Merged
merged 4 commits into from Mar 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions build.sc
Expand Up @@ -9,9 +9,9 @@ object lsp extends MavenModule with PublishModule {

def ivyDeps = Agg(
ivy"org.eclipse.lsp4j:org.eclipse.lsp4j:0.14.0",
ivy"software.amazon.smithy:smithy-model:1.41.0",
ivy"software.amazon.smithy:smithy-build:1.41.0",
ivy"software.amazon.smithy:smithy-cli:1.41.0",
ivy"software.amazon.smithy:smithy-model:1.45.0",
ivy"software.amazon.smithy:smithy-build:1.45.0",
ivy"software.amazon.smithy:smithy-cli:1.45.0",
ivy"com.disneystreaming.smithy:smithytranslate-formatter-jvm-java-api:0.3.10"
)

Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
@@ -1 +1 @@
smithyVersion=1.43.0
smithyVersion=1.45.0
16 changes: 11 additions & 5 deletions src/test/java/software/amazon/smithy/lsp/SmithyInterfaceTest.java
Expand Up @@ -17,14 +17,14 @@

import static org.junit.Assert.assertTrue;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertEquals;

import java.io.File;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Optional;
import java.util.stream.Collectors;
import org.eclipse.lsp4j.jsonrpc.messages.Either;
import org.junit.Test;
Expand Down Expand Up @@ -105,10 +105,16 @@ public void runValidators() throws Exception {
assertTrue(result.isRight());
List<ValidationEvent> validationEvents = result.getRight().getValidationEvents();
assertFalse(validationEvents.isEmpty());
assertEquals(
"Proto index 1 is used muliple times in members name,age of shape (structure: `some.test#MyStruct`).",
validationEvents.get(0).getMessage()
);

String expectedMessage = "Proto index 1 is used muliple times in members name," +
"age of shape (structure: `some.test#MyStruct`).";
Optional<ValidationEvent> matchingEvent = validationEvents.stream()
.filter(ev ->ev.getMessage().equals(expectedMessage)).findFirst();

if (!matchingEvent.isPresent()) {
throw new AssertionError("Expected validation event with message `" + expectedMessage
+ "`, but events were " + validationEvents);
}
}

private static List<File> getFiles(String... filenames) throws Exception {
Expand Down