diff --git a/rascal-lsp/src/main/rascal/lang/rascal/lsp/refactor/Rename.rsc b/rascal-lsp/src/main/rascal/lang/rascal/lsp/refactor/Rename.rsc index 1749fd4e..22752533 100644 --- a/rascal-lsp/src/main/rascal/lang/rascal/lsp/refactor/Rename.rsc +++ b/rascal-lsp/src/main/rascal/lang/rascal/lsp/refactor/Rename.rsc @@ -90,9 +90,10 @@ private set[IllegalRenameReason] rascalCheckLegalName(str name, set[IdRole] role } private void rascalCheckLegalName(str name, Symbol sym) { + escName = rascalEscapeName(name); g = grammar(#start[Module]); - if (!tryParseAs(type(sym, g.rules), name)) { - throw illegalRename("\'\' is not a valid name at this position", {invalidName(name, "")}); + if (!tryParseAs(type(sym, g.rules), escName)) { + throw illegalRename("\'\' is not a valid name at this position", {invalidName(escName, "")}); } }