Skip to content

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

Open

Description

@EmranMR

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

Activity

  1. changed the title [-]Extension/LSP crashing after renaming[/-] [+]Extension/LSP crashing after renaming the file[/+] on Sep 27, 2023
  2. logancollins commented on Sep 27, 2023

    @logancollins
    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.

  3. EmranMR commented on Sep 28, 2023

    @EmranMR
    Author

    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
  4. EmranMR commented on Sep 30, 2023

    @EmranMR
    Author

    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 😊
  5. changed the title [-]Extension/LSP crashing after renaming the file[/-] [+]Extension/LSP crashing after renaming and deleting the C family lang files[/+] on Sep 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions