File tree Expand file tree Collapse file tree 2 files changed +14
-14
lines changed Expand file tree Collapse file tree 2 files changed +14
-14
lines changed Original file line number Diff line number Diff line change @@ -109,16 +109,26 @@ module Workspace =
109109 ( context : ServerRequestContext )
110110 ( p : DidChangeWatchedFilesParams )
111111 : Async < LspResult < unit >> =
112+
113+ let windowShowMessage ( m : string ) =
114+ match context.State.LspClient with
115+ | Some lspClient ->
116+ lspClient.WindowShowMessage(
117+ { Type = MessageType.Info
118+ Message = sprintf " csharp-ls: %s " m }
119+ )
120+ | None -> async.Return()
121+
112122 async {
113123 for change in p.Changes do
114124 match Path.GetExtension( change.Uri) with
115125 | " .csproj" ->
116- do ! context.WindowShowMessage " change to .csproj detected, will reload solution"
126+ do ! windowShowMessage " change to .csproj detected, will reload solution"
117127 context.Emit( WorkspaceReloadRequested( TimeSpan.FromSeconds( 5: int64 )))
118128
119129 | " .sln"
120130 | " .slnx" ->
121- do ! context.WindowShowMessage " change to .sln detected, will reload solution"
131+ do ! windowShowMessage " change to .sln detected, will reload solution"
122132 context.Emit( WorkspaceReloadRequested( TimeSpan.FromSeconds( 5: int64 )))
123133
124134 | " .cs" ->
Original file line number Diff line number Diff line change @@ -8,22 +8,12 @@ open CSharpLanguageServer.State.ServerState
88open CSharpLanguageServer.Roslyn .Conversions
99open CSharpLanguageServer.Lsp .Workspace
1010
11- type ServerRequestContext ( requestId : int , state : ServerState , emitServerEvent : ServerStateEvent -> unit ) =
11+ type ServerRequestContext ( requestId : int , state : ServerState , emit : ServerStateEvent -> unit ) =
1212 member _.RequestId = requestId
1313 member _.State = state
1414 member _.Workspace = state.Workspace
1515 member _.ClientCapabilities = state.ClientCapabilities
16-
17- member _.WindowShowMessage ( m : string ) =
18- match state.LspClient with
19- | Some lspClient ->
20- lspClient.WindowShowMessage(
21- { Type = MessageType.Info
22- Message = sprintf " csharp-ls: %s " m }
23- )
24- | None -> async.Return()
25-
26- member _.Emit ev = emitServerEvent ev
16+ member _.Emit = emit
2717
2818 member this.ResolveSymbolLocations
2919 ( symbol : Microsoft.CodeAnalysis.ISymbol )
You can’t perform that action at this time.
0 commit comments