Bug 383930 - "Move into source" put definition into commented block if in cpp file is missing empty new line at end
Summary: "Move into source" put definition into commented block if in cpp file is miss...
Status: RESOLVED WORKSFORME
Alias: None
Product: kdevelop
Classification: Applications
Component: general (other bugs)
Version First Reported In: 5.3.0
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: kdevelop-bugs-null
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-08-23 21:44 UTC by Piotr Mierzwinski
Modified: 2023-01-02 05:28 UTC (History)
1 user (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Piotr Mierzwinski 2017-08-23 21:44:32 UTC
At end of some cpp file (let it be myfoo.cpp) I have commented block (in the past I commented some old function) without empty new line at end of file.
In header file I have some function with inline definition, so for example
int myFun() { return 5; }
I wanted move it into cpp file, so I put cursor inside curly brackets and invoked Ctrl+Alt+S - "Move into source". After I was switching to cpp code I noticed that definition of mentioned function has been put at end of commented block, so function remained commented.
When I put new line at end of file all

Expected result:
Even if at end of cpp file there is commented block and missing empty end of line then  definition of function should not be put inside commented block only outside this block. Should be added empty new line and there put definition.
Comment 1 Piotr Mierzwinski 2017-08-23 21:48:02 UTC
replace: ("missing empty end of line" / "missing empty new line")
replace: ("When I put new line at end of file all" /
          "When I put new line at end of cpp file all works fine."
Comment 2 Piotr Mierzwinski 2018-11-15 21:34:44 UTC
In last version of KDevelop (5.3.0) I noticed that before inserted empty definition is put single closing curly bracket. It looks like this:

}


void myclass:myfoo( int param ) {}


I don't know if this does matter, but body of function before (last in moment of insertion) looks like:

void myclass::lastfoo( int param )
{
     int a;
     if (something) {
            if (anotherthing)
                  do_something1();
     }
     else {
            if (yetanotherthing)
                  do_something2();
     }
}
Comment 3 Piotr Mierzwinski 2018-11-15 21:43:38 UTC
Just update.
Last issue I observed in file where at its end were present 2 new line characters
Comment 4 Justin Zobel 2022-12-03 09:01:42 UTC
Thank you for reporting this issue in KDE software. As it has been a while since this issue was reported, can we please ask you to see if you can reproduce the issue with a recent software version?

If you can reproduce the issue, please change the status to "REPORTED" when replying. Thank you!
Comment 5 Bug Janitor Service 2022-12-18 05:14:56 UTC
Dear Bug Submitter,

This bug has been in NEEDSINFO status with no change for at least
15 days. Please provide the requested information as soon as
possible and set the bug status as REPORTED. Due to regular bug
tracker maintenance, if the bug is still in NEEDSINFO status with
no change in 30 days the bug will be closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

If you have already provided the requested information, please
mark the bug as REPORTED so that the KDE team knows that the bug is
ready to be confirmed.

Thank you for helping us make KDE software even better for everyone!
Comment 6 Bug Janitor Service 2023-01-02 05:28:56 UTC
This bug has been in NEEDSINFO status with no change for at least
30 days. The bug is now closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

Thank you for helping us make KDE software even better for everyone!