提交 43bc5dbb 编写于 作者: S Sam Harwell

Throw early if an invalid buffer is passed to ISuggestedActionsSource

上级 1985055c
......@@ -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.
先完成此消息的编辑!
想要评论请 注册