You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
autocompletion seems to throw an exception when completing in an empty editor.
E.g. steps to reprodue:
Launch the editor, empty all code. Then type in something that will open the completion window, such as "us". Then delete contents again (e.g. backspace twice, or ctrl+a then delete). The editor will be empty, but the completion window will still be open.
Now, when picking anything from the completion window and insertnig it (tab), it'll crash in RoslynCompletionData.cs line 61, i.e. on
document.Replace(textChange.Span.Start, textChange.Span.Length, new StringTextSource(textChange.NewText));
with System.Argument.OutOfRangeException: "0 <= length, offset(0) + length <= 0".
EDIT I've just noticed this doesn't only happen when the editor is empty, but also apparently in any circumstances where I assume there shouldn't be any completion, but the completion window is still open.
For example, it'll also occur when typing
"public cl"
then deleting the "cl" (so remainder is "public ") and inserting any item.
Edit 2 * Might be fixed as below, though might be even better to just hide the autocompletion window in those circumstances
var docLength = document.Text.Length;
var spanEnd = textChange.Span.End;
var length = Math.Min(docLength, spanEnd) - textChange.Span.Start;
document.Replace(textChange.Span.Start, length,
new StringTextSource(textChange.NewText));
The text was updated successfully, but these errors were encountered:
Hi,
autocompletion seems to throw an exception when completing in an empty editor.
E.g. steps to reprodue:
Launch the editor, empty all code. Then type in something that will open the completion window, such as "us". Then delete contents again (e.g. backspace twice, or ctrl+a then delete). The editor will be empty, but the completion window will still be open.
Now, when picking anything from the completion window and insertnig it (tab), it'll crash in RoslynCompletionData.cs line 61, i.e. on
with System.Argument.OutOfRangeException: "0 <= length, offset(0) + length <= 0".
EDIT I've just noticed this doesn't only happen when the editor is empty, but also apparently in any circumstances where I assume there shouldn't be any completion, but the completion window is still open.
For example, it'll also occur when typing
"public cl"
then deleting the "cl" (so remainder is "public ") and inserting any item.
The text was updated successfully, but these errors were encountered: