Problem with structure field hints

Abierto
#14,590 3 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
45/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Tranquilo
Stack tecnológico
c, typescript
Área
tooling

Línea de trabajo

Reproduce el problema en main.c usando las tres ubicaciones de prueba de completion y los operadores indicados; después, sigue las solicitudes textDocument/completion a través de auto_complete::handle_completion. Compara por qué la completion aparece en la segunda ubicación, pero no en la primera ni en la tercera. Se considera terminado cuando las sugerencias de campos de estructura aparecen de forma coherente para los contextos y operadores indicados.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

bug verified Visual Studio
Environment
  • OS and Version: Windows 10 LTSC 2018
  • VS Code Version: 1.129.1
  • C/C++ Extension Version: 1.32.2
Bug Summary and Steps to Reproduce
  1. Create a main.c file with the following contents::
struct {
    int a;
    int b;
} test;

int main(){
    int err = 0;

    test.
    err++;

    test.
    err = err + 1;

    test.
    err--;
}

It's expected that pressing ctrl+space will give us a tooltip, but the first and third "test." the hint doesn't appear, it only works for the second one. ++, --, +=, -=, *=, /=, |=, &=, and ^=/ have similar behavior.

Configuration and Logs
loggingLevel: 6
loggingLevel был изменен на: Debug
Обработан файл c_cpp_properties.json за 0.0065977 с
Intellisense update pending for: file:///c%3A/prog/c/bugTest/main.c
Завершение работы сервера IntelliSense: C:\prog\c\bugTest\main.c
LSP: (received) cpptools/didChangeCppProperties (id: 453)
LSP: (invoked) cpptools/didChangeCppProperties (id: 453)
Попытка получить значения по умолчанию из компилятора C++ в свойстве "compilerPath": "cl.exe"
Попытка получить значения по умолчанию из компилятора C в свойстве "compilerPath": "cl.exe"
  Папка C:\PROGRAM FILES (X86)\MICROSOFT VISUAL STUDIO\18\BUILDTOOLS\VC\TOOLS\MSVC\14.50.35717\INCLUDE будет индексироваться
  Папка C:\PROG\C\BUGTEST будет индексироваться
LSP: Sending response (id: 453)
LSP: (received) cpptools/getFoldingRanges: file:///c%3A/prog/c/bugTest/main.c (id: 454)
LSP: (invoked) cpptools/getFoldingRanges: file:///c%3A/prog/c/bugTest/main.c (id: 454)
LSP: Sending response (id: 454)
LSP: (received) cpptools/getCodeActions: file:///c%3A/prog/c/bugTest/main.c (id: 455)
LSP: (invoked) cpptools/getCodeActions: file:///c%3A/prog/c/bugTest/main.c (id: 455)
LSP: Sending response (id: 455)
LSP: $/cancelRequest (<unknown/completed>, id: 455)
LSP: (received) cpptools/getCodeActions: file:///c%3A/prog/c/bugTest/main.c (id: 456)
LSP: (invoked) cpptools/getCodeActions: file:///c%3A/prog/c/bugTest/main.c (id: 456)
LSP: Sending response (id: 456)
IntelliSense update scheduled and TU acquisition started for: file:///c%3A/prog/c/bugTest/main.c
Populating file name cache...
Done populating filename cache. Elapsed time: 0 ms
Expanding recursive includes for: C:\PROG\C\BUGTEST\MAIN.C
Done expanding recursive includes for: C:\PROG\C\BUGTEST\MAIN.C
Reducing recursive includes for: C:\PROG\C\BUGTEST\MAIN.C
Done reducing recursive includes for: C:\PROG\C\BUGTEST\MAIN.C
Отправка аргументов компиляции для C:\prog\c\bugTest\main.c.
  system include: C:\PROGRAM FILES (X86)\MICROSOFT VISUAL STUDIO\18\BUILDTOOLS\VC\TOOLS\MSVC\14.50.35717\INCLUDE
  define: _DEBUG
  define: UNICODE
  define: _UNICODE
  stdver: ms_c17
  intelliSenseMode: windows-msvc-x64
