@@ -392,17 +392,17 @@ extension SwiftLanguageService {
392392 ] )
393393 }
394394
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)
398398
399- guard let snapshot = self . documentManager. open ( note ) else {
399+ guard let snapshot = self . documentManager. open ( notification ) else {
400400 // Already logged failure.
401401 return
402402 }
403403
404404 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 {
406406 // Do not show this notification for non-file URIs to make sure we don't see this notificaiton for newly created
407407 // files (which get opened as with a `untitled:Unitled-1` URI by VS Code.
408408 sourceKitLSPServer? . sendNotificationToClient (
@@ -419,17 +419,17 @@ extension SwiftLanguageService {
419419
420420 let req = openDocumentSourcekitdRequest ( snapshot: snapshot, compileCommand: buildSettings)
421421 _ = try ? await self . sourcekitd. send ( req, fileContents: snapshot. text)
422- await publishDiagnosticsIfNeeded ( for: note . textDocument. uri)
422+ await publishDiagnosticsIfNeeded ( for: notification . textDocument. uri)
423423 }
424424
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)
429429
430- self . documentManager. close ( note )
430+ self . documentManager. close ( notification )
431431
432- let req = closeDocumentSourcekitdRequest ( uri: note . textDocument. uri)
432+ let req = closeDocumentSourcekitdRequest ( uri: notification . textDocument. uri)
433433 _ = try ? await self . sourcekitd. send ( req, fileContents: nil )
434434 }
435435
@@ -511,8 +511,8 @@ extension SwiftLanguageService {
511511 }
512512 }
513513
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)
516516
517517 let keys = self . keys
518518 struct Edit {
@@ -521,14 +521,14 @@ extension SwiftLanguageService {
521521 let replacement : String
522522 }
523523
524- guard let ( preEditSnapshot, postEditSnapshot, edits) = self . documentManager. edit ( note ) else {
524+ guard let ( preEditSnapshot, postEditSnapshot, edits) = self . documentManager. edit ( notification ) else {
525525 return
526526 }
527527
528528 for edit in edits {
529529 let req = sourcekitd. dictionary ( [
530530 keys. request: self . requests. editorReplaceText,
531- keys. name: note . textDocument. uri. pseudoPath,
531+ keys. name: notification . textDocument. uri. pseudoPath,
532532 keys. enableSyntaxMap: 0 ,
533533 keys. enableStructure: 0 ,
534534 keys. enableDiagnostics: 0 ,
@@ -558,14 +558,14 @@ extension SwiftLanguageService {
558558 edits: concurrentEdits
559559 )
560560
561- await publishDiagnosticsIfNeeded ( for: note . textDocument. uri)
561+ await publishDiagnosticsIfNeeded ( for: notification . textDocument. uri)
562562 }
563563
564- public func willSaveDocument( _ note : WillSaveTextDocumentNotification ) {
564+ public func willSaveDocument( _ notification : WillSaveTextDocumentNotification ) {
565565
566566 }
567567
568- public func didSaveDocument( _ note : DidSaveTextDocumentNotification ) {
568+ public func didSaveDocument( _ notification : DidSaveTextDocumentNotification ) {
569569
570570 }
571571
0 commit comments