-
Notifications
You must be signed in to change notification settings - Fork 122
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
IEP-1204 Change the default name for the debug configuration #1000
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -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) | ||||||||||||||||||||||||||||||||||||||
{ | ||||||||||||||||||||||||||||||||||||||
Comment on lines
+144
to
+151
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Refine exception handling in Currently, the method catches a generic - catch (Exception e)
+ catch (IOException | CoreException e) Committable suggestion
Suggested change
|
||||||||||||||||||||||||||||||||||||||
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$ | ||||||||||||||||||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We can remove the space before the " Debug" here as this will add the double space considering originalName.substring(0, originalName.lastIndexOf("Configuration")) will still return the project name ends with space after removing "Configuration" from the originalName |
||||||||||||||||||||||||||||||||||||||
wizard.getWorkingCopy().copy(debugConfigName).doSave(); | ||||||||||||||||||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Improve reliability of debug configuration name creation. The method assumes the presence of the substring "Configuration" in the original name. This could lead to errors if "Configuration" is not part of the original name. Adding a check before performing the substring operation would enhance the robustness of this method. - String debugConfigName = originalName.substring(0, originalName.lastIndexOf("Configuration")) + " Debug";
+ if (originalName.contains("Configuration")) {
+ String debugConfigName = originalName.substring(0, originalName.lastIndexOf("Configuration")) + " Debug";
+ wizard.getWorkingCopy().copy(debugConfigName).doSave();
+ } else {
+ Logger.log("Expected substring 'Configuration' not found in: " + originalName);
+ } Committable suggestion
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. After rename, you might need to refresh the project to avoid sync issues with file system project state. Here is the case:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. do not see this issue during test. |
||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||
catch (CoreException e) | ||||||||||||||||||||||||||||||||||||||
{ | ||||||||||||||||||||||||||||||||||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tip
Codebase Verification
Icon file does not exist
The icon file
debug_persp.png
specified in the path"platform:/plugin/org.eclipse.debug.ui/icons/full/eview16/debug_persp.png"
does not exist in the repository. Please verify the path or ensure that the file is added to the repository.bundles/com.espressif.idf.debug.gdbjtag.openocd/plugin.xml
Analysis chain
Verify the visibility of the new icon.
The icon path has been updated to
"platform:/plugin/org.eclipse.debug.ui/icons/full/eview16/debug_persp.png"
. However, there is a user comment indicating that the icon is not visible. Please verify the visibility of the new icon and ensure the path is correct.Scripts executed
The following scripts were executed for the analysis:
Script:
Length of output: 231
Script:
Length of output: 171
Script:
Length of output: 20