diff --git a/rascal-lsp/src/main/java/org/rascalmpl/vscode/lsp/rascal/RascalTextDocumentService.java b/rascal-lsp/src/main/java/org/rascalmpl/vscode/lsp/rascal/RascalTextDocumentService.java index d161daf9..69c2b660 100644 --- a/rascal-lsp/src/main/java/org/rascalmpl/vscode/lsp/rascal/RascalTextDocumentService.java +++ b/rascal-lsp/src/main/java/org/rascalmpl/vscode/lsp/rascal/RascalTextDocumentService.java @@ -302,7 +302,9 @@ private ITree getCursorFromPosition(ISourceLocation file, ITree moduleTree, Posi // Find all trees containing the cursor, in ascending order of size IList focusList = TreeSearch.computeFocusList(moduleTree, rascalCursorPos.getLine(), rascalCursorPos.getCharacter()); List sortNames = focusList.stream() - .map(tree -> ProductionAdapter.getSortName(TreeAdapter.getProduction((ITree) tree))) + .map(ITree.class::cast) + .map(TreeAdapter::getProduction) + .map(ProductionAdapter::getSortName) .collect(Collectors.toList()); int qNameIdx = sortNames.indexOf("QualifiedName"); diff --git a/rascal-lsp/src/main/java/org/rascalmpl/vscode/lsp/rascal/RascalWorkspaceService.java b/rascal-lsp/src/main/java/org/rascalmpl/vscode/lsp/rascal/RascalWorkspaceService.java index 84dae0f0..85b53887 100644 --- a/rascal-lsp/src/main/java/org/rascalmpl/vscode/lsp/rascal/RascalWorkspaceService.java +++ b/rascal-lsp/src/main/java/org/rascalmpl/vscode/lsp/rascal/RascalWorkspaceService.java @@ -88,6 +88,6 @@ public void didRenameFiles(RenameFilesParams params) { .map(f -> Locations.toLoc(f.getUri())) .collect(Collectors.toSet()) , getExecuter() - ).thenAccept(folders -> ((RascalTextDocumentService) docService).didRenameFiles(params, folders)); + ).thenAccept(folders -> docService.didRenameFiles(params, folders)); } }