Closed 1eyewonder closed 7 months ago
Closing because I realized I didn't pay attention towards the end of the Amplifying FSharp video. https://github.com/fsharp/FsAutoComplete/pull/1195 already tackles the main function I was refactoring but uses Result instead of Option. For my sanity I am going to close this PR and open a new one with different snippets I found during mind findings in this PR.
WHAT
🤖 Generated by Copilot at da3703a
This pull request refactors the error handling logic in various modules of the FsAutoComplete project to use option types instead of result types and strings for errors. It also adds a new dependency to the
FsToolkit.ErrorHandling
library, which provides some utilities for functional error handling in F#. The main goal of this refactoring is to simplify the code and make it more consistent and expressive. The affected modules includeCommands
,CodeFixes
,AdaptiveFSharpLspServer
, andAdaptiveState
. The affected files includesrc/FsAutoComplete.Core/Commands.fs
,src/FsAutoComplete/CodeFixes.fs
,src/FsAutoComplete/CodeFixes.fsi
,src/FsAutoComplete/CodeFixes/RemoveUnusedOpens.fs
,src/FsAutoComplete/LspServers/AdaptiveFSharpLspServer.fs
,src/FsAutoComplete/LspServers/AdaptiveServerState.fs
,src/FsAutoComplete/LspServers/AdaptiveServerState.fsi
,paket.dependencies
,src/FsAutoComplete.Core/paket.references
,src/FsAutoComplete/CodeFixes/AddPrivateAccessModifier.fs
,src/FsAutoComplete/CodeFixes/AddPrivateAccessModifier.fsi
, andsrc/FsAutoComplete/LspServers/Common.fs
.🤖 Generated by Copilot at da3703a
📦🛠️🚀
WHY
HOW
🤖 Generated by Copilot at da3703a
FsToolkit.ErrorHandling
library (link,link,link,link,link,link,link,link,link,link,link,link,link,link,link,link,link,link,link,link,link,link,link,link,link,link,link,link,link,link,link,link,link,link,link,link,link,link,link,link) in filessrc/FsAutoComplete.Core/Commands.fs
,src/FsAutoComplete/CodeFixes.fs
,src/FsAutoComplete/CodeFixes.fsi
,src/FsAutoComplete/CodeFixes/AddPrivateAccessModifier.fs
,src/FsAutoComplete/CodeFixes/AddPrivateAccessModifier.fsi
,src/FsAutoComplete/CodeFixes/RemoveUnusedOpens.fs
,src/FsAutoComplete/LspServers/AdaptiveFSharpLspServer.fs
,src/FsAutoComplete/LspServers/AdaptiveServerState.fs
, andsrc/FsAutoComplete/LspServers/AdaptiveServerState.fsi
.