From caf26fd38640a14d5878b719ce986bcbf1d7b2e9 Mon Sep 17 00:00:00 2001 From: Jimmy Byrd Date: Thu, 26 Oct 2023 23:48:24 -0400 Subject: [PATCH] Fix code action scaffold (#1188) --- build/ScaffoldCodeFix.fs | 14 +++++++------- docs/Creating a new code fix.md | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/build/ScaffoldCodeFix.fs b/build/ScaffoldCodeFix.fs index 1b7e6cd4b..1e297e8a6 100644 --- a/build/ScaffoldCodeFix.fs +++ b/build/ScaffoldCodeFix.fs @@ -8,12 +8,12 @@ open Fantomas.Core.SyntaxOak let repositoryRoot = __SOURCE_DIRECTORY__ ".." -let AdaptiveFSharpLspServerPath = +let AdaptiveServerStatePath = repositoryRoot "src" "FsAutoComplete" "LspServers" - "AdaptiveFSharpLspServer.fs" + "AdaptiveServerState.fs" let TestsPath = @@ -248,15 +248,15 @@ let findTypeWithNameOfFail (typeName: string) (mn: ModuleOrNamespaceNode) : ITyp | _ -> None) let findArrayInAdaptiveFSharpLspServer () : ExprArrayOrListNode = - let oak = getOakFor AdaptiveFSharpLspServerPath + let oak = getOakFor AdaptiveServerStatePath // namespace FsAutoComplete.Lsp let ns = oak.ModulesOrNamespaces |> List.exactlyOneOrFail "Expected a single namespace in Oak." - // type AdaptiveFSharpLspServer - let t = findTypeWithNameOfFail "AdaptiveFSharpLspServer" ns + // type AdaptiveState + let t = findTypeWithNameOfFail "AdaptiveState" ns // let codefixes = let codefixesValue = @@ -299,12 +299,12 @@ let wireCodeFixInAdaptiveFSharpLspServer codeFixName = try let array = findArrayInAdaptiveFSharpLspServer () - appendItemToArrayOrList $"%s{codeFixName}.fix tryGetParseResultsForFile" AdaptiveFSharpLspServerPath array + appendItemToArrayOrList $"%s{codeFixName}.fix tryGetParseResultsForFile" AdaptiveServerStatePath array with ex -> Trace.traceException ex Trace.traceError - $"Unable to find array of codefixes in %s{AdaptiveFSharpLspServerPath}.\nDid the code structure change?" + $"Unable to find array of codefixes in %s{AdaptiveServerStatePath}.\nDid the code structure change?" let mkCodeFixTests codeFixName = diff --git a/docs/Creating a new code fix.md b/docs/Creating a new code fix.md index 3c43954d3..9e2844286 100644 --- a/docs/Creating a new code fix.md +++ b/docs/Creating a new code fix.md @@ -27,7 +27,7 @@ The above command accomplishes the following tasks: Furthermore, this command updates the following files to properly register the new code fix: -- `src/FsAutoComplete/LspServers/AdaptiveFSharpLspServer.fs` +- `src/FsAutoComplete/LspServers/AdaptiveState.fs` - `test/FsAutoComplete.Tests.Lsp/CodeFixTests/Tests.fs` The unit test file contains a [single focused test](https://github.com/haf/expecto#focusing-tests), allowing you to promptly verify the functionality. To run this initial test, you have two options: