@@ -387,17 +387,17 @@ extension SwiftLanguageService {
387
387
] )
388
388
}
389
389
390
- public func openDocument( _ note : DidOpenTextDocumentNotification ) async {
391
- cancelInFlightPublishDiagnosticsTask ( for: note . textDocument. uri)
392
- await diagnosticReportManager. removeItemsFromCache ( with: note . textDocument. uri)
390
+ public func openDocument( _ notification : DidOpenTextDocumentNotification ) async {
391
+ cancelInFlightPublishDiagnosticsTask ( for: notification . textDocument. uri)
392
+ await diagnosticReportManager. removeItemsFromCache ( with: notification . textDocument. uri)
393
393
394
- guard let snapshot = self . documentManager. open ( note ) else {
394
+ guard let snapshot = self . documentManager. open ( notification ) else {
395
395
// Already logged failure.
396
396
return
397
397
}
398
398
399
399
let buildSettings = await self . buildSettings ( for: snapshot. uri)
400
- if buildSettings == nil || buildSettings!. isFallback, let fileUrl = note . textDocument. uri. fileURL {
400
+ if buildSettings == nil || buildSettings!. isFallback, let fileUrl = notification . textDocument. uri. fileURL {
401
401
// Do not show this notification for non-file URIs to make sure we don't see this notificaiton for newly created
402
402
// files (which get opened as with a `untitled:Unitled-1` URI by VS Code.
403
403
await sourceKitLSPServer? . sendNotificationToClient (
@@ -414,17 +414,17 @@ extension SwiftLanguageService {
414
414
415
415
let req = openDocumentSourcekitdRequest ( snapshot: snapshot, compileCommand: buildSettings)
416
416
_ = try ? await self . sourcekitd. send ( req, fileContents: snapshot. text)
417
- await publishDiagnosticsIfNeeded ( for: note . textDocument. uri)
417
+ await publishDiagnosticsIfNeeded ( for: notification . textDocument. uri)
418
418
}
419
419
420
- public func closeDocument( _ note : DidCloseTextDocumentNotification ) async {
421
- cancelInFlightPublishDiagnosticsTask ( for: note . textDocument. uri)
422
- inFlightPublishDiagnosticsTasks [ note . textDocument. uri] = nil
423
- await diagnosticReportManager. removeItemsFromCache ( with: note . textDocument. uri)
420
+ public func closeDocument( _ notification : DidCloseTextDocumentNotification ) async {
421
+ cancelInFlightPublishDiagnosticsTask ( for: notification . textDocument. uri)
422
+ inFlightPublishDiagnosticsTasks [ notification . textDocument. uri] = nil
423
+ await diagnosticReportManager. removeItemsFromCache ( with: notification . textDocument. uri)
424
424
425
- self . documentManager. close ( note )
425
+ self . documentManager. close ( notification )
426
426
427
- let req = closeDocumentSourcekitdRequest ( uri: note . textDocument. uri)
427
+ let req = closeDocumentSourcekitdRequest ( uri: notification . textDocument. uri)
428
428
_ = try ? await self . sourcekitd. send ( req, fileContents: nil )
429
429
}
430
430
@@ -506,8 +506,8 @@ extension SwiftLanguageService {
506
506
}
507
507
}
508
508
509
- public func changeDocument( _ note : DidChangeTextDocumentNotification ) async {
510
- cancelInFlightPublishDiagnosticsTask ( for: note . textDocument. uri)
509
+ public func changeDocument( _ notification : DidChangeTextDocumentNotification ) async {
510
+ cancelInFlightPublishDiagnosticsTask ( for: notification . textDocument. uri)
511
511
512
512
let keys = self . keys
513
513
struct Edit {
@@ -516,14 +516,14 @@ extension SwiftLanguageService {
516
516
let replacement : String
517
517
}
518
518
519
- guard let ( preEditSnapshot, postEditSnapshot, edits) = self . documentManager. edit ( note ) else {
519
+ guard let ( preEditSnapshot, postEditSnapshot, edits) = self . documentManager. edit ( notification ) else {
520
520
return
521
521
}
522
522
523
523
for edit in edits {
524
524
let req = sourcekitd. dictionary ( [
525
525
keys. request: self . requests. editorReplaceText,
526
- keys. name: note . textDocument. uri. pseudoPath,
526
+ keys. name: notification . textDocument. uri. pseudoPath,
527
527
keys. enableSyntaxMap: 0 ,
528
528
keys. enableStructure: 0 ,
529
529
keys. enableDiagnostics: 0 ,
@@ -553,14 +553,14 @@ extension SwiftLanguageService {
553
553
edits: concurrentEdits
554
554
)
555
555
556
- await publishDiagnosticsIfNeeded ( for: note . textDocument. uri)
556
+ await publishDiagnosticsIfNeeded ( for: notification . textDocument. uri)
557
557
}
558
558
559
- public func willSaveDocument( _ note : WillSaveTextDocumentNotification ) {
559
+ public func willSaveDocument( _ notification : WillSaveTextDocumentNotification ) {
560
560
561
561
}
562
562
563
- public func didSaveDocument( _ note : DidSaveTextDocumentNotification ) {
563
+ public func didSaveDocument( _ notification : DidSaveTextDocumentNotification ) {
564
564
565
565
}
566
566
0 commit comments