Commit Graph

6 Commits

Author SHA1 Message Date
Ben Langmuir
a88c73fe60 [sourcekit] Fix non-deterministic failure in CompileNotifications tests
This is a test-only change except for the introduction of a new request
that is only used by tests.

Our notifications are dispatched in the XPC event handler, which is not
synchronized with replies to explicit XPC send_message_with_reply calls.
This is fine for most users of sourcekitd, since the notifications are
already enqueued on the client side, but for testing we need a way to
guarantee that all notifications are passed to the client-side handler
before we exit. This commit introduces a new request for testing that
triggers a notification, allowing the client to wait on that
notification to ensure all previously posted notifications have been
handled.

Note: the non-deterministic test failures can be triggered by adding a
sleep of ~100 ms in the event handler before the notification is
dispatched to the main queue.

rdar://40311995
2018-06-13 11:32:18 -07:00
Ben Langmuir
23ab43c941 [sourcekitd] Change compile notifications to pass a single args string
... instead of an array of compiler arguments. This is good enough
for seeing what's going on, and it saves significant time for long
argument strings, because it doesn't create and destroy so many
xpc strings, and more of the string copying that happens is on a large
contiguous string instead of many small strings.

rdar://39538847
2018-04-19 13:59:27 -07:00
Ben Langmuir
e08c31759e [sourcekit] Remove dead UID value
This was renamed at some point and the usage in complete-test has become
dead anyway, so clean it up.
2018-04-13 13:49:57 -07:00
Ben Langmuir
79d641d89b [sourcekit] Add optional compile notifications
When enabled, send a notification before/after every "compilation",
which for now means `performSema`. This piggy-backs and modifies some
existing code that we had for "tracing" operations in sourcekitd that
unfortunately was untested.  At least now some of the basic parts are
tested via the new notifications.

Part of rdar://38438512
2018-03-29 14:59:30 -07:00
John Fairhurst
677491fc9b [SourceKit] Add syntaxtype for #error/#warning (#14742) 2018-02-21 14:48:18 -08:00
Xi Ge
69bbf2ba71 sourcekitd: using gyb to generate UIDs instead of a def file. NFC (#14549)
Inspired by the infrastructure of SwiftSyntax, a gyb file can facilitate
cross-language sharing.
2018-02-12 22:48:54 -08:00