microsoft / microsoft/vscode-cpptools

Show errors in included header files so that the cause of failed IntelliSense (e.g. autocomplete) can be more easily discovered

Aperta
#10,128 6 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

enhancement Language Service more votes needed parser Works in VS
Lingua principale
TypeScript
Stelle
6.2k
Fork
1.7k
Merge medio
14h 46m
PR unite (30g)
61

Descrizione

Environment
  • OS and Version: Windows 11
  • VS Code Version:1.73.0
  • C/C++ Extension Version: 1.13.3 (same for latest release)
  • Other extensions you installed (and if the issue persists after disabling them): all other extensions are disabled, but the issue persists
  • If using SSH remote, specify OS of remote machine: -
  • A clear and concise description of what the bug is, including information about the workspace (i.e. is the workspace a single project or multiple projects, size of the project, etc): single-folder project, C-only, for Renesas RA4M2 series microcontroller (ARM cortex-m). Project size ~15MB (~1200 source files, 280k Line of code)
Bug Summary and Steps to Reproduce

Bug Summary:
There is a header file (renesas.h), with a size of 3.5MB, containing register definitions with nested structs and unions, macros, etc.
if this file is included in the ".c" file, the code autocompletion stops working and the output window shows "Quick info operation failed: FE: 'Unknown error'"

Commenting out blocks of the huge .h file will make the code completion again. It seems, some counter counting tags, language elements or whatever gets saturated.
In error state, commenting a line(or block) makes it working again, but uncommenting a previously commented line leads to error.

Unfortunately, the bug does not occur always, but if it occurs once, then it becomes permanent.

Steps to reproduce:

  1. open a source file (.c)
  2. start typing text to make the code completion window pop-up
  3. when it pops up, the list of expected objects are missing and the output window shows the error text "Quick info operation failed: FE: 'Unknown error'"

Expected behavior

the list of variables are shown in the pop-up window
Code_0IVsD1YGJk

