| Summary: | Renaming a variable declared in for loop does not cover all instances | ||
|---|---|---|---|
| Product: | [Applications] kdevelop | Reporter: | Alexander Shaduri <ashaduri> |
| Component: | Language Support: CPP (old) | Assignee: | kdevelop-bugs-null |
| Status: | RESOLVED FIXED | ||
| Severity: | normal | CC: | hcc, sumeettulsani1 |
| Priority: | NOR | ||
| Version First Reported In: | git master | ||
| Target Milestone: | --- | ||
| Platform: | openSUSE | ||
| OS: | Linux | ||
| Latest Commit: | Version Fixed/Implemented In: | 5.0.0 | |
| Sentry Crash Report: | |||
| Attachments: |
Example code showing the bahaviour.
The bug has been resolved The bug has been Resolved |
||
Created attachment 77615 [details]
Example code showing the bahaviour.
Comment on attachment 77615 [details]
Example code showing the bahaviour.
When renaming the i, j, or k variables at their respective declarations, the auto-renaming behavior is flawed for single line {} scopes: auto renaming doe not work for i and j, but it does work for k.
A potentially related issue:
when the names for i,j, or k are altered where they are used, the behavior is also different:
renaming i<10; to i2<10; results in a prompt to declare int i2
renaming i++ to i2++ does not result in any prompt whatsoever
Created attachment 98505 [details]
The bug has been resolved
This screenshot suggests the use of Rename Declaration in KDevelop editor.
Created attachment 98506 [details]
The bug has been Resolved
This screenshot shows the screen after the use of Rename button, showing that the bug has been already resolved.
|
Hello, I'm using KDevelop git master (2012-12-21). Consider the following code: for (int a = 0; a < 5; ++a) { int x = a; } now rename "a" by e.g. typing "b" after "a" and clicking 'Rename "a" to "ab"' in the popup. Here's the result: for (int ab = 0; a < 5; ++a) { int x = ab; } As you can see, "a" has been renamed in the body of the for loop, but not on the first line. Note that this does _not_ happen when using "Code -> Rename Declaration", every instance is renamed then. Thanks Reproducible: Always Steps to Reproduce: 1. Try the example above. Actual Results: The variable is not renamed in some places. Expected Results: The variable should always be renamed.