Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IntelliSense stuck at 'loading...' .A crash of the IntelliSense process was detected. #9526

Closed
li0o opened this issue Jun 30, 2022 · 7 comments
Assignees
Labels
bug embedded Language Service more info needed The issue report is not actionable in its current state reliability

Comments

@li0o
Copy link

li0o commented Jun 30, 2022

Bug type: Language Service

Describe the bug

  • OS and Version: Windows 11_22000.739
  • VS Code Version: 1.69.0-insider (user setup)
  • C/C++ Extension Version: v1.10.7
  • Other extensions (and the issue persists after disabling them): PlatformIO IDE v2.5.0
  • Single project

Steps to reproduce

  1. New PIO project (STM32_Arduino)
  2. Open './src./main.cpp'
  3. '#include <Arduino.h>'
  4. '#include <HardwareSerial.h>'
  5. Click 'Arduino.h' Go to Definition(F12)
  6. Back
  7. Click 'HardwareSerial.h' Go to Definition(F12)
  8. Back
  9. Click 'Arduino.h' Go to Definition(F12)
  10. Back
  11. Click 'HardwareSerial.h' Go to Definition(F12)
  12. Back
  13. Click 'Arduino.h' Go to Definition(F12)
  14. Back ..........
  15. .................. (Multiple attempts)
  16. See 'Loading...'

Code sample and logs

  • Code sample
    #include <Arduino.h>
    #include <HardwareSerial.h>
    HardwareSerial URT1(USART1);
    void setup() {}
    void loop() {}

  • Configurations in c_cpp_properties.json
    c_cpp_properties.zip

  • Logs from running C/C++: Log Diagnostics from the VS Code command palette
    C++ Log Diagnostics.log

  • Logs from [the language server logging]
    C++ Log.log

Screenshots
gif

@sean-mcmanus sean-mcmanus self-assigned this Jun 30, 2022
@sean-mcmanus
Copy link
Collaborator

Thanks for reporting this. I think we'll be able to investigate it tomorrow.

@sean-mcmanus sean-mcmanus added bug Language Service reliability embedded more info needed The issue report is not actionable in its current state labels Jul 1, 2022
@sean-mcmanus
Copy link
Collaborator

@li0o I'm unable to locate "STM32_Arduino" -- how do I get that project?

@li0o
Copy link
Author

li0o commented Jul 2, 2022

@li0o I'm unable to locate "STM32_Arduino" -- how do I get that project?

@sean-mcmanus
This is the project I am using.
Board: STM32F103xx
Framework: Arduino

( Bug seems to only with STM32+Arduino.
I will also give feedback to PlatformIO. )
2022-07-02 145935

@sean-mcmanus sean-mcmanus removed the more info needed The issue report is not actionable in its current state label Jul 5, 2022
@sean-mcmanus
Copy link
Collaborator

The root bug appears to be that the headers are not getting associated with the main.cpp. Can you try running the C/C++: Reset IntelliSense Database command and wait for the database icon to go away (finish parsing)? You want to make sure "--header_only_fallback" doesn't appear in the logging when you do a go to def on a header (ideally our extension should check for this and remap the header to the source file).

@sean-mcmanus sean-mcmanus added the more info needed The issue report is not actionable in its current state label Jul 5, 2022
@li0o
Copy link
Author

li0o commented Jul 6, 2022

The root bug appears to be that the headers are not getting associated with the main.cpp. Can you try running the C/C++: Reset IntelliSense Database command and wait for the database icon to go away (finish parsing)? You want to make sure "--header_only_fallback" doesn't appear in the logging when you do a go to def on a header (ideally our extension should check for this and remap the header to the source file).

@sean-mcmanus
Sorry,I'm a C++ beginner and don't really understand what you're saying. But the problem seems to have disappeared after I rolled back 'C/C++ Extension' to v1.1.3. The problem started with v1.2.0.
I repackaged Log and Project and there seems to be no problem except for crashes.
Project.zip
c++.log

@sean-mcmanus
Copy link
Collaborator

I mean to run "C/C++: Reset IntelliSense Database" from the VS Code View->Command Palette menu item.

Also, when you run "C/C++: Log Diagnostics" you want to see:

Translation Unit Mappings:
[ C:\Users\user\Documents\PlatformIO\Projects\projectName\src\main.cpp ]:
C:\Users\user\Documents\PlatformIO\Projects\projectName\src\main.cpp
C:\Users\user.platformio\packages\framework-arduinoststm32\cores\arduino\HardwareSerial.h *

Your previous logging showed HardwareSerial.h having a different mapping separate from main.cpp. The incorrect mapping could be triggering the crash.

v.1.1.3 is over a year old and not recommended, although if necessary, you could use that as a workaround.

@li0o
Copy link
Author

li0o commented Jul 7, 2022

I mean to run "C/C++: Reset IntelliSense Database" from the VS Code View->Command Palette menu item.

Also, when you run "C/C++: Log Diagnostics" you want to see:

Translation Unit Mappings: [ C:\Users\user\Documents\PlatformIO\Projects\projectName\src\main.cpp ]: C:\Users\user\Documents\PlatformIO\Projects\projectName\src\main.cpp C:\Users\user.platformio\packages\framework-arduinoststm32\cores\arduino\HardwareSerial.h *

Your previous logging showed HardwareSerial.h having a different mapping separate from main.cpp. The incorrect mapping could be triggering the crash.

v.1.1.3 is over a year old and not recommended, although if necessary, you could use that as a workaround.

@sean-mcmanus

Okay.

The "Reset IntelliSense Database" did not solve my problem.

I've created various STM32+Arduino projects and still get "Translation Unit Mappings: [main.cpp]". but ESP32+Arduino has no problem.
It seems that the problem lies in PlatformIO or my coding method, and I can't solve it yet, so I can only leave the version at v1.1.3 for now.

Thank you for your reply.

@li0o li0o closed this as completed Jul 7, 2022
@github-actions github-actions bot locked and limited conversation to collaborators Aug 21, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug embedded Language Service more info needed The issue report is not actionable in its current state reliability
Projects
None yet
Development

No branches or pull requests

2 participants