Code sample and Logs
-------- Diagnostics - 11/9/2022, 11:00:32 PM
Version: 1.13.3
Current Configuration:
{
    "name": "RA4M2",
    "includePath": [
        "${workspaceFolder}/src",
        "${workspaceFolder}/src/apps",
        "${workspaceFolder}/src/communication",
        "${workspaceFolder}/src/manager",
        "${workspaceFolder}/src/stack/sdk/SRC/EXAMPLE/**",
        "${workspaceFolder}/ra/fsp/inc",
        "${workspaceFolder}/ra/fsp/inc/api",
        "${workspaceFolder}/ra/fsp/inc/instances",
        "${workspaceFolder}/ra/fsp/src/rm_threadx_port",
        "${workspaceFolder}/ra/microsoft/azure-rtos/threadx/common/inc",
        "${workspaceFolder}/ra/arm/CMSIS_5/CMSIS/Core/Include",
        "${workspaceFolder}/ra_gen",
        "${workspaceFolder}/ra_cfg/fsp_cfg/bsp",
        "${workspaceFolder}/ra_cfg/fsp_cfg",
        "${workspaceFolder}/ra_cfg/fsp_cfg/azure/tx",
        "${workspaceFolder}/ra/microsoft/azure-rtos/usbx/common/usbx_device_classes/inc",
        "${workspaceFolder}/ra/microsoft/azure-rtos/usbx/common/core/inc",
        "${workspaceFolder}/ra/fsp/src/r_usb_basic/src/driver/inc",
        "${workspaceFolder}/ra/fsp/src/r_flash_hp",
        "${workspaceFolder}/ra/fsp/src/rm_usbx_port",
        "${workspaceFolder}/src/contrib/**"
    ],
    "defines": [
        "_DEBUG",
        "_UNICODE",
        "_RENESAS_RA_",
        "SEN_PIN_CONNECTION_AVAILABLE"
    ],
    "intelliSenseMode": "gcc-arm",
    "compilerPath": "c:\\Renesas\\RA\\e2studio_v2021-10_fsp_v3.5.0\\toolchains\\gcc_arm\\gcc-arm-none-eabi-10.3-2021.10/bin/arm-none-eabi-gcc.exe",
    "configurationProvider": "ms-vscode.cpptools",
    "compilerPathIsExplicit": true,
    "cStandardIsExplicit": false,
    "cppStandardIsExplicit": false,
    "intelliSenseModeIsExplicit": true,
    "mergeConfigurations": false,
    "browse": {
        "path": [
            "${workspaceFolder}/src",
            "${workspaceFolder}/src/apps",
            "${workspaceFolder}/src/communication",
            "${workspaceFolder}/src/manager",
            "${workspaceFolder}/src/stack/sdk/SRC/EXAMPLE/**",
            "${workspaceFolder}/ra/fsp/inc",
            "${workspaceFolder}/ra/fsp/inc/api",
            "${workspaceFolder}/ra/fsp/inc/instances",
            "${workspaceFolder}/ra/fsp/src/rm_threadx_port",
            "${workspaceFolder}/ra/microsoft/azure-rtos/threadx/common/inc",
            "${workspaceFolder}/ra/arm/CMSIS_5/CMSIS/Core/Include",
            "${workspaceFolder}/ra_gen",
            "${workspaceFolder}/ra_cfg/fsp_cfg/bsp",
            "${workspaceFolder}/ra_cfg/fsp_cfg",
            "${workspaceFolder}/ra_cfg/fsp_cfg/azure/tx",
            "${workspaceFolder}/ra/microsoft/azure-rtos/usbx/common/usbx_device_classes/inc",
            "${workspaceFolder}/ra/microsoft/azure-rtos/usbx/common/core/inc",
            "${workspaceFolder}/ra/fsp/src/r_usb_basic/src/driver/inc",
            "${workspaceFolder}/ra/fsp/src/r_flash_hp",
            "${workspaceFolder}/ra/fsp/src/rm_usbx_port",
            "${workspaceFolder}/src/contrib/**",
            "${workspaceFolder}"
        ],
        "limitSymbolsToIncludedHeaders": true
    }
}
Translation Unit Mappings:
[ C:\Work\firefly\firefly_poller\src\apps\ptxApp.c ]:
    C:\Work\firefly\firefly_poller\src\apps\ptxApp.c
    C:\Work\firefly\firefly_poller\ra\fsp\src\bsp\cmsis\Device\RENESAS\Include\renesas.h *
