Bug 162567 - jump to declaration/definition under cursor does not work for arrays
Summary: jump to declaration/definition under cursor does not work for arrays
Status: RESOLVED FIXED
Alias: None
Product: kdevelop
Classification: Applications
Component: general (show other bugs)
Version: 4.0.0
Platform: openSUSE Linux
: NOR normal
Target Milestone: ---
Assignee: kdevelop-bugs-null
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-05-24 18:35 UTC by Maciej Pilichowski
Modified: 2008-07-06 23:50 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Maciej Pilichowski 2008-05-24 18:35:48 UTC
Version:            (using KDE 3.5.9)
Installed from:    SuSE RPMs

M m;
m.foo(); // works

M *m;
m->foo(); // works

M *m[2];
m[0]->foo(); // does not work
Comment 1 Maciej Pilichowski 2008-05-24 18:40:59 UTC
My mistake, I don't use plain arrays for a long time, so I forgot it is:
vector<M*> m;
not 
M *m[2]; // this works

Now it looks more like a wish.
Comment 2 Andreas Pakulat 2008-05-24 19:32:11 UTC
Actually the original code works for me, as long as I can make sure C++ support knows about the class. So this might just be C++ support not finding the class for some reason (and its hard to debug/find out why this happens sometimes). 

Thus I'm closing as worksforme.
Comment 3 Maciej Pilichowski 2008-05-24 19:45:40 UTC
Just tested, it is verbatim quote:

#include <vector>

struct A
{
  int foo() { return 0; };
};

void bar()
{
  using namespace std;
  
  vector<A> v;
  A a[10];
  v[0].foo(); // does not work
  a[0].foo(); // works
}

Andreas, could you please test it. Thank you.
Comment 4 Andreas Pakulat 2008-05-24 21:34:51 UTC
Hmm, I think it should work with you use std::vector and not the using directive (which is a known bug). But that doesn't work here right now either, even though std::vector is resolved.

And testing with kdev4, it has the same problem. I'm re-opening.
Comment 5 Maciej Pilichowski 2008-05-24 21:41:19 UTC
It does not work with std::vector either. The "arrays" in summary is wrong (sorry again) -- it is templates, when built-in parser is confused.
Comment 6 Andreas Pakulat 2008-05-24 21:45:08 UTC
And also confirming that with std::vector you don't get code-completion for the functions of the class in the container.
Comment 7 David Nolden 2008-05-24 21:51:33 UTC
@Andreas Please don't mix up bugs for KDevelop-4 with bugs for KDevelop-3, because Maciej seems to talk about KDevelop-3, and the versions have nothing in common in that area.

@Maciej:
In KDevelop-3, the only thing that is not supported is the using directive within the function. Have you tried saying std::vector<A>?
Comment 8 Maciej Pilichowski 2008-05-24 22:10:11 UTC
David, see #5 and #6.
Comment 9 David Nolden 2008-05-24 22:40:31 UTC
Ah ok. Unfortunately I'm too busy with KDevelop-4, and don't even have KDevelop-3 sources installed anymore. So unless someone else will work on this, I have to close it as WONTFIX.

Maybe in a few months there will be a usable KDevelop-4 as replacement.
Comment 10 Maciej Pilichowski 2008-05-25 07:18:01 UTC
David, it is ok with Kdevelop3, but what about Kdevelop4 then? Is this feature fixed in KDevelop4? See #4, Andreas wrote that the same problem occurs in Kdevelop4 (I am not talking about internals, but the effect for the user).
Comment 11 Andreas Pakulat 2008-05-25 09:49:05 UTC
Re-Opening for 4.0. I'm all for not yet letting users write bugreports against KDevelop4 (until we have beta releases), however we devs can use bugreports to keep track of problems we encountered and cannot fix immediately. bko is a much better place than the mailinglist, as the mailinglist makes it easy to forget things.

As I said in #4 std::vector<Foo> v; v.at(1).<Ctrl+Spacebar> doesn't work in current checkout.
Comment 12 David Nolden 2008-05-25 12:56:38 UTC
@Maciej: It works for me in KDevelop-4(See the mailing list). I don't know why it doesn't for Andreas.

@Andreas: Let's communicate this on the mailing-list, it's simpler.
Comment 13 David Nolden 2008-05-25 12:56:50 UTC
@Maciej: It works for me in KDevelop-4(See the mailing list). I don't know why it doesn't for Andreas.

@Andreas: Let's communicate this on the mailing-list, it's simpler.
Comment 14 Andreas Pakulat 2008-07-06 23:50:12 UTC
works now for me too in kdevelop4. closing.