@@ -134,7 +134,33 @@ public let builtinNotifications: [NotificationType.Type] = [
134134
135135extension MessageRegistry {
136136 public static let lspProtocol : MessageRegistry =
137- MessageRegistry ( requests: builtinRequests, notifications: builtinNotifications)
137+ MessageRegistry ( requests: builtinRequests, notifications: builtinNotifications, legacyNames: lspLegacyNames)
138+
139+ /// Maps current `sourcekit/`-prefixed method names to the legacy names used before the prefix
140+ /// migration. Consumed by `MessageRegistry` (incoming routing) and `LegacyNameFallbackConnection`
141+ /// (outgoing retries).
142+ ///
143+ /// This table is frozen. Do not add new entries for newly introduced methods.
144+ public static let lspLegacyNames : [ String : String ] = [
145+ DidChangeActiveDocumentNotification . method: " window/didChangeActiveDocument " ,
146+ DoccDocumentationRequest . method: " textDocument/doccDocumentation " ,
147+ DocumentTestsRequest . method: " textDocument/tests " ,
148+ GetReferenceDocumentRequest . method: " workspace/getReferenceDocument " ,
149+ IsIndexingRequest . method: " sourceKit/_isIndexing " ,
150+ OutputPathsRequest . method: " workspace/_outputPaths " ,
151+ PeekDocumentsRequest . method: " workspace/peekDocuments " ,
152+ SetOptionsRequest . method: " workspace/_setOptions " ,
153+ SourceKitOptionsRequest . method: " workspace/_sourceKitOptions " ,
154+ SynchronizeRequest . method: " workspace/synchronize " ,
155+ TriggerReindexRequest . method: " workspace/triggerReindex " ,
156+ WorkspacePlaygroundsRefreshRequest . method: " workspace/playgrounds/refresh " ,
157+ WorkspacePlaygroundsRequest . method: " workspace/playgrounds " ,
158+ WorkspaceTestsRefreshRequest . method: " workspace/tests/refresh " ,
159+ WorkspaceTestsRequest . method: " workspace/tests " ,
160+ ]
161+ #if compiler(>=6.7)
162+ #warning("Remove the legacy method names")
163+ #endif
138164}
139165
140166// MARK: Miscellaneous Message Types
0 commit comments