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