Bug 304729 - auto renaming fails when change affects first letter of name
Summary: auto renaming fails when change affects first letter of name
Status: CONFIRMED
Alias: None
Product: kdevelop
Classification: Applications
Component: Code completion (other bugs)
Version First Reported In: 4.5.2
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: kdevelop-bugs-null
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-08-07 14:17 UTC by Bart
Modified: 2021-03-09 22:48 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments
Notice that I changed data_callback to my_data_callback, but suggiestion offers "y_data_callback". (466.11 KB, image/png)
2013-12-07 07:26 UTC, Bart
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Bart 2012-08-07 14:17:52 UTC
I use KDevelop for plain C programming. When I change a function from:
static void
foo_bar (int a)
{
}

to:
static void
foo_baz (int a)
{
}

the auto-rename pops up offering to change all "foo_bar" calls to "foo_baz". 

But if I change it to:
static void
baz_foo_bar (int a)
{
}

It offers me to change it to 'az_foo_bar' (note the missing initial b). No matter what the new "prefix" is, it always omits the first letter of the new name in the suggestion.

Additionally, if I actually delete the first letter of the original function name the auto-rename stops reacting:
I start deleting the 'o' before the underscore in "foo_bar", it offers to replace "foo_bar" for "fo_bar". After deleting the second 'o', it offers "f_bar". If I delete the 'f', it keeps suggesting "f_bar" and stops reacting to any changes (like writing "baz"). If I write something *before* having deleted the 'f', the auto-rename works fine.

Reproducible: Always

Steps to Reproduce:
1. Write a funcion and use it in my code.
2. Rename the funcion affecting the first letter (either deleting it or adding a prefix).

Actual Results:  
3. Auto rename suggest wrong new name or none at all.

Expected Results:  
3. Auto rename suggest new function name as happens when first letter is untouched.
Comment 1 Olivier.jg 2012-10-26 22:27:48 UTC
I cannot reproduce any of these issues. Are these reproducible?
Comment 2 Bart 2012-10-27 02:47:34 UTC
Yes, still happens 100% of the time with v 4.4.0
Comment 3 Bart 2013-12-07 07:26:25 UTC
Created attachment 83964 [details]
Notice that I changed data_callback to my_data_callback, but suggiestion offers "y_data_callback".

Still happens 100% on kdevelop 4.5.2. This a different computer (still Arch Linux). Counting this, it's already 3 different computers where this happens.
Comment 4 Milian Wolff 2013-12-07 13:01:15 UTC
While I don't get the described behavior, it definitely doesn't work as expected for me either - I simply don't get an assistant at all when I prepend something to the function identifier...
Comment 5 Justin Zobel 2021-03-09 22:48:08 UTC
Thank you for the bug report.

As this report hasn't seen any changes in 5 years or more, we ask if you can please confirm that the issue still persists.

If this bug is no longer persisting or relevant please change the status to resolved.