microsoft / vscode-cpptools

Official repository for the Microsoft C/C++ extension for VS Code.
Other
5.52k stars 1.55k forks source link

IntelliSense is slow with ranges in clang mode (and gcc mode is giving an error) #9937

Open sean-mcmanus opened 2 years ago

sean-mcmanus commented 2 years ago
    I switched to 1.13.1.  I can confirm that the reported issue is fix.

Now I'm experiencing two more issues with the same "test".

  1. Performance when CTRL+Click on std::view is very poor on my machine. It takes very long to load the IntelliSense data, and then the line that should appears under std::range::view feels to no appear: appears disappears. This feature behaves erratically. This sluggish behavior is present in the Clang configuration. In the GCC configuration the performance is much smoother. IMO
  2. In the GCC configuration now I am seeing this (I haven't noticed this error before): image

Originally posted by @Zingam in https://github.com/microsoft/vscode-cpptools/issues/9888#issuecomment-1262831775

Zingam commented 2 years ago

And a third complaint in that context. It is really difficult to move the mouse from the red squiggle to click on View Problem. The hover disappears too quickly (at least on Ubuntu 22.04/Wayland/Gnome). It feels like a clicking game, which requires very precise movements.

sean-mcmanus commented 2 years ago

@Zingam Your last issue is a VS Code UI issue, so you'd need to file an issue at https://github.com/microsoft/vscode/issues . I have also experienced issues with the hover disappearing when I don't want it to. It's possible there might be an existing issue about it.

Zingam commented 2 years ago

I'm using 1.13.2.

I have an interesting observation:

#include <iostream>
#include <ranges>

auto
main() -> int
{
  std::cout << "----> Ranges\n";
  auto const ints = { 0, 1, 2, 3, 4, 5 };
  auto even = [](int i) { return 0 == i % 2; };
  auto square = [](int i) { return i * i; };

  // "pipe" syntax of composing the views:
  for (int i :
       ints | std::views::filter(even) | std::views::transform(square)) {
    std::cout << i << ' ';
  }

  std::cout << "---- END ----" << "\n";
}

Clang mode: On my machine the hover appears immediately over the top std::cout and all other auto's below. After the // "pipe"... comment the hover takes 1-2 or more seconds (sometimes I can see Loading...) to appear even when over the bottom std::cout. The performance/timing appears to be random.

GCC mode All hovers appear immediately.