Skip to content

Commit

Permalink
oh
Browse files Browse the repository at this point in the history
  • Loading branch information
razzmatazz committed Nov 3, 2024
1 parent e76e439 commit de25822
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,13 @@

<ItemGroup>
<Compile Include="Tooling.fs" />
<!--
<Compile Include="CodeActionTests.fs" />
<Compile Include="DiagnosticTests.fs" />
<Compile Include="DocumentationTests.fs" />
<Compile Include="HoverTests.fs" />
<Compile Include="InitializationTests.fs" />
-->
<Compile Include="ReferenceTests.fs" />
</ItemGroup>

Expand Down
6 changes: 3 additions & 3 deletions tests/CSharpLanguageServer.Tests/ReferenceTests.fs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ let testReferenceWorks() =

let expectedLocations: Location array =
[|
{ Uri = classFile.Uri
{ Uri = classFile.Uri.Substring(7)
Range = {
Start = { Line = 8u; Character = 8u }
End = { Line = 8u; Character = 15u }
Expand Down Expand Up @@ -122,7 +122,7 @@ public class IndexModel : PageModel
("Project/Pages/_ViewImports.cshtml", viewImportsCshtmlContents)
]

use client = setupServerClient defaultClientProfile projectFiles
use client = setupServerClient { defaultClientProfile with LoggingEnabled = true } projectFiles
client.StartAndWaitForSolutionLoad()

use indexCshtmlCsFile = client.Open("Project/Pages/Index.cshtml.cs")
Expand All @@ -144,7 +144,7 @@ public class IndexModel : PageModel

let expectedLocations: Location array =
[|
{ Uri = indexCshtmlCsContents.Uri
{ Uri = indexCshtmlCsFile.Uri.Substring(7)
Range = {
Start = { Line = 8u; Character = 8u }
End = { Line = 8u; Character = 15u }
Expand Down
7 changes: 7 additions & 0 deletions tests/CSharpLanguageServer.Tests/Tooling.fs
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,8 @@ let processClientEvent (state: ClientState) (post: ClientEvent -> unit) msg : As
let newOutstandingServerRpcReqs =
state.OutstandingServerRpcReqs |> Map.remove rpcCallId

logMessage "ServerRpcCallResult" (string result)

match rpcRequest.ResultReplyChannel with
| Some rc ->
rc.Reply(result["result"])
Expand Down Expand Up @@ -485,7 +487,12 @@ type FileController (client: MailboxProcessor<ClientEvent>, filename: string, ur

member __.Request<'Request, 'Response>(method: string, request: 'Request): 'Response =
let requestJObject = request |> serialize
Console.Error.WriteLine("Request")
let responseJToken = client.PostAndReply<JToken>(fun rc -> SendServerRpcRequest (method, requestJObject, Some rc))
if (responseJToken = null) then
Console.Error.WriteLine("Request: responseJToken=null")
else
Console.Error.WriteLine("Request: responseJToken={0}", responseJToken)
responseJToken |> deserialize<'Response>

member __.DidChange(text: string) =
Expand Down

0 comments on commit de25822

Please # to comment.