Skip to content

Surface Additional Parameter Documentation/Tooltips #2222

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

Merged
merged 6 commits into from
Mar 4, 2025

Conversation

JustinGrote
Copy link
Collaborator

@JustinGrote JustinGrote commented Feb 28, 2025

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 JustinGrote self-assigned this Feb 28, 2025
@JustinGrote JustinGrote marked this pull request as ready for review March 2, 2025 06:17
@Copilot Copilot AI review requested due to automatic review settings March 2, 2025 06:17
Copy link

@Copilot Copilot AI left a comment

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
Collaborator Author

@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.

@JustinGrote JustinGrote enabled auto-merge (squash) March 2, 2025 06:17
Copy link
Member

@andyleejordan andyleejordan left a comment

Choose a reason for hiding this comment

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

Amazing, thanks.

@andyleejordan andyleejordan disabled auto-merge March 4, 2025 19:27
@andyleejordan andyleejordan merged commit 9d56407 into main Mar 4, 2025
8 checks passed
@andyleejordan andyleejordan deleted the feature/addDocumentationNotes branch March 4, 2025 19:27
@andyleejordan andyleejordan added Issue-Enhancement A feature request (enhancement). Area-CodeLens labels Mar 18, 2025
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.

2 participants