[Bug 46684] code completion reacts on dot operator for pointer to struct

Sascha Cunz mail at sacu.de
Thu Jan 15 22:41:02 UTC 2004


------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
      
http://bugs.kde.org/show_bug.cgi?id=46684      




------- Additional Comments From mail at sacu.de  2004-01-15 22:38 -------
So what?
Could we all please sit down, have a cup of tea and calm a little down? As either side is insisting on their (good) arguments, this will soon end up in a totally unneccessary flame war - so let's please come back to facts.

Fact 1 is: KDevelop does currently not know about what kind of operations could be used on a variable. Thus it has to present code completion on either . or ->

Fact 2 is: All of you forgot: :: must also lead to code completion - and is even much complexer than . or -> is; if we're out of the scope of a function implementation, we need to show up all members declared in the classname before the double colun and/or all public symbols inside a namespacename before the class. The second one needs to consider all previous using directives to work correctly. If we're inside a class declaration, we need to resolve only namespacenames. And finally: if we're outside any scope, we need to present namespaces, all classmembers and namespaces.

Fact 3 is: Knowing such things is a very hard job. It's not like watching for variable declarations. Taking "operator*()", "operator->()" and "operator classname()" into account it's even worse. I have even written working code like: "if( var.isValid() ) var->doSomething();" It becomes yet complexer, if class templates come into account.

Fact 4 is: I have a project, where i have XML::Node and Tree::Node classes. I create instances of Tree::Node only via some garbage-collection aware smart-pointer template class. Thus "Node a; a." can be valid, if i'm "using namespace XML;". If i use "Ref< Node > a" and "using namespace Tree;" then: "a." "a->" "(*a)." "(**)a." "(*a)->" are all valid.

Fact 5 is: What about *-> and *. operators?

I don't think, that i catched up every problem/question that arises here.

So - what could we conclude out of this? This turns to be a complex wish.

If anybody comes up with an implementation that in fact works, i don't see a cause to not include it. Even if i would personally have it turned off at my side all the time - And it should be turned off by default UNTIL it is proven that it really works, even in border-line-cases.

Cheers Sascha




More information about the KDevelop-devel mailing list