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

call the GenerateXmlDocumentation Command from a CodeFix #1094

Merged
merged 2 commits into from
Apr 15, 2023

Conversation

dawedawe
Copy link
Contributor

@dawedawe dawedawe commented Apr 1, 2023

WHAT

🤖 Generated by Copilot at 5d7aa48

This pull request adds a new code fix for generating XML documentation comments for F# elements that lack them. It defines a new module GenerateXmlDocumentation that implements the logic for the code fix, and registers it with the two types of language servers that FsAutoComplete supports: AdaptiveFSharpLspServer and FSharpLspServer. It also adds tests for the code fix in the test/FsAutoComplete.Tests.Lsp/CodeFixTests/Tests.fs file.

🤖 Generated by Copilot at 5d7aa48

GenerateXmlDocumentation
A code fix for F# elements
Autumn leaves of code

📝🔧🧪

WHY

As discussed on discord: This adds a codefix that calls the GenerateXmlDocumentation Command. Contrary to the command, the codefix is only applicable if there is not already xml documentation present.

There are two things the command could be improved on:

  • Don't add xml doc lines if there are already some doc lines present.
  • Work on all possible AST elements, not just the ones for which we get a result from TryGetSignatureData.

If there is interest in that, I could improve the command in a separate PR.

HOW

🤖 Generated by Copilot at 5d7aa48

  • Add a new module GenerateXmlDocumentation that defines a code fix for generating placeholder XML documentation for F# elements that lack it (link)
  • Extend the AdaptiveFSharpLspServer and FSharpLspServer types to handle the GenerateXmlDocumentation code fix (link, link)
  • Add a new set of tests for the GenerateXmlDocumentation code fix in the module FsAutoComplete.Tests.CodeFixTests.Tests (link)
  • Include the generateXmlDocumentationTests function in the entry point for running all the code fix tests (link)

@baronfel
Copy link
Contributor

Oh we should have merged this a while ago - thanks @dawedawe!

@baronfel baronfel merged commit 753dffe into ionide:main Apr 15, 2023
@dawedawe dawedawe deleted the generatexmldoc_codefix branch April 15, 2023 17:12
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.

2 participants