Fix refactor/renameProject with names containing unsupported characters (#10204)

related #10073

Changelog:
- fix: rename the project to the name containing unsupported characters
This commit is contained in:
Dmitry Bushev 2024-06-07 13:34:01 +01:00 committed by GitHub
parent 7744e8b464
commit 292d33ccc1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 15 additions and 15 deletions

View File

@ -78,12 +78,12 @@ class RenameProjectCmd(
val context = ctx.executionService.getContext
context.renameProject(
request.namespace,
request.oldName,
request.newName
oldConfig.moduleName,
newConfig.moduleName
)
ctx.contextManager.getAllContexts.values.foreach { stack =>
updateMethodPointers(request.newName, stack)
updateMethodPointers(newConfig.moduleName, stack)
clearCache(stack)
}

View File

@ -6230,21 +6230,21 @@ class RuntimeServerTest
context.executionComplete(contextId)
)
// rename Test -> Foo
context.pkg.rename("Foo")
// rename Test -> My Foo
context.pkg.rename("My Foo")
context.send(
Api.Request(requestId, Api.RenameProject("Enso_Test", "Test", "Foo"))
Api.Request(requestId, Api.RenameProject("Enso_Test", "Test", "My Foo"))
)
val renameProjectResponses = context.receiveN(6)
renameProjectResponses should contain allOf (
Api.Response(requestId, Api.ProjectRenamed("Test", "Foo", "Foo")),
Api.Response(requestId, Api.ProjectRenamed("Test", "MyFoo", "My Foo")),
context.Main.Update.mainX(contextId, typeChanged = false),
TestMessages.update(
contextId,
context.Main.idMainY,
ConstantsGen.INTEGER,
Api.MethodCall(
Api.MethodPointer("Enso_Test.Foo.Main", ConstantsGen.NUMBER, "foo")
Api.MethodPointer("Enso_Test.MyFoo.Main", ConstantsGen.NUMBER, "foo")
),
fromCache = false,
typeChanged = true
@ -6299,7 +6299,7 @@ class RuntimeServerTest
context.Main.idMainY,
ConstantsGen.INTEGER,
Api.MethodCall(
Api.MethodPointer("Enso_Test.Foo.Main", ConstantsGen.NUMBER, "foo")
Api.MethodPointer("Enso_Test.MyFoo.Main", ConstantsGen.NUMBER, "foo")
),
fromCache = false,
typeChanged = false
@ -6347,21 +6347,21 @@ class RuntimeServerTest
context.executionComplete(contextId)
)
// rename Test -> Foo
context.pkg.rename("Foo")
// rename Test -> My Foo
context.pkg.rename("My Foo")
context.send(
Api.Request(requestId, Api.RenameProject("Enso_Test", "Test", "Foo"))
Api.Request(requestId, Api.RenameProject("Enso_Test", "Test", "My Foo"))
)
val renameProjectResponses = context.receiveN(6)
renameProjectResponses should contain allOf (
Api.Response(requestId, Api.ProjectRenamed("Test", "Foo", "Foo")),
Api.Response(requestId, Api.ProjectRenamed("Test", "MyFoo", "My Foo")),
context.Main.Update.mainX(contextId, typeChanged = false),
TestMessages.update(
contextId,
context.Main.idMainY,
ConstantsGen.INTEGER,
Api.MethodCall(
Api.MethodPointer("Enso_Test.Foo.Main", ConstantsGen.NUMBER, "foo")
Api.MethodPointer("Enso_Test.MyFoo.Main", ConstantsGen.NUMBER, "foo")
),
fromCache = false,
typeChanged = true
@ -6401,7 +6401,7 @@ class RuntimeServerTest
context.Main.idMainY,
ConstantsGen.INTEGER,
Api.MethodCall(
Api.MethodPointer("Enso_Test.Foo.Main", ConstantsGen.NUMBER, "foo")
Api.MethodPointer("Enso_Test.MyFoo.Main", ConstantsGen.NUMBER, "foo")
),
fromCache = true,
typeChanged = true