From 7eb6658927a91f3ff6acd04f25cfe47f1aa1d143 Mon Sep 17 00:00:00 2001 From: Denys Almazov Date: Fri, 21 Jun 2024 11:33:22 +0300 Subject: [PATCH 1/3] feat: change the default debug config name --- .../plugin.xml | 2 +- .../idf/ui/wizard/NewIDFProjectWizard.java | 14 +++++++++----- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/bundles/com.espressif.idf.debug.gdbjtag.openocd/plugin.xml b/bundles/com.espressif.idf.debug.gdbjtag.openocd/plugin.xml index a5e0e0e3f..af950d2be 100644 --- a/bundles/com.espressif.idf.debug.gdbjtag.openocd/plugin.xml +++ b/bundles/com.espressif.idf.debug.gdbjtag.openocd/plugin.xml @@ -39,7 +39,7 @@ diff --git a/bundles/com.espressif.idf.ui/src/com/espressif/idf/ui/wizard/NewIDFProjectWizard.java b/bundles/com.espressif.idf.ui/src/com/espressif/idf/ui/wizard/NewIDFProjectWizard.java index 9c336526d..fd7be448e 100644 --- a/bundles/com.espressif.idf.ui/src/com/espressif/idf/ui/wizard/NewIDFProjectWizard.java +++ b/bundles/com.espressif.idf.ui/src/com/espressif/idf/ui/wizard/NewIDFProjectWizard.java @@ -141,11 +141,14 @@ public boolean performFinish() return performFinish; } - private void updateClangdFile(IProject project) + private void updateClangdFile(IProject project) { - try { + try + { new ClangdConfigFileHandler().update(project); - } catch (Exception e) { + } + catch (Exception e) + { Logger.log(e); } } @@ -165,12 +168,13 @@ private void createDefaultDebugConfig() PageChangingEvent pageChangingEvent = new PageChangingEvent(wizard, wizard.getStartingPage(), editPage); editPage.handlePageChanging(pageChangingEvent); - wizard.performFinish(); try { - wizard.getWorkingCopy().doSave(); + String originalName = wizard.getWorkingCopy().getName(); + String debugConfigName = originalName.substring(0, originalName.lastIndexOf("Configuration")) + " Debug"; //$NON-NLS-1$ //$NON-NLS-2$ + wizard.getWorkingCopy().copy(debugConfigName).doSave(); } catch (CoreException e) { From b60abeba4c3d351d2c2a784e341f28aae477a8c4 Mon Sep 17 00:00:00 2001 From: Denys Almazov Date: Tue, 2 Jul 2024 11:48:58 +0300 Subject: [PATCH 2/3] fix: changed the debug icon --- bundles/com.espressif.idf.debug.gdbjtag.openocd/plugin.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bundles/com.espressif.idf.debug.gdbjtag.openocd/plugin.xml b/bundles/com.espressif.idf.debug.gdbjtag.openocd/plugin.xml index af950d2be..c44aa77a0 100644 --- a/bundles/com.espressif.idf.debug.gdbjtag.openocd/plugin.xml +++ b/bundles/com.espressif.idf.debug.gdbjtag.openocd/plugin.xml @@ -39,7 +39,7 @@ From ce1acd7ae9061d49690f734b589d0db4403ef5c6 Mon Sep 17 00:00:00 2001 From: Denys Almazov Date: Fri, 5 Jul 2024 09:53:57 +0300 Subject: [PATCH 3/3] fix: removing additional space --- .../src/com/espressif/idf/ui/wizard/NewIDFProjectWizard.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/bundles/com.espressif.idf.ui/src/com/espressif/idf/ui/wizard/NewIDFProjectWizard.java b/bundles/com.espressif.idf.ui/src/com/espressif/idf/ui/wizard/NewIDFProjectWizard.java index fd7be448e..0dc5f0769 100644 --- a/bundles/com.espressif.idf.ui/src/com/espressif/idf/ui/wizard/NewIDFProjectWizard.java +++ b/bundles/com.espressif.idf.ui/src/com/espressif/idf/ui/wizard/NewIDFProjectWizard.java @@ -173,7 +173,9 @@ private void createDefaultDebugConfig() try { String originalName = wizard.getWorkingCopy().getName(); - String debugConfigName = originalName.substring(0, originalName.lastIndexOf("Configuration")) + " Debug"; //$NON-NLS-1$ //$NON-NLS-2$ + int configPartIndex = originalName.lastIndexOf("Configuration"); //$NON-NLS-1$ + String debugConfigName = configPartIndex != -1 ? originalName.substring(0, configPartIndex) + "Debug" //$NON-NLS-1$ + : originalName; wizard.getWorkingCopy().copy(debugConfigName).doSave(); } catch (CoreException e)