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 val context = ctx.executionService.getContext
context.renameProject( context.renameProject(
request.namespace, request.namespace,
request.oldName, oldConfig.moduleName,
request.newName newConfig.moduleName
) )
ctx.contextManager.getAllContexts.values.foreach { stack => ctx.contextManager.getAllContexts.values.foreach { stack =>
updateMethodPointers(request.newName, stack) updateMethodPointers(newConfig.moduleName, stack)
clearCache(stack) clearCache(stack)
} }

View File

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