-
Notifications
You must be signed in to change notification settings - Fork 156
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Codefix to add private access modifier #1089
Conversation
If it's expensive I would appreciate a config flag like the other 'enabled' flags. Happy to merge this when that's in. |
Yeah it's using Find All References here to determine if it provide the check. While #1088 does make this super quick for smaller repositories, it can still be 5-10 seconds for big ones like |
Great, I'll add a flag then. |
Okay, the flag is added and the counterpart in Ionide is here: ionide/ionide-vscode-fsharp#1858 |
Thanks for this @dawedawe! |
WHAT
🤖 Generated by Copilot at 2a2c771
This pull request refactors some functions in the adaptive F# LSP server, implements a code fix for adding a private access modifier in both LSP servers, and adds a new module for the code fix logic. The code fix helps users avoid exposing unnecessary symbols and follows the F# style guide. The refactoring improves the code structure and avoids circular dependencies.
🤖 Generated by Copilot at 2a2c771
🛠️♻️🚀
WHY
This is the somewhat escalated result of yesterdays Amplify F# session.
As Jimmy pointed out, it might be too expensive to have something like this enabled by default.
But if there is interest in having this behind a config option or maybe in a trimmed down version, I'd be happy to adjust it.
HOW
🤖 Generated by Copilot at 2a2c771
AddPrivateAccessModifier
that implements a code fix for adding a private access modifier to a declaration that is not used outside of its scope (link)getDependentProjectsOfProjects
function to the top of the fileAdaptiveFSharpLspServer.fs
to avoid a circular dependency between thegetDeclarationLocation
and thesymbolUseWorkspace
functions (link)getDeclarationLocation
and thesymbolUseWorkspace
functions to the top of the fileAdaptiveFSharpLspServer.fs
to avoid a circular dependency between them (link)symbolUseWorkspace
to the typeAdaptiveFSharpLspServer
that wraps theCommands.symbolUseWorkspace
function with the specific arguments and functions needed for the adaptive server (link)symbolUseWorkspace
to the typeFSharpLspServer
that wraps thecommands.SymbolUseWorkspace
function with the specific arguments and functions needed for the non-adaptive server (link)FSharpLspServer
(link)