Skip to content

Commit 02b50de

Browse files
committed
fix: revert exception in documentSymbol for non-file methods
As this causes unnecessary errors for projects using the mock server with non-file sources.
1 parent 90347ed commit 02b50de

2 files changed

Lines changed: 2 additions & 6 deletions

File tree

org.eclipse.lsp4e.tests.mock/META-INF/MANIFEST.MF

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
22
Bundle-ManifestVersion: 2
33
Bundle-Name: Mock Language Server to test LSP4E
44
Bundle-SymbolicName: org.eclipse.lsp4e.tests.mock
5-
Bundle-Version: 0.17.0.qualifier
5+
Bundle-Version: 0.17.1.qualifier
66
Bundle-Vendor: Eclipse LSP4E
77
Bundle-RequiredExecutionEnvironment: JavaSE-21
88
Require-Bundle: org.eclipse.lsp4j,

org.eclipse.lsp4e.tests.mock/src/org/eclipse/lsp4e/tests/mock/MockTextDocumentService.java

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,13 @@
2828
import java.util.function.Function;
2929
import java.util.stream.Collectors;
3030

31-
import org.eclipse.lsp4j.CodeAction;
3231
import org.eclipse.lsp4j.CallHierarchyIncomingCall;
3332
import org.eclipse.lsp4j.CallHierarchyIncomingCallsParams;
3433
import org.eclipse.lsp4j.CallHierarchyItem;
3534
import org.eclipse.lsp4j.CallHierarchyOutgoingCall;
3635
import org.eclipse.lsp4j.CallHierarchyOutgoingCallsParams;
3736
import org.eclipse.lsp4j.CallHierarchyPrepareParams;
37+
import org.eclipse.lsp4j.CodeAction;
3838
import org.eclipse.lsp4j.CodeActionParams;
3939
import org.eclipse.lsp4j.CodeLens;
4040
import org.eclipse.lsp4j.CodeLensParams;
@@ -190,10 +190,6 @@ public CompletableFuture<LinkedEditingRanges> linkedEditingRange(LinkedEditingRa
190190
@Override
191191
public CompletableFuture<List<Either<SymbolInformation, DocumentSymbol>>> documentSymbol(
192192
DocumentSymbolParams params) {
193-
String documentURI = params.getTextDocument().getUri();
194-
if (!documentURI.startsWith("file:///")) {
195-
throw new IllegalArgumentException("invalid uri: " + documentURI);
196-
}
197193
return CompletableFuture.completedFuture(documentSymbols.stream().map(symbol -> {
198194
Either<SymbolInformation, DocumentSymbol> res = Either.forRight(symbol);
199195
return res;

0 commit comments

Comments
 (0)