icarus icon indicating copy to clipboard operation
icarus copied to clipboard

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

Open EmranMR opened this issue 2 years ago • 3 comments

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 avatar Sep 27 '23 10:09 EmranMR

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.

logancollins avatar Sep 27 '23 18:09 logancollins

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 avatar Sep 28 '23 00:09 EmranMR

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 avatar Sep 30 '23 20:09 EmranMR