mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[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
This commit is contained in:
@@ -112,7 +112,7 @@ static bool swiftCodeCompleteImpl(SwiftLangSupport &Lang,
|
||||
std::string &Error) {
|
||||
|
||||
trace::TracedOperation TracedInit(trace::OperationKind::CodeCompletionInit);
|
||||
if (trace::enabled()) {
|
||||
if (TracedInit.enabled()) {
|
||||
trace::SwiftInvocation SwiftArgs;
|
||||
trace::initTraceInfo(SwiftArgs,
|
||||
UnresolvedInputFile->getBufferIdentifier(),
|
||||
@@ -190,7 +190,7 @@ static bool swiftCodeCompleteImpl(SwiftLangSupport &Lang,
|
||||
|
||||
|
||||
trace::TracedOperation TracedOp(trace::OperationKind::CodeCompletion);
|
||||
if (trace::enabled()) {
|
||||
if (TracedOp.enabled()) {
|
||||
trace::SwiftInvocation SwiftArgs;
|
||||
trace::initTraceInfo(SwiftArgs, InputFile->getBufferIdentifier(), Args);
|
||||
trace::initTraceFiles(SwiftArgs, CI);
|
||||
|
||||
Reference in New Issue
Block a user