Hi all,
I hope I'm not reporting anything already reported, I didn't find it on the forums and here.
The problem is that, when using "inline" nested namespaces, like this: fn::kh::subnetting::function(), the code completion stops working, the code refactoring fails, and this is terrible for those like me who like to use inline nested namespaces.
Below you'll see the code with 3 nested namespaces, like this:
namespace fn{ namespace kh{ namespace subnetting{ } } }
But now try to replace it by:
namespace fn::namespace kh::namespace subnetting{ }
Then you'll notice that your function:
fn::kh::subnetting::sayHello("Gonzalo");
Although it continues to work, as obvious, if you try to change the "sayHello" function name, it doesn't change, it gives the error "symbol not found under cursor", as it doesn't recognize the nested functions.
Also, the autocompletion fails there, you'll be only able to write fn:: with auto completion of fn::sayHello, as if it was only inside the first namespace, and then you have to add the "kd::subnetting:: in the middle for it to be complete.
The same way, if you change it in the .h or .cpp file of the namespace, it changes them but not in the main.cpp because the inline nested namespace isn't parsed.
I know it may be more difficult than it seems, and I didn't find a ticket with it.
If you have one already, I'm terribly sorry to duplicate it, hope it's the first time.
You can easily replicate this behaviour, with simple code (sorry for the big chars it's the first time I use this):
int main(int argc,char argv){ fn::kh::subnetting::sayHello("Gonzalo"); return 0; }
#ifndef FN_KH_SUBNETTING_H_INCLUDED #define FN_KH_SUBNETTING_H_INCLUDED #import <iostream> namespace fn{ namespace kh{ namespace subnetting{ void sayHello(std::string name); } } } #endif // FN_KH_SUBNETTING_H_INCLUDED
Now the file fn_kh_subnetting_cpp:
namespace fn{ namespace kh{ namespace subnetting{ void sayHello(std::string name){ std::cout<<"Hello "<<name<<std::endl; } } } }
Thanks!
Not only namespaces but nested classes are affected as well:
Diff: