Bug 309657 - Spaces are removed as fields are replaced with values
Summary: Spaces are removed as fields are replaced with values
Status: RESOLVED WORKSFORME
Alias: None
Product: kdevplatform
Classification: Developer tools
Component: snippet (other bugs)
Version First Reported In: 1.4.1
Platform: unspecified Linux
: NOR normal
Target Milestone: 1.3.0
Assignee: kdevelop-bugs-null
URL:
Keywords: investigated, triaged
Depends on:
Blocks:
 
Reported: 2012-11-06 15:24 UTC by svanur
Modified: 2018-09-19 14:23 UTC (History)
0 users

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 svanur 2012-11-06 15:24:45 UTC
If I create a snippet for header files like this:
/**
 * @brief ${clsname} is a class that...
 * @namespace ${nsname}
namespace ${nsname}
{
    class ${clsname}
    {
        ${clsname}();
    };
} // namespace ${nsname}

All spaces will disappear in front of the placeholders and I wind up with code looking like this (substituting ${clsname} with MyClass and ${nsname} with mynamespace - leaving the class name and namespace name clamped to the keywords:

/**
 * @brief MyClass is a class that ...
 * @namespace mynamespace
 */
namespacemynamespace
{
    classMyClass
    {
        MyClass();
    };
} // namespacemynamespace


Reproducible: Always

Steps to Reproduce:
1. Create the following snippet:
/**
 * @brief ${clsname} is a class that...
 * @namespace ${nsname}
namespace ${nsname}
{
    class ${clsname}
    {
        ${clsname}();
    };
} // namespace ${nsname}
2. Invoke it and substitute ${clsname} with MyClass and ${nsname} with mynamespace 
3. You get  this:
/**
 * @brief MyClass is a class that ...
 * @namespace mynamespace
 */
namespacemynamespace
{
    classMyClass
    {
        MyClass();
    };
} // namespacemynamespace
Actual Results:  
/**
 * @brief MyClass is a class that ...
 * @namespace mynamespace
 */
namespacemynamespace
{
    classMyClass
    {
        MyClass();
    };
} // namespacemynamespace

Expected Results:  
/**
 * @brief MyClass is a class that ...
 * @namespace mynamespace
 */
namespace mynamespace
{
    class MyClass
    {
        MyClass();
    };
} // namespace mynamespace
Comment 1 Milian Wolff 2012-11-11 13:33:21 UTC
That works just fine for me, could you try with up2date kate and see whether you can reproduce it there? Also, your example is broken, no? You miss to close the doxygen comment.
Comment 2 svanur 2012-11-11 13:46:33 UTC
I'll try with an up2date kate and let you know - sorry about the non-closing doxygen comment, it was a typo in the bug description.  By the way - I'm working on Fedora 18
Comment 3 Andrew Crouthamel 2018-09-19 14:23:56 UTC
This bug has had its resolution changed, but accidentally has been left in NEEDSINFO status. I am thus closing this bug and setting the status as RESOLVED to reflect the resolution change.