4141import java .util .concurrent .ExecutionException ;
4242import java .util .concurrent .Executor ;
4343import java .util .concurrent .ExecutorService ;
44- import java .util .function .Function ;
4544import java .util .stream .Collectors ;
4645
4746import org .apache .logging .log4j .LogManager ;
@@ -231,11 +230,10 @@ public InterruptibleFuture<IList> getDocumentSymbols(IConstructor module) {
231230 }
232231
233232
234- public InterruptibleFuture <ITuple > getRename (ISourceLocation cursorLoc , IList focus , Set <ISourceLocation > workspaceFolders , Function < ISourceLocation , PathConfig > getPathConfig , String newName ) {
233+ public InterruptibleFuture <ITuple > getRename (ISourceLocation cursorLoc , IList focus , Set <ISourceLocation > workspaceFolders , String newName ) {
235234 return runEvaluator ("Rascal rename" , semanticEvaluator , eval -> {
236235 try {
237- IFunction rascalGetPathConfig = eval .getFunctionValueFactory ().function (getPathConfigType , (t , u ) -> getPathConfig .apply ((ISourceLocation ) t [0 ]).asConstructor ());
238- return (ITuple ) eval .call ("rascalRenameSymbol" , cursorLoc , focus , VF .string (newName ), workspaceFolders .stream ().collect (VF .setWriter ()), rascalGetPathConfig );
236+ return (ITuple ) eval .call ("rascalRenameSymbol" , cursorLoc , focus , VF .string (newName ), workspaceFolders .stream ().collect (VF .setWriter ()), makePathConfigGetter (eval ));
239237 } catch (Throw e ) {
240238 if (e .getException () instanceof IConstructor ) {
241239 var exception = (IConstructor )e .getException ();
@@ -265,7 +263,7 @@ private ISourceLocation sourceLocationFromUri(String uri) {
265263 }
266264 }
267265
268- public CompletableFuture <ITuple > getModuleRenames (List <FileRename > fileRenames , Set <ISourceLocation > workspaceFolders , Function < ISourceLocation , PathConfig > getPathConfig ) {
266+ public CompletableFuture <ITuple > getModuleRenames (List <FileRename > fileRenames , Set <ISourceLocation > workspaceFolders ) {
269267 var emptyResult = VF .tuple (VF .list (), VF .map ());
270268 if (fileRenames .isEmpty ()) {
271269 return CompletableFuture .completedFuture (emptyResult );
@@ -277,9 +275,8 @@ public CompletableFuture<ITuple> getModuleRenames(List<FileRename> fileRenames,
277275 , exec )
278276 .thenCompose (renames ->
279277 runEvaluator ("Rascal module rename" , semanticEvaluator , eval -> {
280- IFunction rascalGetPathConfig = eval .getFunctionValueFactory ().function (getPathConfigType , (t , u ) -> getPathConfig .apply ((ISourceLocation ) t [0 ]).asConstructor ());
281278 try {
282- return (ITuple ) eval .call ("rascalRenameModule" , renames , workspaceFolders .stream ().collect (VF .setWriter ()), rascalGetPathConfig );
279+ return (ITuple ) eval .call ("rascalRenameModule" , renames , workspaceFolders .stream ().collect (VF .setWriter ()), makePathConfigGetter ( eval ) );
283280 } catch (Throw e ) {
284281 throw new RuntimeException (e .getMessage ());
285282 }
0 commit comments