Skip to content
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

Support ClipboardContext for Evaluate Request #1009

Merged
merged 4 commits into from
Jun 12, 2020

Conversation

WardenGnaw
Copy link
Member

Users who want to copy the full string from the UI will use "copy value"
from the EE windows. This will send an EvaluateRequest with the context
of Clipboard.

This PR noticies the context in OpenDebugAD7 and uses IDebugExpressionDAP
with DAPEvalFlag ClipboardContext set for MIEngine to query.
If it is set, MIEngine will save the previous value of 'show print
elements', set it to unlimited, and reset it back to the original value
after it evaluates the variable. Then it will provide the full string
back to the user to copy.

NOTE: Requires VS Code 1.46.0 to work. Previous engines set the expression to be the value of the original expression instead of the actual expression.

Users who want to copy the full string from the UI will use "copy value"
from the EE windows. This will send an EvaluateRequest with the context
of Clipboard.

This PR noticies the context in OpenDebugAD7 and uses IDebugExpressionDAP
with DAPEvalFlag ClipboardContext set for MIEngine to query.
If it is set, MIEngine will save the previous value of 'show print
elements', set it to unlimited, and reset it back to the original value
after it evaluates the variable. Then it will provide the full string
back to the user to copy.
@gregg-miskelly
Copy link
Member

        return Constants.S_OK;

Call the new EvaluateSync passing DAPEvalFlags.NONE (or an internal helper method they both call)


Refers to: src/MIDebugEngine/AD7.Impl/AD7Expression.cs:88 in 070c3a9. [](commit_id = 070c3a9, deletion_comment = False)

@gregg-miskelly
Copy link
Member

Otherwise LGTM.

@WardenGnaw WardenGnaw marked this pull request as ready for review June 11, 2020 23:24
@WardenGnaw WardenGnaw merged commit b24c62d into master Jun 12, 2020
IDebugProperty2 property;
hr = expressionObject.EvaluateSync(flags, Constants.EvaluationTimeout, null, out property);
if (expressionObject is IDebugExpressionDAP expressionDapObject)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you just check the context value in this if block?

@WardenGnaw WardenGnaw deleted the dev/waan/supportClipboardEvaluateRequest branch June 12, 2020 18:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants