Skip to content
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

remove typechecks from cache on file close #1187

Merged

Conversation

TheAngryByrd
Copy link
Member

@TheAngryByrd TheAngryByrd commented Oct 27, 2023

WHAT

🤖 Generated by Copilot at 9e9131a

This pull request adds a feature to the LSP server to forget documents that are no longer needed by the F# compiler service checker. It introduces a new function RemoveFileFromCache in CompilerServiceInterface.fs and calls it in AdaptiveServerState.fs when a document is closed or deleted.

🤖 Generated by Copilot at 9e9131a

Sing, O Muse, of the clever LSP server, the swift helper of code
That learned to forget the documents of old, when they vanished from the node
By the skill of the FSharpCompilerServiceChecker, the wise and powerful guide
That purged its cache of the useless files, like Zeus hurling thunder from his side

📝🧹🔥

WHY

Memory optimization

HOW

🤖 Generated by Copilot at 9e9131a

  • Add a new function RemoveFileFromCache to the FSharpCompilerServiceChecker type that removes a file path from the checker's internal cache (link,link)
  • Call the RemoveFileFromCache function in the forgetDocument function of the AdaptiveState type to update the LSP server state when a document is closed or deleted (link)
  • Remove an unused open statement for the System.IO namespace from the FsAutoComplete namespace (link)

@TheAngryByrd TheAngryByrd force-pushed the remove-typechecks-from-cache-on-close branch from 9e9131a to 4ac26df Compare October 27, 2023 03:30
@TheAngryByrd TheAngryByrd enabled auto-merge (squash) October 27, 2023 03:33
@TheAngryByrd TheAngryByrd merged commit 2403ad1 into ionide:main Oct 27, 2023
9 checks passed
nojaf pushed a commit to nojaf/FsAutoComplete that referenced this pull request Nov 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant