sublimelsp / LSP-SourceKit

Convenience plugin for Apple's SourceKit language server
MIT License
14 stars 1 forks source link

LSP-SourceKit gets stuck in infinite loop #4

Open genericptr opened 3 years ago

genericptr commented 3 years ago

Describe the bug

Running LSP-SourceKit on an Xcode project fails with an error "could not find manifest, or not a SwiftPM package" and then gets stuck in an infinite loop shutting down and re-initializing. I probably just don't know how to the use the server correctly but LSP shouldn't try to reload in this case.

Example output

::  -> SourceKit initialized: {}
SourceKit: [2021-07-11 12:34:44.319] could not find manifest, or not a SwiftPM package: /Users/ryanjoseph/Desktop/Work/Mimestream
::  -> SourceKit textDocument/didOpen: <params with 111829 characters>
::  -> SourceKit textDocument/didClose: {'textDocument': {'uri': 'file:///Users/ryanjoseph/Desktop/Work/Mimestream/Mimestream/Thread%20Content%20View/ThreadContentViewController.swift'}}
:: --> SourceKit shutdown(2): None
:: --> SourceKit initialize(1): {...}
:: <<< SourceKit 2: {}
::  -> SourceKit exit: None
SourceKit: [2021-07-11 12:34:44.378] could not open compilation database for /Users/ryanjoseph/Desktop/Work/Mimestream/Mimestream/Thread Content View/ThreadContentViewController.swift
rwols commented 3 years ago

You need either a compile_commands.json file or your swift project needs to be built around the swift package manager.

genericptr commented 3 years ago

Yes but the bug is that the plugin gets stuck in an infinite loop. It should of course just fail once and not try again.

rwols commented 3 years ago

You’re right, it shouldn’t get into an init loop.