Commit Graph

5 Commits

Author SHA1 Message Date
Ben Langmuir
f6d7701048 [sourcekitd] Add a registry for sourcekitd instances
Protect ourselves from ever having multiple sourcekitd instances for the
same path live at once, which is not safe.
2020-06-03 14:51:04 -07:00
Ben Langmuir
095ca6c904 [sourcekitd] Switch to TSCBasic's Lock for improved block API 2020-06-03 14:51:04 -07:00
Ben Langmuir
d1a997f3de [sourcekitd] Split sourcekitd into class and protocol
For now, we only have one concrete implementation in sourcekit-lsp
itself, but it is useful for libraries to be able to wrap their own
sourcekitd implementation for example if they have an existing external
use of sourcekitd in C code.
2020-06-03 14:51:04 -07:00
Ben Langmuir
9bb269c1b3 [sourcekitd] Wrap initialization/shutdown and notification handlers
The notification handler and initialize/shutdown APIs all modify global
state within the service, so handle them inside the wrapper to prevent
accidental misuse. Also add support for multiplexing the notification
handler, since it can be useful to have multiple handlers, especially
for global notifications.
2020-06-03 14:51:04 -07:00
Ben Langmuir
f9d26d6bcf [sourcekitd] Move SourceKitD to its own module and lightly refactor 2020-06-03 14:51:03 -07:00