From 06e1f1188df371f9abfdab57d0e987ab4b8bc244 Mon Sep 17 00:00:00 2001 From: George Fraser Date: Thu, 3 Jan 2019 01:01:51 -0800 Subject: Goto definitions/references can fail --- src/test/java/org/javacs/FindReferencesTest.java | 2 +- src/test/java/org/javacs/GotoTest.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src/test') diff --git a/src/test/java/org/javacs/FindReferencesTest.java b/src/test/java/org/javacs/FindReferencesTest.java index e728cc9..bbb14cf 100644 --- a/src/test/java/org/javacs/FindReferencesTest.java +++ b/src/test/java/org/javacs/FindReferencesTest.java @@ -21,7 +21,7 @@ public class FindReferencesTest { params.textDocument = new TextDocumentIdentifier(uri); params.position = new Position(row - 1, column - 1); - var locations = server.findReferences(params); + var locations = server.findReferences(params).orElse(List.of()); var strings = new ArrayList(); for (var l : locations) { var fileName = Parser.fileName(l.uri); diff --git a/src/test/java/org/javacs/GotoTest.java b/src/test/java/org/javacs/GotoTest.java index e92565c..564071e 100644 --- a/src/test/java/org/javacs/GotoTest.java +++ b/src/test/java/org/javacs/GotoTest.java @@ -171,7 +171,7 @@ public class GotoTest { p.textDocument = document; p.position = position; - var locations = server.gotoDefinition(p); + var locations = server.gotoDefinition(p).orElse(List.of()); var strings = new ArrayList(); for (var l : locations) { var fileName = Paths.get(l.uri).getFileName(); -- cgit v1.2.3