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

Make immediate window buffer writable before applying completion edit #28131

Merged
merged 2 commits into from
Jun 29, 2018

Conversation

tmat
Copy link
Member

@tmat tmat commented Jun 26, 2018

Customer scenario

VS crashes when completion in Immediate Window is committed by double-clicking on the completion item.

Bugs this fixes

VSO 384025
#24565

Workarounds, if any

Complete using tab.

Risk

Small.

Performance impact

None.

Is this a regression from a previous update?

Root cause analysis

How was the bug found?

Customer reported.

Test documentation updated?

@tmat tmat requested a review from a team as a code owner June 26, 2018 17:34
@tmat tmat changed the title Implement ProjectionEditResolver for Immediate Window completion projection buffer WIP: Implement ProjectionEditResolver for Immediate Window completion projection buffer Jun 26, 2018
@tmat tmat force-pushed the IntellisenseCrash branch from c2523f8 to fed49cf Compare June 28, 2018 01:47
@tmat tmat changed the title WIP: Implement ProjectionEditResolver for Immediate Window completion projection buffer Make immediate window buffer writable before applying completion edit Jun 28, 2018
@tmat
Copy link
Member Author

tmat commented Jun 28, 2018

@dotnet/roslyn-ide Please review.
@AmadeusW FYI.

@jinujoseph jinujoseph added this to the 15.8 milestone Jun 28, 2018
}

_debuggerTextLinesOpt.GetStateFlags(out var bufferFlags);
_debuggerTextLinesOpt.SetStateFlags((uint)((BUFFERSTATEFLAGS)bufferFlags & ~BUFFERSTATEFLAGS.BSF_USER_READONLY));
Copy link
Member

Choose a reason for hiding this comment

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

We also have this same stuff going on in DebuggerIntellisenseFilter.cs:

_context.DebuggerTextLines.GetStateFlags(out var bufferFlags);
_context.DebuggerTextLines.SetStateFlags((uint)((BUFFERSTATEFLAGS)bufferFlags & ~BUFFERSTATEFLAGS.BSF_USER_READONLY));

Was this the right place for that all along? It seems like yes, because commits indeed can come through not through the commanding system. Should that other code be deleted?

Copy link
Member Author

Choose a reason for hiding this comment

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

I think the other code needs to stay there so that characters are written to to buffer as you type.

Copy link
Member

Choose a reason for hiding this comment

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

@AmadeusW Do we have this happening in our new system as well?

@jasonmalinowski
Copy link
Member

@dpoeschl is the editor taking care of this magic in the new implementation?

@jasonmalinowski jasonmalinowski requested a review from dpoeschl June 28, 2018 17:51
@tmat
Copy link
Member Author

tmat commented Jun 28, 2018

@jasonmalinowski This hack is needed because of the way the Immediate Window works. Has nothing to do with editor. The right fix is to kill Immediate Window with fire.

@jasonmalinowski
Copy link
Member

jasonmalinowski commented Jun 28, 2018

Has nothing to do with editor.

In the new intellisense implementation, the file you're editing no longer exists -- it's moved over to the editor. They already have to reimplement other hacks to deal with debugger windows, because we can't fix them anymore either.

@tmat
Copy link
Member Author

tmat commented Jun 28, 2018

test windows_release_vs-integration_prtest please

@tmat
Copy link
Member Author

tmat commented Jun 28, 2018

@jasonmalinowski I see. Hmm.

Copy link
Member

@jasonmalinowski jasonmalinowski left a comment

Choose a reason for hiding this comment

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

This seems fine, but I'd like @AmadeusW's or @dpoeschl's signoff mostly so they are aware of this requirement and can incorporate into any new system.

@tmat
Copy link
Member Author

tmat commented Jun 28, 2018

So the editor now has dependency on Immediate Window? That's very unfortunate.

@AmadeusW
Copy link
Contributor

@jasonmalinowski we do not have special handling for this. This is unfortunate that immediate window acts this way. Once we have working Roslyn bits, we will be able to solve this. I will create a dev16 bug to track this.

@AmadeusW
Copy link
Contributor

Approved. I assigned myself bug 640224: In Async Completion, mark the immediate window's buffer as non-read-only during commit

@AmadeusW
Copy link
Contributor

I can't approve 😭
I'll give a thumbs up instead.

@tmat
Copy link
Member Author

tmat commented Jun 29, 2018

test windows_release_vs-integration_prtest please

@tmat
Copy link
Member Author

tmat commented Jun 29, 2018

@jinujoseph for 15.8 approval

@jinujoseph
Copy link
Contributor

Approved to merge for 15.8.Preview5

@jinujoseph jinujoseph merged commit acd3a8d into dotnet:master Jun 29, 2018
@tmat tmat deleted the IntellisenseCrash branch June 29, 2018 16:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants