Maintained engine: the first completion in a just-opened module importer waits for its first preamble
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Aptitud para principiantes
- 15/100
- Tipo de issue
- Nueva funcionalidad
- Claridad
- Necesita aclaración
- Estado de actividad
- Activo
- Stack tecnológico
- cpp
- Área
- devtools, performance
Línea de trabajo
The first-completion wait comes from patch 0008, which switches code completion to TUScheduler::Stale in modules mode, so start from that change and the StaleOrAbsent path it replaces. The issue describes three possible improvements, and the work requires choosing one, either a bounded wait of about 800 ms, a persistent validation memo, or prioritizing the edited file in the prime pool. Done means a decision recorded on the issue, and any change verified against the ux-xlings U5 typing checks.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Symptom
With the maintained engine (mcppls-clangd 0.0.12, 23.1.0-mcppls.0), completion in a module importer that was just opened waits for the file's first preamble. That takes several seconds on a real project. For example, in xlings src/core/xself/doctor.cpp the first build of about 100 prerequisite modules takes about 3.3 s locally and longer on CI runners. Until the preamble exists, each completion runs past the server's 1 s budget and mcppls's own engine answers it. After that, completion answers in 35–390 ms.
Stock clangd 23.1 answers at once in that window, from its fallback without a preamble. That fallback leaves out imported declarations, and after ., -> or :: it is empty (the 0.0.11 "popup never came" report).
Cause
This is intended engine behavior. In modules mode, mcppls-clangd's code completion runs on TUScheduler::Stale instead of StaleOrAbsent (patch 0008, the "first module completion" change of UP-25), so a first completion waits for the first preamble instead of giving an import-blind answer.
Measured locally on the same workspace, warm cache, 40 s of 10 Hz typing (ux-xlings U5):
| completions during the first preamble | after it | |
|---|---|---|
| stock 23.1 | 7–16 ms (fallback) | p95 ≈ 0.2 s |
| mcppls-clangd 0.0.12 | 1.4–6.3 s (past the 1 s budget, answered by mcppls) | 35–390 ms |
Decision for 0.0.12
The wait on first open is accepted. The ux typing checks now report it as their own "first-open" measurement and hold p95 and engine share to the unchanged budgets for the completions after the engine's first answer.
To improve later
- A bounded wait: wait for the first preamble up to a budget (about 800 ms), then answer as upstream does and let the semantic answer follow.
- A faster first preamble on a warm cache: the BMIs are all reused, and the time goes to validating each prerequisite again. A validation memo that persists across processes, keyed by the same exact inputs, would remove most of it.
- Priority for the edited file: at startup, prime units' prerequisite work shares the bounded build pool with the file being typed in. The focused file should go first.
- Lenguaje dominante
- C++
- Estrellas
- 25
- Forks
- 2
- Merge medio
- 21 h 5 min
- PR fusionados (30 d)
- 13
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de Sunrisepeak/mcpp-language-server
-
Extraneous quote in include completionPosiblemente ocupada @Sunrisepeak la tomó hace 1 día. Abiertobug
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Sunrisepeak/mcpp-language-server#80 · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
Sunrisepeak/mcpp-language-server#66 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 3/5 1-2 días Aptitud para principiantes 70/100
Sunrisepeak/mcpp-language-server#81 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 1/100
Sunrisepeak/mcpp-language-server#77 · 3 comentarios ·
Los mantenedores suelen responder en 1 día
-
Dificultad 4/5 3-5 días Aptitud para principiantes 45/100
Sunrisepeak/mcpp-language-server#71 ·
Los mantenedores suelen responder en 1 día
Todos los issues de Sunrisepeak/mcpp-language-server
Issues similares
-
status:needs-triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
PX4/PX4-Autopilot#29698 ·
Los mantenedores suelen responder en 1 día
-
go perft exits when EvalFile is unavailablePosiblemente ocupada @Muawiya-contact la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
official-stockfish/Stockfish#7292 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 77/100
arvidn/libtorrent#9149 ·
Los mantenedores suelen responder en 1 día
-
Upstream report: MSVC rejects a designated initializer in a dependent template argument (C2131)Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
rhalbersma/tabula#72 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
esp8266/Arduino#9342 · 2 comentarios ·
Los mantenedores suelen responder en 1 día