@@ -387,17 +387,17 @@ extension SwiftLanguageService {
387387 ] )
388388 }
389389
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)
393393
394- guard let snapshot = self . documentManager. open ( note ) else {
394+ guard let snapshot = self . documentManager. open ( notification ) else {
395395 // Already logged failure.
396396 return
397397 }
398398
399399 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 {
401401 // Do not show this notification for non-file URIs to make sure we don't see this notificaiton for newly created
402402 // files (which get opened as with a `untitled:Unitled-1` URI by VS Code.
403403 await sourceKitLSPServer? . sendNotificationToClient (
@@ -414,17 +414,17 @@ extension SwiftLanguageService {
414414
415415 let req = openDocumentSourcekitdRequest ( snapshot: snapshot, compileCommand: buildSettings)
416416 _ = try ? await self . sourcekitd. send ( req, fileContents: snapshot. text)
417- await publishDiagnosticsIfNeeded ( for: note . textDocument. uri)
417+ await publishDiagnosticsIfNeeded ( for: notification . textDocument. uri)
418418 }
419419
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)
424424
425- self . documentManager. close ( note )
425+ self . documentManager. close ( notification )
426426
427- let req = closeDocumentSourcekitdRequest ( uri: note . textDocument. uri)
427+ let req = closeDocumentSourcekitdRequest ( uri: notification . textDocument. uri)
428428 _ = try ? await self . sourcekitd. send ( req, fileContents: nil )
429429 }
430430
@@ -506,8 +506,8 @@ extension SwiftLanguageService {
506506 }
507507 }
508508
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)
511511
512512 let keys = self . keys
513513 struct Edit {
@@ -516,14 +516,14 @@ extension SwiftLanguageService {
516516 let replacement : String
517517 }
518518
519- guard let ( preEditSnapshot, postEditSnapshot, edits) = self . documentManager. edit ( note ) else {
519+ guard let ( preEditSnapshot, postEditSnapshot, edits) = self . documentManager. edit ( notification ) else {
520520 return
521521 }
522522
523523 for edit in edits {
524524 let req = sourcekitd. dictionary ( [
525525 keys. request: self . requests. editorReplaceText,
526- keys. name: note . textDocument. uri. pseudoPath,
526+ keys. name: notification . textDocument. uri. pseudoPath,
527527 keys. enableSyntaxMap: 0 ,
528528 keys. enableStructure: 0 ,
529529 keys. enableDiagnostics: 0 ,
@@ -553,14 +553,14 @@ extension SwiftLanguageService {
553553 edits: concurrentEdits
554554 )
555555
556- await publishDiagnosticsIfNeeded ( for: note . textDocument. uri)
556+ await publishDiagnosticsIfNeeded ( for: notification . textDocument. uri)
557557 }
558558
559- public func willSaveDocument( _ note : WillSaveTextDocumentNotification ) {
559+ public func willSaveDocument( _ notification : WillSaveTextDocumentNotification ) {
560560
561561 }
562562
563- public func didSaveDocument( _ note : DidSaveTextDocumentNotification ) {
563+ public func didSaveDocument( _ notification : DidSaveTextDocumentNotification ) {
564564
565565 }
566566
0 commit comments