Время обновления IntelliSense (в секундах): 0.038
LSP: (received) cpptools/getFoldingRanges: file:///c%3A/prog/c/bugTest/main.c (id: 457)
LSP: (invoked) cpptools/getFoldingRanges: file:///c%3A/prog/c/bugTest/main.c (id: 457)
LSP: Sending response (id: 457)
LSP: (received) cpptools/getCodeActions: file:///c%3A/prog/c/bugTest/main.c (id: 458)
LSP: (invoked) cpptools/getCodeActions: file:///c%3A/prog/c/bugTest/main.c (id: 458)
LSP: Sending response (id: 458)
LSP: (received) cpptools/getFoldingRanges: file:///c%3A/prog/c/bugTest/main.c (id: 459)
LSP: (invoked) cpptools/getFoldingRanges: file:///c%3A/prog/c/bugTest/main.c (id: 459)
LSP: Sending response (id: 459)
LSP: (received) cpptools/didChangeActiveEditor: file:///c%3A/prog/c/bugTest/main.c
LSP: (invoked) cpptools/didChangeActiveEditor: file:///c%3A/prog/c/bugTest/main.c
LSP: (received) cpptools/getCodeActions: file:///c%3A/prog/c/bugTest/main.c (id: 460)
LSP: (invoked) cpptools/getCodeActions: file:///c%3A/prog/c/bugTest/main.c (id: 460)
LSP: Sending response (id: 460)
LSP: (received) cpptools/didChangeVisibleTextEditors
LSP: (invoked) cpptools/didChangeVisibleTextEditors
LSP: (received) cpptools/didChangeVisibleTextEditors
LSP: (invoked) cpptools/didChangeVisibleTextEditors
LSP: (received) cpptools/didChangeTextEditorSelection
LSP: (invoked) cpptools/didChangeTextEditorSelection
LSP: (received) cpptools/getCodeActions: file:///c%3A/prog/c/bugTest/main.c (id: 461)
LSP: (invoked) cpptools/getCodeActions: file:///c%3A/prog/c/bugTest/main.c (id: 461)
LSP: Sending response (id: 461)
LSP: (received) textDocument/completion: file:///c%3A/prog/c/bugTest/main.c (id: 462)
LSP: (invoked) textDocument/completion: file:///c%3A/prog/c/bugTest/main.c (id: 462)
auto_complete::handle_completion: file:///c%3A/prog/c/bugTest/main.c (9:10)
Предлагается завершение.
LSP: Sending response (id: 462)
LSP: (received) cpptools/didChangeTextEditorSelection
LSP: (invoked) cpptools/didChangeTextEditorSelection
LSP: (received) cpptools/getCodeActions: file:///c%3A/prog/c/bugTest/main.c (id: 463)
LSP: (invoked) cpptools/getCodeActions: file:///c%3A/prog/c/bugTest/main.c (id: 463)
LSP: Sending response (id: 463)
LSP: (received) textDocument/completion: file:///c%3A/prog/c/bugTest/main.c (id: 464)
LSP: (invoked) textDocument/completion: file:///c%3A/prog/c/bugTest/main.c (id: 464)
auto_complete::handle_completion: file:///c%3A/prog/c/bugTest/main.c (12:10)
Предлагается завершение.
LSP: Sending response (id: 464)
LSP: (received) completionItem/resolve (id: 465)
LSP: (invoked) completionItem/resolve (id: 465)
LSP: Sending response (id: 465)
LSP: (received) cpptools/didChangeTextEditorSelection
LSP: (invoked) cpptools/didChangeTextEditorSelection
LSP: (received) cpptools/getCodeActions: file:///c%3A/prog/c/bugTest/main.c (id: 466)
LSP: (invoked) cpptools/getCodeActions: file:///c%3A/prog/c/bugTest/main.c (id: 466)
LSP: Sending response (id: 466)
LSP: (received) textDocument/completion: file:///c%3A/prog/c/bugTest/main.c (id: 467)
LSP: (invoked) textDocument/completion: file:///c%3A/prog/c/bugTest/main.c (id: 467)
auto_complete::handle_completion: file:///c%3A/prog/c/bugTest/main.c (15:10)
Предлагается завершение.
LSP: Sending response (id: 467)
Other Extensions

No response

Additional context

No response

Lenguaje dominante
TypeScript
Estrellas
6.2k
Forks
1.7k
Merge medio
14 h 46 min
PR fusionados (30 d)
61

Guía de contribución

Abrir la guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de microsoft/vscode-cpptools

Todos los issues de microsoft/vscode-cpptools

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.