@@ -2,9 +2,9 @@ import CopilotModel
22import Foundation
33import LanguageClient
44import LanguageServerProtocol
5+ import Logger
56import Preferences
67import XPCShared
7- import Logger
88
99public protocol CopilotAuthServiceType {
1010 func checkStatus( ) async throws -> CopilotStatus
@@ -275,34 +275,34 @@ public final class CopilotSuggestionService: CopilotBaseService, CopilotSuggesti
275275 )
276276 )
277277 }
278-
278+
279279 public func notifyChangeTextDocument( fileURL: URL , content: String ) async throws {
280- let languageId = languageIdentifierFromFileURL ( fileURL)
281280 let uri = " file:// \( fileURL. path) "
282281// Logger.service.debug("Change \(uri)")
283282 try await server. sendNotification (
284- . didOpenTextDocument(
285- DidOpenTextDocumentParams (
286- textDocument: . init(
287- uri: uri,
288- languageId: languageId. rawValue,
289- version: 0 ,
283+ . didChangeTextDocument(
284+ DidChangeTextDocumentParams (
285+ uri: uri,
286+ version: 0 ,
287+ contentChange: . init(
288+ range: nil ,
289+ rangeLength: nil ,
290290 text: content
291291 )
292292 )
293293 )
294294 )
295295 }
296-
296+
297297 public func notifySaveTextDocument( fileURL: URL ) async throws {
298298 let uri = " file:// \( fileURL. path) "
299- Logger . service. debug ( " Save \( uri) " )
299+ // Logger.service.debug("Save \(uri)")
300300 try await server. sendNotification ( . didSaveTextDocument( . init( uri: uri) ) )
301301 }
302-
302+
303303 public func notifyCloseTextDocument( fileURL: URL ) async throws {
304304 let uri = " file:// \( fileURL. path) "
305- Logger . service. debug ( " Close \( uri) " )
305+ // Logger.service.debug("Close \(uri)")
306306 try await server. sendNotification ( . didCloseTextDocument( . init( uri: uri) ) )
307307 }
308308}
@@ -312,4 +312,3 @@ extension InitializingServer: CopilotLSP {
312312 try await sendRequest ( endpoint. request)
313313 }
314314}
315-
0 commit comments