From 641b152373abdc06a14962817e53c81276c263f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Saulius=20Menkevi=C4=8Dius?= Date: Thu, 13 Nov 2025 08:47:44 +0200 Subject: [PATCH 1/2] chore(.github/workflows/test.yaml): run fantomas checks last --- .github/workflows/test.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index a7ccdaa8..621569e8 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -28,11 +28,11 @@ jobs: - name: Restore tools run: dotnet tool restore - - name: Run Fantomas check - run: dotnet fantomas --check . - - name: Run Build run: dotnet build - name: Run Tests run: dotnet test --no-build + + - name: Run Fantomas check + run: dotnet fantomas --check . From 7cff299795b41e3b6e67752c03d861beae17fb10 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Saulius=20Menkevi=C4=8Dius?= Date: Thu, 13 Nov 2025 08:44:27 +0200 Subject: [PATCH 2/2] fix(Tests.Tooling): fix it how RootUri is formed for InitializeParams on Windows --- tests/CSharpLanguageServer.Tests/Tooling.fs | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/tests/CSharpLanguageServer.Tests/Tooling.fs b/tests/CSharpLanguageServer.Tests/Tooling.fs index bd5264c5..37d79394 100644 --- a/tests/CSharpLanguageServer.Tests/Tooling.fs +++ b/tests/CSharpLanguageServer.Tests/Tooling.fs @@ -114,7 +114,6 @@ let makeServerProcessInfo projectTempDir = processStartInfo - type ClientServerRpcRequestInfo = { Method: string RpcRequestMsg: JObject @@ -526,7 +525,6 @@ let processClientEvent (state: ClientState) (post: ClientEvent -> unit) msg : As return state } - let clientEventLoop (initialState: ClientState) (inbox: MailboxProcessor) = let rec loop state = async { let! msg = inbox.Receive() @@ -542,7 +540,6 @@ let clientEventLoop (initialState: ClientState) (inbox: MailboxProcessor string - let rec deleteDirectory (path: string) = if Directory.Exists(path) then Directory.GetFileSystemEntries(path) @@ -602,7 +598,6 @@ let rec deleteDirectory (path: string) = Directory.Delete(path) - type FileController (client: MailboxProcessor, projectDir: string, filename: string, fixtureIsReadOnly: bool) = let mutable fileContents: option = None @@ -614,7 +609,6 @@ type FileController | PlatformID.Win32NT -> ("file:///" + projectDir + "/" + filename).Replace("\\", "/") | _ -> "file://" + projectDir + "/" + filename - interface IDisposable with member this.Dispose() = let didCloseParams: DidCloseTextDocumentParams = @@ -669,7 +663,6 @@ type FileController tes |> Array.rev |> Array.fold applyTextEdit fileContents.Value - type ClientController(client: MailboxProcessor, fixtureName: string, fixtureIsReadOnly: bool) = let mutable projectDir: string option = None let mutable solutionLoaded: bool = false @@ -727,9 +720,11 @@ type ClientController(client: MailboxProcessor, fixtureName: string let state = client.PostAndReply(fun rc -> ServerStartRequest(projectDir.Value, rc)) let initializeParams: InitializeParams = + let rootUri = Uri(projectDir.Value) |> string |> DocumentUri + { RootPath = None + RootUri = Some rootUri ProcessId = (Process.GetCurrentProcess().Id) |> int |> Some - RootUri = (sprintf "file://%s" projectDir.Value) |> Some Capabilities = state.ClientProfile.ClientCapabilities WorkDoneToken = None ClientInfo = None @@ -876,7 +871,6 @@ type ClientController(client: MailboxProcessor, fixtureName: string file.Open() file - let private activateClient (clientProfile: ClientProfile) (fixtureName: string) (readOnlyFixture: bool) = let initialState = { defaultClientState with @@ -888,11 +882,9 @@ let private activateClient (clientProfile: ClientProfile) (fixtureName: string) client.StartAndWaitForSolutionLoad(clientProfile) client - let activeClientsSemaphore = new SemaphoreSlim(Environment.ProcessorCount, Environment.ProcessorCount) - let activateFixture fixtureName = activeClientsSemaphore.Wait() @@ -901,7 +893,6 @@ let activateFixture fixtureName = finally activeClientsSemaphore.Release() |> ignore - module TextEdit = let normalizeNewText (s: TextEdit) = { s with