-
Notifications
You must be signed in to change notification settings - Fork 7.7k
Filter out the nested modules of PSReadLine
from module name tab completion
#24910
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot reviewed 1 out of 1 changed files in this pull request and generated no comments.
Comments suppressed due to low confidence (1)
src/System.Management.Automation/engine/CommandCompletion/CompletionCompleters.cs:474
- [nitpick] The variable name 'nestedModulesToFilterOut' is a bit lengthy and could be simplified to 'filteredNestedModules' for better readability.
HashSet<PSModuleInfo> nestedModulesToFilterOut = null;
/azp run |
Azure Pipelines successfully started running 4 pipeline(s). |
src/System.Management.Automation/engine/CommandCompletion/CompletionCompleters.cs
Show resolved
Hide resolved
src/System.Management.Automation/engine/CommandCompletion/CompletionCompleters.cs
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM with one style comment.
src/System.Management.Automation/engine/CommandCompletion/CompletionCompleters.cs
Outdated
Show resolved
Hide resolved
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
📣 Hey @daxian-dbw, how did we do? We would love to hear your feedback with the link below! 🗣️ 🔗 https://aka.ms/PSRepoFeedback |
PR Summary
When doing module name completion such as
Get-Module mic<tab>
orGet-Module psr<tab>
, you will seeMicrosoft.PowerShell.PSReadLine2
as the result of completion.Microsoft.PowerShell.PSReadLine2
is a nested module ofPSReadLine
, which shouldn't be returned by completion. It's returned because the completion happens in PSReadLine's context (using PSReadLine'sSessionState
as theEngineSessionState
) and hence its nested modules are visible to the tab completion.This PR filters out the nested modules of
PSReadLine
from the tab completion results. It's intentional to not hard code the name 'PSReadLine' in the change, so that in case the tab completion is triggered from within a different module, its nested modules can also be filtered out.PR Checklist
.h
,.cpp
,.cs
,.ps1
and.psm1
files have the correct copyright headerWIP:
or[ WIP ]
to the beginning of the title (theWIP
bot will keep its status check atPending
while the prefix is present) and remove the prefix when the PR is ready.- [ ] Issue filed: