microsoft / microsoft/vscode-cpptools

How do I fix this problem: "Unable to start the C/C++ language server. IntelliSense features will be disabled. Error: Error: EPERM: operation not permitted, scandir "

Aperta
#11,752 3 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

investigate: repro Language Service
Lingua principale
TypeScript
Stelle
6.2k
Fork
1.7k
Merge medio
14h 46m
PR unite (30g)
61

Descrizione

Environment
  • OS and Version: Windows 11 Pro [Version 10.0.22631.2715]
  • VS Code Version: 1.84
  • C/C++ Extension Version: 1.18.5
  • Local machine
  • Use NTFS file system
Bug Summary and Steps to Reproduce

Bug Summary: I can't start C/C++ language server when I update extension C/C++.

Steps to reproduce:

  1. Go to 'Extensions'
  2. Update extension C/C++.
    Notes: I can use C/C++ language server before updating. The version was 1.16.3 before.
  3. Reload VS Code.
  4. See error: Unable to start the C/C++ language server. IntelliSense features will be disabled. Error: Error: EPERM: operation not permitted, scandir 'f:/System Volume Information'
    Just Like:
    image

Expected behavior: I hope to solve this problem/bug. I tried on other machines but the same problem arose.

Configuration and Logs
c_cpp_properties.json:

{
    "configurations": [
        {
            "name": "Win32",
            "includePath": [
                "${workspaceFolder}/**",
                "D:\\Program Files\\Microsoft Visual Studio\\IDE\\VC\\Tools\\MSVC\\**"
            ],
            "defines": [
                "_DEBUG",
                "UNICODE",
                "_UNICODE"
            ],
            "windowsSdkVersion": "10.0.22000.0",
            "compilerPath": "D:/Program Files/Microsoft Visual Studio/IDE/VC/Tools/MSVC/14.34.31933/bin/Hostx64/x64/cl.exe",
            "cStandard": "c17",
            "cppStandard": "c++14",
            "intelliSenseMode": "windows-msvc-x64"
        },
        {
            "name": "c++",
            "includePath": [
                "${workspaceFolder}/**",
                "D:/Program Files/GCC/mingw32/**"
            ],
            "defines": [
                "_DEBUG",
                "UNICODE",
                "_UNICODE"
            ],
            "windowsSdkVersion": "10.0.22000.0",
            "compilerPath": "D:/Program Files/GCC/mingw32/bin/c++.exe",
            "cStandard": "c17",
            "cppStandard": "c++14",
            "intelliSenseMode": "windows-gcc-x64"
        },
        {
            "name": "g++",
            "includePath": [
                "${workspaceFolder}/**",
                "D:/Program Files/Dev-Cpp/MinGW32/**",
                "D:/Program Files/Dev-Cpp/MinGW32/include"
            ],
            "defines": [
                "_DEBUG",
                "UNICODE",
                "_UNICODE"
            ],
            "windowsSdkVersion": "10.0.22000.0",
            "compilerPath": "D:/Program Files/GCC/mingw32/bin/g++.exe",
            "cStandard": "c17",
            "cppStandard": "c++14",
            "intelliSenseMode": "windows-gcc-x64"
        },
        {
            "name": "Linux",
            "includePath": [
                "${workspaceFolder}/**",
                "/usr**"
            ],
            "defines": [],
            "compilerPath": "/usr/bin/gcc",
            "cStandard": "c17",
            "cppStandard": "c++17",
            "intelliSenseMode": "linux-gcc-x64"
        }
    ],
    "version": 4
}


the language server logging:

loggingLevel: Debug
LSP: (received) cpptools/initialize (id: 1)
LSP: (invoked) cpptools/initialize (id: 1)
cpptools version (TypeScript): 1.18.5
cpptools version (native): 1.18.3.0
Autocomplete is enabled.
Error squiggles are enabled.
Hover is enabled.
IntelliSense Engine = default.
LSP: Message ignored due to no registered handler: $/setTrace
LSP: (received) cpptools/queryCompilerDefaults (id: 2)
LSP: (invoked) cpptools/queryCompilerDefaults (id: 2)
LSP: (received - deferred) textDocument/didOpen: file:///f%3A/C%2B%2B/Code/C%2B%2B-GUI/Win32%20APP/Controls/main.cpp
Querying compiler for default C++ language standard using command line: "D:/Program Files/GCC/mingw32/bin/g++.exe" -x c++ -E -dM nul
LSP: (received) cpptools/didChangeSettings
LSP: (received) cpptools/didChangeSettings
LSP: (received - deferred) cpptools/activeDocumentChange: file:///f%3A/C%2B%2B/Code/C%2B%2B-GUI/Win32%20APP/Controls/main.cpp
LSP: (received - deferred) cpptools/textEditorSelectionChange
LSP: (received - deferred) cpptools/getCodeActions: file:///f%3A/C%2B%2B/Code/C%2B%2B-GUI/Win32%20APP/Controls/main.cpp (id: 3)
Detected language standard version: gnu++14
Querying compiler's default target using command line: "D:/Program Files/GCC/mingw32/bin/g++.exe" -dumpmachine
Compiler returned default target value: i686-w64-mingw32
Compiler query command line: "D:/Program Files/GCC/mingw32/bin/g++.exe" -std=c17 -m32 -Wp,-v -E -dM -x c nul
LSP: $/cancelRequest (cpptools/getCodeActions, id: 3)
LSP: (received - deferred) cpptools/getCodeActions: file:///f%3A/C%2B%2B/Code/C%2B%2B-GUI/Win32%20APP/Controls/main.cpp (id: 4)
LSP: $/cancelRequest (cpptools/getCodeActions, id: 4)
LSP: (received - deferred) cpptools/getCodeActions: file:///f%3A/C%2B%2B/Code/C%2B%2B-GUI/Win32%20APP/Controls/main.cpp (id: 5)
LSP: $/cancelRequest (cpptools/getCodeActions, id: 5)
LSP: (received - deferred) cpptools/getCodeActions: file:///f%3A/C%2B%2B/Code/C%2B%2B-GUI/Win32%20APP/Controls/main.cpp (id: 6)
Attempting to get defaults from C compiler in "compilerPath" property: 'D:/Program Files/GCC/mingw32/bin/g++.exe'
Compiler query command line: "D:/Program Files/GCC/mingw32/bin/g++.exe" -std=gnu++14 -m32 -Wp,-v -E -dM -x c++ nul
Attempting to get defaults from C++ compiler in "compilerPath" property: 'D:/Program Files/GCC/mingw32/bin/g++.exe'
LSP: (invoked) cpptools/didChangeSettings
Autocomplete is enabled.
Error squiggles are enabled.
Hover is enabled.
IntelliSense Engine = default.
Enhanced Colorization is enabled.
LSP: (invoked) cpptools/didChangeSettings
Autocomplete is enabled.
Error squiggles are enabled.
Hover is enabled.
IntelliSense Engine = default.
Enhanced Colorization is enabled.
LSP: Message ignored due to no registered handler: $/setTrace
LSP: (received) cpptools/didChangeSettings
LSP: (invoked) cpptools/didChangeSettings
Autocomplete is enabled.
Error squiggles are enabled.
Hover is enabled.
IntelliSense Engine = default.
Enhanced Colorization is enabled.
LSP: Message ignored due to no registered handler: $/setTrace
LSP: (received) cpptools/didChangeSettings
LSP: (invoked) cpptools/didChangeSettings
Autocomplete is enabled.
Error squiggles are enabled.
Hover is enabled.
IntelliSense Engine = default.
Enhanced Colorization is enabled.
LSP: $/cancelRequest (cpptools/getCodeActions, id: 6)
LSP: (received - deferred) cpptools/getCodeActions: file:///f%3A/C%2B%2B/Code/C%2B%2B-GUI/Win32%20APP/Controls/main.cpp (id: 7)
LSP: $/cancelRequest (cpptools/getCodeActions, id: 7)
LSP: (received - deferred) cpptools/getCodeActions: file:///f%3A/C%2B%2B/Code/C%2B%2B-GUI/Win32%20APP/Controls/main.cpp (id: 8)
LSP: (received - deferred) cpptools/activeDocumentChange: file:///f%3A/C%2B%2B/Code/C%2B%2B-GUI/Win32%20APP/Controls/main.cpp
LSP: (received - deferred) cpptools/textEditorSelectionChange
Other Extensions

You can see what extensions I installed in the image below.
image
image
image
I tried to disable other extensions except C/C++, C/C++ Extension Pack, but the problem still arose.

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

Inizia dal percorso di avvio del server del linguaggio C/C++, usando il c_cpp_properties.json segnalato e i log di debug per riprodurre la scansione EPERM di f:/System Volume Information in Windows 11. Il lavoro è completato quando il server del linguaggio si avvia e IntelliSense rimane disponibile dopo l’aggiornamento dell’estensione, senza l’errore di autorizzazione.

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

Valutazione

Stack tecnologico
cpp, typescript
Ambito
developer-experience, tooling
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.