Translation Unit Configurations:
[ C:\Work\firefly\firefly_poller\src\apps\ptxApp.c ]:
    Process ID: 9564
    Memory Usage: 79 MB
    Compiler Path: C:\Renesas\RA\e2studio_v2021-10_fsp_v3.5.0\toolchains\gcc_arm\gcc-arm-none-eabi-10.3-2021.10\bin\arm-none-eabi-gcc.exe
    Includes:
        C:\Work\firefly\firefly_poller\src
        C:\Work\firefly\firefly_poller\src\apps
        C:\Work\firefly\firefly_poller\src\communication
        C:\Work\firefly\firefly_poller\src\manager
        C:\Work\firefly\firefly_poller\ra\fsp\inc
        C:\Work\firefly\firefly_poller\ra\fsp\inc\api
        C:\Work\firefly\firefly_poller\ra\fsp\inc\instances
        C:\Work\firefly\firefly_poller\ra\fsp\src\rm_threadx_port
        C:\Work\firefly\firefly_poller\ra\microsoft\azure-rtos\threadx\common\inc
        C:\Work\firefly\firefly_poller\ra\arm\CMSIS_5\CMSIS\Core\Include
        C:\Work\firefly\firefly_poller\ra_gen
        C:\Work\firefly\firefly_poller\ra_cfg\fsp_cfg\bsp
        C:\Work\firefly\firefly_poller\ra_cfg\fsp_cfg
        C:\Work\firefly\firefly_poller\ra_cfg\fsp_cfg\azure\tx
        C:\Work\firefly\firefly_poller\ra\microsoft\azure-rtos\usbx\common\usbx_device_classes\inc
        C:\Work\firefly\firefly_poller\ra\microsoft\azure-rtos\usbx\common\core\inc
        C:\Work\firefly\firefly_poller\ra\fsp\src\r_usb_basic\src\driver\inc
        C:\Work\firefly\firefly_poller\ra\fsp\src\r_flash_hp
        C:\Work\firefly\firefly_poller\ra\fsp\src\rm_usbx_port
        C:\Renesas\RA\e2studio_v2021-10_fsp_v3.5.0\toolchains\gcc_arm\gcc-arm-none-eabi-10.3-2021.10\lib\gcc\arm-none-eabi\10.3.1\include
        C:\Renesas\RA\e2studio_v2021-10_fsp_v3.5.0\toolchains\gcc_arm\gcc-arm-none-eabi-10.3-2021.10\lib\gcc\arm-none-eabi\10.3.1\include-fixed
        C:\Renesas\RA\e2studio_v2021-10_fsp_v3.5.0\toolchains\gcc_arm\gcc-arm-none-eabi-10.3-2021.10\arm-none-eabi\include
        C:\Work\firefly\firefly_poller\src\contrib\common\utils
        C:\Work\firefly\firefly_poller\src\contrib\common\memoryHandler
    Defines:
        _DEBUG
        _UNICODE
        _RENESAS_RA_
        SEN_PIN_CONNECTION_AVAILABLE
    Standard Version: c17
    IntelliSense Mode: windows-gcc-arm
    Other Flags:
        --gcc
        --gnu_version=100301
Total Memory Usage: 79 MB

------- Workspace parsing diagnostics -------
Number of files discovered (not excluded): 5600
Number of files parsed: 965














textDocument/hover: C:\Work\firefly\firefly_poller\ra\fsp\src\bsp\cmsis\Device\RENESAS\Include\renesas.h (id: 1233)
sending 1 changes to server
cpptools/textEditorSelectionChange
cpptools/activeDocumentChange: C:\Work\firefly\firefly_poller\src\apps\app.c
idle loop: reparsing the active document
Checking for syntax errors: C:\Work\firefly\firefly_poller\src\apps\app.c
Queueing IntelliSense update for files in translation unit of: C:\Work\firefly\firefly_poller\src\apps\app.c
sending 1 changes to server
textDocument/hover: C:\Work\firefly\firefly_poller\src\apps\app.c (id: 1234)
Quick info operation failed: FE: 'Unknown error'
using Tag Parser for quick info
cpptools/finishUpdateSquiggles
Error squiggle count: 8
Update IntelliSense time (sec): 0.533
cpptools/getSemanticTokens: C:\Work\firefly\firefly_poller\src\apps\app.c (id: 1235)
cpptools/getFoldingRanges: C:\Work\firefly\firefly_poller\src\apps\app.c (id: 1236)
cpptools/getCodeActions: C:\Work\firefly\firefly_poller\src\apps\app.c (id: 1237)
textDocument/hover: C:\Work\firefly\firefly_poller\src\apps\app.c (id: 1238)
Quick info operation failed: FE: 'Unknown error'
using Tag Parser for quick info
cpptools/getFoldingRanges: C:\Work\firefly\firefly_poller\ra\fsp\src\bsp\cmsis\Device\RENESAS\Include\renesas.h (id: 1239)
Screenshots

No response

Additional context

No response

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

Riproduci il malfunzionamento con il file di codice sorgente C e l’header renesas.h incluso, quindi esamina le diagnostiche di IntelliSense e gli errori di Quick info mostrati nell’issue. Il lavoro è completato quando il completamento automatico e Quick info continuano a funzionare includendo renesas.h, senza l’errore sconosciuto segnalato.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
c
Ambito
devtools
Tipo di issue
Bug
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Ferma
Chiarezza
Da chiarire
Idoneità per principianti
25/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.