Skip to content

Commit

Permalink
Fix small review suggestions.
Browse files Browse the repository at this point in the history
  • Loading branch information
toinehartman committed Dec 9, 2024
1 parent e4e0956 commit dd91729
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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
Expand Down
7 changes: 2 additions & 5 deletions rascal-lsp/src/main/rascal/lang/rascal/lsp/refactor/Util.rsc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ private tuple[str, loc] qualifiedPrefix(QualifiedName qn) {
if (size(names) <= 1) return <"", |unknown:///|>;

str fullName = "<qn>";
str namePrefix = substring(fullName, 0, findLast(fullName, "::"));
str namePrefix = fullName[..findLast(fullName, "::")];
loc prefixLoc = cover([n.src | Name n <- prefix(names)]);

return <namePrefix, prefixLoc>;
Expand Down

0 comments on commit dd91729

Please sign in to comment.