From 05284c1c1a7acdec59953567b787b69381cea9d8 Mon Sep 17 00:00:00 2001 From: Toine Hartman Date: Mon, 9 Dec 2024 13:55:08 +0100 Subject: [PATCH] Fix small review suggestions. --- .../vscode/lsp/rascal/RascalWorkspaceService.java | 2 -- .../src/main/rascal/lang/rascal/lsp/refactor/Util.rsc | 7 ++----- 2 files changed, 2 insertions(+), 7 deletions(-) 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 ed91e986..ca8caa23 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 @@ -52,7 +52,6 @@ import org.rascalmpl.vscode.lsp.IBaseTextDocumentService; import org.rascalmpl.vscode.lsp.rascal.model.FileFacts; import org.rascalmpl.vscode.lsp.util.DocumentChanges; -import org.rascalmpl.vscode.lsp.util.locations.ColumnMaps; import org.rascalmpl.vscode.lsp.util.locations.Locations; import io.usethesource.vallang.ISourceLocation; @@ -68,7 +67,6 @@ public class RascalWorkspaceService extends BaseWorkspaceService { RascalWorkspaceService(ExecutorService exec, IBaseTextDocumentService documentService) { super(exec, documentService); this.docService = documentService; - new ColumnMaps(docService::getContents); } @Override diff --git a/rascal-lsp/src/main/rascal/lang/rascal/lsp/refactor/Util.rsc b/rascal-lsp/src/main/rascal/lang/rascal/lsp/refactor/Util.rsc index ec592ed1..9865b89d 100644 --- a/rascal-lsp/src/main/rascal/lang/rascal/lsp/refactor/Util.rsc +++ b/rascal-lsp/src/main/rascal/lang/rascal/lsp/refactor/Util.rsc @@ -131,8 +131,5 @@ bool(&T, &T) desc(bool(&T, &T) f) { }; } -set[&T] flatMap(set[&S] ss, set[&T](&S) f) = - {*ts | &S s <- ss, set[&T] ts := f(s)}; - -list[&T] flatMap(list[&S] ss, list[&T](&S) f) = - [*ts | &S s <- ss, list[&T] ts := f(s)]; +set[&T] flatMap(set[&S] ss, set[&T](&S) f) = ({} | it + f(s) | s <- ss); +list[&T] flatMap(list[&S] ss, list[&T](&S) f) = ([] | it + f(s) | s <- ss);