Show optional parameters as such when dislplaying method definition and overloads#13799
Conversation
|
@iSazonov it seems like |
iSazonov
left a comment
There was a problem hiding this comment.
it seems like CompletionCompleters also uses a method definition for the tooltip. Is it possible to test that case somehow?
You can use TabCompletion2 (see our tests how it is used).
I couldn't find TabCompletion2 anywhere. Do you mean TabExpansion2? Anyway, as far as I understand, tab completion completes just method name and there are already tests for that.
Rather, "method signature with parameters of various types such as parameters passed by reference, generic and optional parameters", but it seems to me, we could combine tests for the overloaded definition and different method signature into one context. I also want to suggest to mark parameters passed by reference with |
Tab expansion results include a tooltip, which is only shown in editors and some PSReadLine key handlers (but not the Tab one). You can see it here: (TabExpansion2 -inputScript ($s = '$Host.PushRunspace') -cursorColumn $s.Length).CompletionMatchesreturns
Maybe best to open an issue to discuss that one. Part of the problem there is that |
Yes, sorry. |
|
@iSazonov @SeeminglyScience thanks for helping me! I've added tests for the TabExpansion2 tooltip. |
|
This pull request has been automatically marked as Review Needed because it has been there has not been any activity for 7 days. |
|
This pull request has been automatically marked as Review Needed because it has been there has not been any activity for 7 days. |
|
/rebase |
|
Started rebase: https://github.com/PowerShell/PowerShell/actions/runs/2343284398
|
|
@TravisEz13 Could you please look the rebase error? https://github.com/PowerShell/PowerShell/runs/6483334261?check_suite_focus=true#step:5:31
|
|
This pull request has been automatically marked as Review Needed because it has been there has not been any activity for 7 days. |
|
🎉 Handy links: |
PR Summary
These changes provide more informative method definition for methods with the optional parameters.
PR Context
Fix #13728
The changes don't cover a case with an
OptionalAttribute. Calling such a method without optional arguments throws an exception.I could investigate it if you show me where to start.
PR Checklist
.h,.cpp,.cs,.ps1and.psm1files have the correct copyright headerWIP:or[ WIP ]to the beginning of the title (theWIPbot will keep its status check atPendingwhile the prefix is present) and remove the prefix when the PR is ready.