提交 4f133c84 编写于 作者: S Sam Harwell 提交者: GitHub

Merge pull request #21016 from sharwell/throw-on-invalid-buffer

Throw early if an invalid buffer is passed to ISuggestedActionsSource
......@@ -650,6 +650,11 @@ private static SuggestedActionSetPriority GetSuggestedActionSetPriority(CodeActi
return false;
}
// Also make sure the range is from the same buffer that this source was created for
Contract.ThrowIfFalse(
range.Snapshot.TextBuffer.Equals(_subjectBuffer),
$"Invalid text buffer passed to {nameof(HasSuggestedActionsAsync)}");
// Next, before we do any async work, acquire the user's selection, directly grabbing
// it from the UI thread if htat's what we're on. That way we don't have any reentrancy
// blocking concerns if VS wants to block on this call (for example, if the user
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册