From b1c12aa6b56a2d5c934294803eff381ad6c7a788 Mon Sep 17 00:00:00 2001 From: David Feldhoff Date: Fri, 2 Apr 2021 19:01:12 +0200 Subject: [PATCH] Do not delete helper function if the old and new procedure name is the same #101 --- vscode-extension/src/App logic/Services/ObjectService.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/vscode-extension/src/App logic/Services/ObjectService.ts b/vscode-extension/src/App logic/Services/ObjectService.ts index 35bc3af..e9f8c8f 100644 --- a/vscode-extension/src/App logic/Services/ObjectService.ts +++ b/vscode-extension/src/App logic/Services/ObjectService.ts @@ -91,6 +91,9 @@ export class ObjectService { let parameterTypes: string[] = TestMethodUtils.getParameterTypesOfMethod(oldMethodTreeNode, document); let newProcedureName: string = TestMethodUtils.getProcedureName(msg.Type, msg.NewValue); + if (newProcedureName.toLowerCase() == document.getText(rangeOfOldIdentifier).toLowerCase()) + return false; + if (await TestCodeunitUtils.isProcedureAlreadyDeclared(document, newProcedureName, parameterTypes)) return true; let newHistoricalProcedureNames: string[] = TestMethodUtils.getProcedureNameHistory(msg.Type, msg.NewValue)