Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Improve the completion for attribute arguments#25129

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged

Conversation

@MartinGC94
Copy link
Contributor

@MartinGC94MartinGC94 commentedMar 5, 2025
edited by iSazonov
Loading

PR Summary

Improves the argument completion for attributes so it can work in all scenarios I can think of.
Today the attribute completion only works reliably when you have a variable to bind the attribute to, as the parser throws away the AttributeAst if it can't find a variable. I have fixed this by adding the parsed AttributeAsts to the ErrorExpression that would be created in this case.
Inside a param block the parser already keeps the parsed attributes like this so I have updated the completion code to also handle how the attributes are stored for incomplete parameters inside the param block.

PR Context

Fixes#25111

Regression comes from#17902

PR Checklist

@iSazonov
Copy link
Collaborator

iSazonov commentedMar 5, 2025
edited
Loading

@MartinGC94 If it is a regression could you please point in the PR description where it comes from (PR/commit)? If possible of course.

@MartinGC94
Copy link
ContributorAuthor

It seems to have been this one:#17902 but this new PR is not just a fix for this regression. It's (hopefully) a fix for all the oddities regarding attribute argument completion.

iSazonov reacted with thumbs up emoji

@MartinGC94MartinGC94 changed the titleImprove the completion for argumentsImprove the completion for attribute argumentsMar 5, 2025
@iSazonoviSazonov self-assigned thisMar 5, 2025
@iSazonoviSazonov added the CL-GeneralIndicates that a PR should be marked as a general cmdlet change in the Change Log labelMar 5, 2025
@MartinGC94
Copy link
ContributorAuthor

Hmm, looks like I was a bit too ambitious with what it could do. I removed the test as I don't see a way to fix it. There are no related asts around the cursor on a new line so I can't really find my way back to the attribute ast and be sure that this is what should be completed. It's not terribly important though, I've never seen anyone place attribute arguments on separate lines.

@iSazonov

This comment was marked as outdated.

@azure-pipelines

This comment was marked as outdated.

@iSazonoviSazonovenabled auto-merge (squash)March 6, 2025 12:57
@iSazonoviSazonov merged commitd820692 intoPowerShell:masterMar 6, 2025
39 of 41 checks passed
@microsoft-github-policy-service
Copy link
Contributor

microsoft-github-policy-servicebot commentedMar 6, 2025
edited by unfurl-linksbot
Loading

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

🔗https://aka.ms/PSRepoFeedback

@MartinGC94MartinGC94 deleted the ImproveAttributeCompletion branchMarch 6, 2025 14:55
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@iSazonoviSazonoviSazonov approved these changes

@daxian-dbwdaxian-dbwAwaiting requested review from daxian-dbwdaxian-dbw is a code owner

@SeeminglyScienceSeeminglyScienceAwaiting requested review from SeeminglyScienceSeeminglyScience is a code owner

Assignees

@iSazonoviSazonov

Labels

CL-GeneralIndicates that a PR should be marked as a general cmdlet change in the Change Log

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

7.4+ Regression: Attribute Value Completion if variable isn't defined.

2 participants

@MartinGC94@iSazonov

[8]ページ先頭

©2009-2025 Movatter.jp