|
54 | 54 | import org.eclipse.lsp4j.Unregistration; |
55 | 55 | import org.eclipse.lsp4j.UnregistrationParams; |
56 | 56 | import org.eclipse.lsp4j.jsonrpc.ResponseErrorException; |
| 57 | +import org.eclipse.lsp4j.jsonrpc.messages.Either; |
57 | 58 | import org.eclipse.lsp4j.services.LanguageClient; |
58 | 59 | import org.rascalmpl.vscode.lsp.util.concurrent.CompletableFutureUtils; |
59 | 60 |
|
@@ -313,21 +314,15 @@ private void setDocumentSelector(TextDocumentRegistrationOptions opts, Collectio |
313 | 314 | var filters = params.stream() |
314 | 315 | .flatMap(c -> c.fileExtensions().stream()) |
315 | 316 | .distinct() |
316 | | - .map(ext -> { |
317 | | - var filter = new DocumentFilter(); |
318 | | - filter.setPattern(String.format("**/*.%s", ext)); |
319 | | - return filter; |
320 | | - }).collect(Collectors.toList()); |
| 317 | + .map(ext -> new DocumentFilter(null, null, Either.forLeft(String.format("**/*.%s", ext)))) |
| 318 | + .collect(Collectors.toList()); |
321 | 319 |
|
322 | 320 | // scheme filters |
323 | 321 | filters.addAll(params.stream() |
324 | 322 | .flatMap(c -> c.extensionLessSchemes().stream()) |
325 | 323 | .distinct() |
326 | | - .map(scheme -> { |
327 | | - var filter = new DocumentFilter(); |
328 | | - filter.setScheme(scheme); |
329 | | - return filter; |
330 | | - }).collect(Collectors.toList())); |
| 324 | + .map(scheme -> new DocumentFilter(null, scheme, null)) |
| 325 | + .collect(Collectors.toList())); |
331 | 326 |
|
332 | 327 | opts.setDocumentSelector(filters); |
333 | 328 | } |
|
0 commit comments