@@ -22,8 +22,6 @@ type ServerRequestMode =
2222 | ReadOnly
2323 | ReadWrite
2424
25- type ServerOpenDocInfo = { Version: int ; Touched: DateTime }
26-
2725type RequestMetrics =
2826 { Count: int
2927 TotalDuration: TimeSpan
@@ -53,7 +51,6 @@ and ServerState =
5351 LspClient: ILspClient option
5452 ClientCapabilities: ClientCapabilities
5553 Workspace: LspWorkspace
56- OpenDocs: Map < string , ServerOpenDocInfo >
5754 LastRequestId: int
5855 PendingRequests: ServerRequest list
5956 RunningRequests: Map < int , ServerRequest >
@@ -68,7 +65,6 @@ and ServerState =
6865 LspClient = None
6966 ClientCapabilities = emptyClientCapabilities
7067 Workspace = LspWorkspace.Empty
71- OpenDocs = Map.empty
7268 LastRequestId = 0
7369 PendingRequests = []
7470 RunningRequests = Map.empty
@@ -348,32 +344,35 @@ let processServerEvent (logger: ILogger) state postSelf msg : Async<ServerState>
348344 postSelf PushDiagnosticsDocumentBacklogUpdate
349345
350346 let openDocInfo = { Version = ver; Touched = timestamp }
351- let newOpenDocs = state.OpenDocs |> Map.add uri openDocInfo
352- return { state with OpenDocs = newOpenDocs }
347+ let newOpenDocs = state.Workspace.OpenDocs |> Map.add uri openDocInfo
348+
349+ return
350+ { state with
351+ Workspace.OpenDocs = newOpenDocs }
353352
354353 | DocumentClosed uri ->
355354 postSelf PushDiagnosticsDocumentBacklogUpdate
356355
357- let newOpenDocVersions = state.OpenDocs |> Map.remove uri
356+ let newOpenDocVersions = state.Workspace. OpenDocs |> Map.remove uri
358357
359358 return
360359 { state with
361- OpenDocs = newOpenDocVersions }
360+ Workspace. OpenDocs = newOpenDocVersions }
362361
363362 | DocumentTouched( uri, timestamp) ->
364363 postSelf PushDiagnosticsDocumentBacklogUpdate
365364
366- let openDocInfo = state.OpenDocs |> Map.tryFind uri
365+ let openDocInfo = state.Workspace. OpenDocs |> Map.tryFind uri
367366
368367 match openDocInfo with
369368 | None -> return state
370369 | Some openDocInfo ->
371370 let updatedOpenDocInfo = { openDocInfo with Touched = timestamp }
372- let newOpenDocVersions = state.OpenDocs |> Map.add uri updatedOpenDocInfo
371+ let newOpenDocVersions = state.Workspace. OpenDocs |> Map.add uri updatedOpenDocInfo
373372
374373 return
375374 { state with
376- OpenDocs = newOpenDocVersions }
375+ Workspace. OpenDocs = newOpenDocVersions }
377376
378377 | WorkspaceReloadRequested reloadNoLaterThanIn ->
379378 // we need to wait a bit before starting this so we
@@ -398,7 +397,7 @@ let processServerEvent (logger: ILogger) state postSelf msg : Async<ServerState>
398397 // which will consider documents by their last modification date
399398 // for processing first
400399 let newBacklog =
401- state.OpenDocs
400+ state.Workspace. OpenDocs
402401 |> Seq.sortByDescending ( fun kv -> kv.Value.Touched)
403402 |> Seq.map ( fun kv -> kv.Key)
404403 |> List.ofSeq
0 commit comments