Extension/LSP crashing after renaming and deleting the C family lang files
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.
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
.cppfile with justin main()in it. (no header files) -
change the file name
-
restart the server and you will see when you type
std::coutthe<iostream>is not added automatically -
Now add a random header like
<stdlib.h>try again and you see it finds thestdbut the auto import is unpredictable unless you manually import theiostream -
But once you import
iostreammanually. You can remove and give it a shot and you will see as soon as you typestd::coutit just imports them for you.
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.
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-selectversion was2397for the above.
I just updated to Sonoma. I also updated my "command line tools" to v2399.
The Verdict
- The Crash:
- The renaming of the file still leads to the extension crash as above, requesting a restart. ❌
- 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! 🤷
Further Update:
- Just a quick update, this seem to be the case when deleting files as well
- touch two files in the directory. (e.g
.cpp) - Start writing some code in one
- delete the one that you are not focused on
- Extension will collapse 😊