Bug 466224 - [Feature request] Implement method should allow choose namespace generation type.
Summary: [Feature request] Implement method should allow choose namespace generation t...
Status: NEW
Alias: None
Product: CDT
Classification: Tools
Component: cdt-refactoring (show other bugs)
Version: Next   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact: Jonah Graham CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-05-03 06:02 EDT by soman namos CLA
Modified: 2020-09-04 15:23 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description soman namos CLA 2015-05-03 06:02:17 EDT
Imagine we have a this code:

namespace MyNmspc
{
  class MyClass
  {
    void foo();
    void bar();
  };
}

Implement method always generates such way:

void MyNmspc::MyClass::foo()
{
}

void MyNmspc::MyClass::bar()
{
}

It could break some code styles and it would be good is CDT will allow user to choose whether include namespace in each definition or just once like:

namespace MyNmspc
{
  void MyClass::foo()
  {
  }
  
  void MyClass bar()
  {
  }
}

Also cdt should allow to choose which of namespaces should be included in definitions and which of them declared once, something like deep level. It's for cases with nested namespaces, for example

namespace One
{
  namespace Two
  {
    namespace Three
    {
      void foo();
    }
  }
}

Then user could generate something like this:

namespace One
{
  namespace Two
  {
    void Three::foo()
    {
    }
  }
}
Comment 1 Sergey Prigogin CLA 2015-05-03 18:45:43 EDT
I don't think there is a need to support mixed style:

namespace One
{
  namespace Two
  {
    void Three::foo()
    {
    }
  }
}

Even the style currently used for generating code is probably never used by humans:

void MyNmspc::MyClass::foo()
{
}

void MyNmspc::MyClass::bar()
{
}