Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Visual studio\code intellisense experience #187

Open
Chrys4lisfag opened this issue May 20, 2024 · 2 comments
Open

Visual studio\code intellisense experience #187

Chrys4lisfag opened this issue May 20, 2024 · 2 comments
Labels
help wanted Extra attention is needed

Comments

@Chrys4lisfag
Copy link

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

@tcbrindle
Copy link
Owner

tcbrindle commented May 20, 2024

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.

@tcbrindle tcbrindle added the help wanted Extra attention is needed label May 20, 2024
@tcbrindle
Copy link
Owner

For anyone else having a problem with this, the clangd extension for VSCode is an alternative language server implementation providing type information, code completion etc that seems much better (and quite a bit faster) than the default provider that comes with the C/C++ extension. In particular, it seems like it works well with Flux so I suggest giving it a try if you can.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants