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

Extension/LSP crashing after renaming and deleting the C family lang files #10

Open
EmranMR opened this issue Sep 27, 2023 · 3 comments

Comments

@EmranMR
Copy link

EmranMR commented Sep 27, 2023

Hello,

There is a bug (maybe two see below) with the extension that crashes after renaming a file.

1. The Crash:

To replicate:

  • Create an empty project with test.cpp
  • write some code in there
  • change the file name and you will get an error
  • Now even after restart or turning the extension on and off things work unexpectedly as discussed below.
image

2. Post Crash Issues for example auto importing header files not working.

  • If you already have even a single header file (in bracket) The auto import function works. but if there is no header you will face some issues.. here is how to replicate the issue
  • open a blank .cpp file with just in main() in it. (no header files)
  • change the file name
  • restart the server and you will see when you type std::cout the <iostream> is not added automatically
image
  • Now add a random header like <stdlib.h> try again and you see it finds the std but the auto import is unpredictable unless you manually import the iostream
image image
  • But once you import iostream manually. You can remove and give it a shot and you will see as soon as you type std::cout it just imports them for you.
image
@EmranMR EmranMR changed the title Extension/LSP crashing after renaming Extension/LSP crashing after renaming the file Sep 27, 2023
@logancollins
Copy link
Member

I'm assuming that SourceKit-LSP for you would be coming from Xcode. What version of Xcode is set as your active version? Also, are you on macOS Sonoma? We've had a couple reports that the version shipped with the GM of Xcode 15 might be having crashing issues, but I'm still investigating.

@EmranMR
Copy link
Author

EmranMR commented Sep 28, 2023

The spec for above tests were as it follows:

  • iMac 27inch Intel.
  • Ventura, penultimate version.
  • I do not have xcode installed but I do have "command line tools". The xcode-select version was 2397 for the above.

I just updated to Sonoma. I also updated my "command line tools" to v2399.

The Verdict

  1. The Crash:
  • The renaming of the file still leads to the extension crash as above, requesting a restart. ❌
  1. Post Crash Issues for example auto importing header files not working.
  • This is solved. So after LSP restart the auto import, completion etc all work well ✅

New Bug 🐞 (I think this went unnoticed as I did not restart Nova at the time of raising the issue)

  • So lets say I rename the file, extension crashes, then I press "restart the LSP". All great 👍
  • However When I quit Nova, and reopen, it acts as if Nova has crashed, and requests me to send the report to Panic etc ( Usual App crash procedure). But he app was working fine and I just quit it as per usual 🤔
  • As you can see below, there is nothing to even report. The logs are empty! 🤷
image

@EmranMR
Copy link
Author

EmranMR commented Sep 30, 2023

Further Update:

  • Just a quick update, this seem to be the case when deleting files as well
  1. touch two files in the directory. (e.g .cpp)
  2. Start writing some code in one
  3. delete the one that you are not focused on
  4. Extension will collapse 😊

@EmranMR EmranMR changed the title Extension/LSP crashing after renaming the file Extension/LSP crashing after renaming and deleting the C family lang files Sep 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants