microsoft / microsoft/vscode-cpptools
Slow Autocomplete for translation units including bulky header files
Chưa có ai nhận issue này.
- Ngôn ngữ chính
- TypeScript
- Star
- 6.2k
- Fork
- 1.7k
- Merge trung bình
- 14 giờ 46 phút
- Pull request đã merge (30 ngày)
- 61
Mô tả
Type: LanguageService
Describe the bug
- OS and Version: macOS Mojave (10.14.5), MBP Mid 2015
- VS Code Version: 1.36.0
- C/C++ Extension Version: 0.24.0
- Other extensions you installed (and if the issue persists after disabling them): CMake Tools, Git lens
- Autocompletion for source files including bulky header files like the ones given below. Auto complete sometimes takes 5 seconds to return result. Most of the time it steadily takes 2-3 seconds to return results.
Tried disabling/enabling IntelliSense cache yet 4-5 seconds lag was visible.
To Reproduce
Source Sample:
#include <algorithm>
#include <atomic>
#include <chrono>
#include <cstdio>
#include <cstdlib>
#include <iomanip>
#include <iostream>
#include <random>
#include <thread>
#include <vector>
#include <boost/intrusive/list.hpp>
#include <boost/lockfree/queue.hpp>
#include <boost/program_options.hpp>
Preprocessed file has 1.3 lakh lines (4.4 MB).
c_cpp_properties.json:
{
"configurations": [
{
"name": "Mac",
"includePath": [
"${workspaceFolder}/**",
"${vcpkgRoot}/x64-osx/include"
],
"defines": [],
"macFrameworkPath": [
"/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks"
],
"compilerPath": "/usr/bin/clang",
"cStandard": "c11",
"cppStandard": "c++17",
"intelliSenseMode": "clang-x64",
"configurationProvider": "vector-of-bool.cmake-tools",
"compileCommands": "${workspaceFolder}/build/compile_commands.json"
}
],
"version": 4
}
Expected behavior
Autocompletion returning results within a second always (too much to ask for?).
Screenshots
Instead autocomplete taking 5 seconds to complete

Profiler Output
Just in case, if you may require, I've attached Instruments profile output of server for autocomplete operation.
Run 1 -> IntelliSense caching disabled.

Run 2 -> IntelliSense caching enabled.

Complete Browsable Instruments Trace:
Msvc.Autocomplete.trace.zip
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Hướng nghiên cứu
Bắt đầu với mẫu mã nguồn C++, c_cpp_properties.json và dữ liệu đầu ra của profiler Msvc.Autocomplete.trace.zip được đính kèm. Tái hiện tính năng tự động hoàn thành trên các header chuẩn và Boost được liệt kê, sau đó so sánh độ trễ quan sát được là 2–5 giây với thời gian phản hồi dự kiến trong vòng một giây.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- cpp, vscode
- Lĩnh vực
- developer-experience, performance, tooling
- Loại issue
- Lỗi
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Cần làm rõ
- Mức phù hợp với người mới
- 25/100