Intellisense only showing a couple files in a certain namespace

I've been using resharper for quite a while, but recently, resharper stopped showing a big part of classes in a certain namespace.

I have a nested namespace 'Hv::Utility' and I used a certain class out of it as an example.

 

When typing 'Hv::Utility::', reshaper only shows a couple files:

But when I just type 'Hv::', intellisense does find the class:

This is especially annoying for me, since I'm using a namespace alias 'namespace Hu = Hv::Utility;' to try and make my code be a bit cleaner, but it is horrible to use when resharper's intellisense only shows a fraction of the classes in the namespace.

Does anyone know how to fix this issue?

From my testing, it seems that this namespace is the only namespace where intellisense doesn't work correctly with.

Thanks in advance.

7 comments

Hello Jelte,

ReSharper C++ has several types of completion. Completion items without a description in parentheses are what is visible from the point you complete in according to language rules. Completion items with "in namespace" or "in file" come from "import" completion, where R++ looks at all available symbols in the solution and tries to add items that would be valid if a name qualifier or an include directive was inserted.

Turns out there are at least a couple of issues when import completion is invoked after a qualifier that has multiple parts or references a namespace alias. I filed https://youtrack.jetbrains.com/issue/RSCPP-21132 and https://youtrack.jetbrains.com/issue/RSCPP-21133 for these issues, please follow them if you want to be notified when they get fixed. This will likely happen soon and you can try installing one of the 2018.1 EAP builds, which will be available from https://www.jetbrains.com/resharper/eap/.

Thanks for letting us know about the bugs!

 

0

Taking another look at the first screenshot, it's definitely strange that DynArray is not in the completion list, even though it is clearly visible from this points since the previous declaration is not red. Would you be able to come up with an example which reproduces this issue?

0

Hello Igor,

Thanks for the reply.

I'm not sure that I can come up with an example to reporduce this (even though it always happens for me), since I have no idea how it started.

I've tried some different things, but it seems that the occurance of this issue is happening randomly.

0

Jelte,

What version of R++ did you upgrade from? Did you upgrade to 2017.3.2?

By "randomly" do you mean that sometimes completion is wrong and sometimes it is right at the same code point, or does the completion always return wrong results there?

We can't yet reproduce it, but we'll keep trying. If you find and can share an example where this problem can be reproduced, please let us know.

Thanks!

0

Hey Igor,

I'm currently using 2017.3.2 and with "randomly", I mean that it suddenly stopped working, but no matter what I include, only those couple types are showing.

I'm also only having a problem with that 1 specific namespace, which makes it even more confusing.

0

Where are the entities defined and where do you complete from? Is it something like this:

// Test.h
namespace Hv
{
namespace Utility
{
template <class T> struct DynArray {};
}
}

// Test.cpp
#include "test.h"

Hv::Utility::

Or is Hv another namespace aliases? What happens if you try to complete in the file that DynArray is defined in?

If you can share this part of your code under an NDA, we'll be happy to take a look.

0

I'm currently defining the namespaces in c++17 style, not sure if this has an effect, since replacing it with 2 namespaces doesn't seem to have an effect. Both Hv and Utility are not aliases.

 

namespace Hv::Utility {

  template <typename T> class DynArray{};

}

 

These files are all included in 1 big header, which I include.

The problem also occurs in the file where DynArray is defined and implemented.

0

Please sign in to leave a comment.