Skip to content

Surface Additional Parameter Documentation/Tooltips - #2222

Merged
Andy Jordan (andyleejordan) merged 6 commits into
mainfrom
feature/addDocumentationNotes
Mar 4, 2025
Merged

Andy Jordan (andyleejordan) merged 6 commits into
mainfrom
feature/addDocumentationNotes

Conversation

@JustinGrote

@JustinGrote Justin Grote (JustinGrote) commented Feb 28, 2025 •

Copy link
Copy Markdown
Collaborator

Fixes an issue in type parsing where, if a type is discovered, additional documentation gets trimmed off. This restores that to the Documentation field.

I did a little experimenting with the new LabelDetail fields in LSP 3.17, but at least in vscode there was little to no visual advantage, something to maybe explore more later.

Would be nice to not have to text parse a string like this but it's where we are at currently with PS API

Related: PowerShell/PowerShell#25108
image

Related: PowerShell/PowerShell#25112
image

  • Needs Tests

@JustinGrote
Justin Grote (JustinGrote) marked this pull request as ready for review March 2, 2025 06:17
Copilot AI review requested due to automatic review settings March 2, 2025 06:17

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR Overview

This PR surfaces additional parameter documentation in completion tooltips by enhancing type extraction logic and updating completion items.

  • Updated TryExtractType to also extract documentation and adjusted completion item creation accordingly.
  • Added tests for verifying both type and documentation extraction and refactored symbol assertions for improved clarity.

Reviewed Changes

File Description
src/PowerShellEditorServices/Services/TextDocument/Handlers/CompletionHandler.cs Updated TryExtractType signature and its usage to extract and populate documentation for parameter and variable completion items.
test/PowerShellEditorServices.Test/Language/CompletionHandlerTests.cs Added tests to validate type and documentation extraction from tooltip text.
test/PowerShellEditorServices.Test/Language/SymbolsServiceTests.cs Refactored symbol assertions to use Assert.Single with predicate lambdas for concise filtering.

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

@JustinGrote

Copy link
Copy Markdown
Collaborator Author

Andy Jordan (@andyleejordan) ready for review. Won't really do anything until this stuff gets populated on the PS side, but it does fix some tests and lints as well.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Amazing, thanks.

@andyleejordan
Andy Jordan (andyleejordan) deleted the feature/addDocumentationNotes branch March 4, 2025 19:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area-CodeLens Issue-Enhancement A feature request (enhancement).

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants