-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Fix console mode #9094
Fix console mode #9094
Conversation
Printing properties or items is much more complicated than might be supposed at face value. When creating a Project, we get things like ProjectItems and ProjectProperties; after the build, we get ProjectItemInstances and ProjectPropertyInstances. Properties aren't too bad because we can use a delegate to abstract over that, but ProjectInstances have ProjectItemInstances with ProjectMetadataInstances, which is too many layers of nesting to cleanly abstract that in a delegate, hence two separate helper functions for those.
...when getting evaluation results
My personal preference is to fix it in a separate (i.e., this) PR, mostly because if I move these changes to that PR, it'd need to be reviewed more and probably need at least one or two more changes, and I'd rather it go in 🙂 |
I can move it over there if you want me to, though. |
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.
I have couple minor comments for consideration.
The main things I'd like to see addressed:
- Prevent merge mess, by either basing this on your other branch, or by first waiting for that other PR to go in (and then resolving here)
- I believe the same issue should be addressed in other affected loggers as well (or otherwise the Inspect ConsoleMode before sending control codes on Windows #9079 should be left open)
100% agree. My plan is to wait until the other PR is in, then restart the merge, and I believe it will drop all the prior commits (and make your life a lot easier!)
Which loggers are you thinking of? The only loggers that I think are potentially susceptible to this sort of problem are this new logger (fixed in this PR), the terminal logger (fixed in one of my previous PRs), and the console logger, but I asked about fixing the console logger in #9079, and rainersigwald suggested it doesn't need fixing. I'm fine with trying to fix it or not fix it as the two of you agree 🙂 |
Those are the loggers I had in mind. If all are already addressed separately - than we're good |
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.
Looks good (just marking it as not subject for merging so that it doesn't get merged by anybody else prior the other PR is in and conflicts resolved)
Please reconsider what win32 api details needs to be exposed beyond boundaries of the NativeMethods
To include GetTargetResult!
… into fix-console-mode
That's fair. I guess I was thinking about if a user happens to be familiar with the wind32 API already...but how many people actually are? I added an enum. |
… into fix-console-mode
@JanKrivanek, diff looks a lot cleaner now, so I removed the do-not-merge label. |
Thanks for all the adjustments! Looks good to go to me! |
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. I have few opinionated/nit comments.
@rokonec, I resolved your first and third comments but left your second one because you fixed that in your PR. As I said there, we can merge one of the PRs and resolve conflicts then, or I can pull your changes into my branch, and we can merge them as one change. I'm ok with either way. |
Fixes #9079
Context
First stab at taking into account console mode when writing error messages as part of a user asking for a particular property/item/target result. If we can't verify that the console is VT-compatible, we fall back to just printing things out with their default coloration. (Though not perfect, I think this is an unimportant enough scenario, that I don't think it's worth worrying about.)
Changes Made
Testing
Notes