Skip to content

Fix completion of variables assigned inside Do loops #25076

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 4 commits into from
Feb 26, 2025

Conversation

MartinGC94
Copy link
Contributor

PR Summary

Fixes completion of variables assigned inside Do loops while the variable to complete is also inside the Do loop. For example:

    do
    {
        $Test = ls
        $Tes<Tab>
    }
    until ($x -gt 0)

This would not complete as it would visit the until condition before the statement block, and because it's after the cursor it would stop visiting the remaining asts.

PR Context

PR Checklist

@iSazonov
Copy link
Collaborator

/azp run

Copy link

Azure Pipelines successfully started running 2 pipeline(s).

MartinGC94 and others added 3 commits February 25, 2025 11:03
@iSazonov iSazonov added the CL-General Indicates that a PR should be marked as a general cmdlet change in the Change Log label Feb 25, 2025
@iSazonov

This comment was marked as outdated.

This comment was marked as outdated.

@iSazonov iSazonov self-assigned this Feb 26, 2025
@iSazonov iSazonov merged commit c64a636 into PowerShell:master Feb 26, 2025
39 of 41 checks passed
Copy link
Contributor

microsoft-github-policy-service bot commented Feb 26, 2025

📣 Hey @MartinGC94, how did we do? We would love to hear your feedback with the link below! 🗣️

🔗 https://aka.ms/PSRepoFeedback

@MartinGC94 MartinGC94 deleted the DoLoopsVarCompletion branch February 28, 2025 10:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CL-General Indicates that a PR should be marked as a general cmdlet change in the Change Log
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants