tcbrindle/flux

Visual studio\code intellisense experience

Chrys4lisfag opened this issue · 1 comments

Decided to take a look at the framework and experienced some issues with VisualStudio (both MSVC\Clang) and Visual Code IDE.

After the first adapter intellisense has issues in guessing the return type which makes developing inconvenient or mostly impossible.
The code compiles just fine but no type guessing, so not possible to look for methods etc.

As I understand this is purely intellisense issue but does anyone know of a way to fix this?
image

Hi, thanks for the bug report.

I've just been playing with Flux in VS Code (I normally use CLion), and unfortunately you're absolutely right. From what I can tell, VS's Intellisense doesn't like any use of the CRTP "derived" class name in constraints on base class member functions.

For example, the declaration of filter in inline_sequence_base is:

template <typename Derived>
struct inline_sequence_base {
    template <typename Pred>
        requires std::predicate<Pred&, element_t<Derived>> // <- Here
    auto filter(Pred pred) &&;

    /* ...many other functions... */
}

It seems like it's the use of the name Derived in the constraint here that is tripping things up. Other methods which don't have constraints in this style (e.g. stride() or take()) seem to work okay.

This looks like a bug in VS's Intellisense rather than anything we're doing wrong in Flux, but it's quite an annoying one! Hopefully it will be sorted at some point but in the mean time I'll leave this open in case anyone else knows of a workaround.