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

sourcekit-lsp client crashes after any run command in Neovim #1739

Open
gmtborges opened this issue Oct 6, 2024 · 8 comments · May be fixed by #1843
Open

sourcekit-lsp client crashes after any run command in Neovim #1739

gmtborges opened this issue Oct 6, 2024 · 8 comments · May be fixed by #1843
Labels
bug Something isn't working

Comments

@gmtborges
Copy link

gmtborges commented Oct 6, 2024

Swift version

Apple Swift version 6.0 (swiftlang-6.0.0.9.10 clang-1600.0.26.2)

Platform

macOS 14.7

Editor

Neovim

Description

When I open a xcworkspace or xcodeproj project in Neovim, sourcekit-lsp loads normally, but if I execute anything like (:Telescope, open explorer, :XcodebuildPicker, ...) it quit with this message:

Client sourcekit quit with exit code 0 and signal 5. Check log for errors: /Users/gustavo/.local/state/nvim/lsp.log

And nothing was logged in the lsp.log. But in Console App there is a sourcekit-lsp crash report.

Steps to Reproduce

  1. Init a project with tuist mkdir MyDemo && cd MyDemo && tuist init --name MyDemo
  2. Generate the xcworkspace tuist generate
  3. Open in Neovim
  4. Await sourcekit-lsp loads (Verify with :LspInfo)
  5. Run any other command (:Telescope, :Ntree)

Logging

log.txt

@gmtborges gmtborges added the bug Something isn't working label Oct 6, 2024
@ahoppen
Copy link
Member

ahoppen commented Oct 8, 2024

Oh, that’s interesting. We’re crashing in

return storage.withUnsafeFileSystemRepresentation {
String(cString: $0!)
}
.

I’m wondering what kind of URI is producing this. Would you be able to enable extended logging as described here, reproduce the issue and attache the log file produced by that?

@gmtborges
Copy link
Author

gmtborges commented Oct 8, 2024

The logs with extented logging enabled
log.txt

BTW this is the project I'm playing with
https://github.com/gmtborges/MyDemo

@ahoppen
Copy link
Member

ahoppen commented Oct 8, 2024

Did you install the profile mentioned in the macOS section of the document I linked and then reproduce the issue? Your new log still shows <private>, which indicates to me that extended logging isn’t enabled.

@gmtborges
Copy link
Author

Oh sorry, I setup the wrong step (.sourcekit-lsp/config.json). Now with the profile activated.
log.txt

@ahoppen
Copy link
Member

ahoppen commented Oct 9, 2024

Thanks for the log. It looks like your editor is sending the a textDocument/documentColor request with the following payload (last couple of lines in the log)

{
  "textDocument" : {
    "uri" : "file://"
  }
}

While SourceKit-LSP shouldn’t crash on this, this indicates that something in neovim or the plugins you have installed in neovim is wrong because it should probably include the file path in the request.

@gmtborges
Copy link
Author

Thank you so much man! I found the plugin that was causing the issue. brenoprata10/nvim-highlight-colors

@ahoppen
Copy link
Member

ahoppen commented Oct 9, 2024

Let’s keep the issue open to make sure SourceKit-LSP doesn’t crash in this case but returns an error.

@ahoppen
Copy link
Member

ahoppen commented Oct 14, 2024

Synced to Apple’s issue tracker as rdar://137886470

ahoppen added a commit to ahoppen/sourcekit-lsp that referenced this issue Nov 22, 2024
@ahoppen ahoppen linked a pull request Nov 22, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants