This project is read-only.
1
Vote

Script Document IntelliSense race condition

description

Source: (in a Script document):
if (someSequence.Count() > 2)
IEnumerable<int> RandomStream(int max) {
    yield return int.
Pressing Ctrl+Space, Space, or Enter will try to consume a cancelled Model task in the completion controller and throw.

Stack:
    System.Threading.Tasks.Task.ThrowIfExceptional(bool includeTaskCanceledExceptions)  Unknown
    System.Threading.Tasks.Task.Wait(int millisecondsTimeout, System.Threading.CancellationToken cancellationToken) Unknown
    System.Threading.Tasks.Task.Wait(System.Threading.CancellationToken cancellationToken)  Unknown
    Microsoft.CodeAnalysis.Editor.Implementation.IntelliSense.Completion.Controller.Session.WaitForModel()  Unknown
>   Microsoft.CodeAnalysis.Editor.Implementation.IntelliSense.Completion.Controller.CommitOnEnter(out bool sendThrough, out bool committed) Unknown
    Microsoft.CodeAnalysis.Editor.Implementation.IntelliSense.Completion.Controller.Microsoft.CodeAnalysis.Editor.ICommandHandler<Microsoft.CodeAnalysis.Editor.Commands.ReturnKeyCommandArgs>.ExecuteCommand(Microsoft.CodeAnalysis.Editor.Commands.ReturnKeyCommandArgs args, System.Action nextHandler)  Unknown
    Microsoft.CodeAnalysis.Editor.CommandHandlers.AbstractCompletionCommandHandler.ExecuteCommandWorker<Microsoft.CodeAnalysis.Editor.Commands.ReturnKeyCommandArgs>(Microsoft.CodeAnalysis.Editor.Commands.ReturnKeyCommandArgs args, System.Action nextHandler)   Unknown
    Microsoft.CodeAnalysis.Editor.CommandHandlers.AbstractCompletionCommandHandler.Microsoft.CodeAnalysis.Editor.ICommandHandler<Microsoft.CodeAnalysis.Editor.Commands.ReturnKeyCommandArgs>.ExecuteCommand(Microsoft.CodeAnalysis.Editor.Commands.ReturnKeyCommandArgs args, System.Action nextHandler)   Unknown
    Microsoft.CodeAnalysis.Editor.Implementation.Commands.CommandHandlerService.ExecuteHandlers<Microsoft.CodeAnalysis.Editor.Commands.ReturnKeyCommandArgs>.AnonymousMethod__7()   Unknown
    Microsoft.CodeAnalysis.Editor.Implementation.Formatting.FormatCommandHandler.ExecuteReturnOrTypeCommand(Microsoft.CodeAnalysis.Editor.CommandArgs args, System.Action nextHandler, System.Threading.CancellationToken cancellationToken)    Unknown
    Microsoft.CodeAnalysis.Editor.Implementation.Formatting.FormatCommandHandler.ExecuteCommand(Microsoft.CodeAnalysis.Editor.Commands.ReturnKeyCommandArgs args, System.Action nextHandler)    Unknown
    Microsoft.CodeAnalysis.Editor.Implementation.Commands.CommandHandlerService.ExecuteHandlers<Microsoft.CodeAnalysis.Editor.Commands.ReturnKeyCommandArgs>.AnonymousMethod__7()   Unknown
    Microsoft.CodeAnalysis.Editor.Implementation.Formatting.Indentation.AbstractSmartTokenFormatterCommandHandler.ExecuteCommand(Microsoft.CodeAnalysis.Editor.Commands.ReturnKeyCommandArgs args, System.Action nextHandler)   Unknown
    Microsoft.CodeAnalysis.Editor.Implementation.Commands.CommandHandlerService.ExecuteHandlers<Microsoft.CodeAnalysis.Editor.Commands.ReturnKeyCommandArgs>.AnonymousMethod__7()   Unknown
    Microsoft.CodeAnalysis.Editor.Implementation.InlineRename.RenameCommandHandler.ExecuteCommand(Microsoft.CodeAnalysis.Editor.Commands.ReturnKeyCommandArgs args, System.Action nextHandler)  Unknown
    Microsoft.CodeAnalysis.Editor.Implementation.Commands.CommandHandlerService.ExecuteHandlers<Microsoft.CodeAnalysis.Editor.Commands.ReturnKeyCommandArgs>(System.Collections.Generic.IList<Microsoft.CodeAnalysis.Editor.ICommandHandler<Microsoft.CodeAnalysis.Editor.Commands.ReturnKeyCommandArgs>> commandHandlers, Microsoft.CodeAnalysis.Editor.Commands.ReturnKeyCommandArgs args, System.Action lastHandler) Unknown
    Microsoft.CodeAnalysis.Editor.Implementation.Commands.CommandHandlerService.Microsoft.CodeAnalysis.Editor.ICommandHandlerService.Execute<Microsoft.CodeAnalysis.Editor.Commands.ReturnKeyCommandArgs>(Microsoft.VisualStudio.Utilities.IContentType contentType, Microsoft.CodeAnalysis.Editor.Commands.ReturnKeyCommandArgs args, System.Action lastHandler)   Unknown
    Microsoft.VisualStudio.LanguageServices.Implementation.AbstractOleCommandTarget.ExecuteReturn(Microsoft.VisualStudio.Text.ITextBuffer subjectBuffer, Microsoft.VisualStudio.Utilities.IContentType contentType, System.Action executeNextCommandTarget) Line 638    C#

comments

SSL wrote Jan 11, 2015 at 6:37 PM

This is completely reproducible in VSEmbed or my Markdown editor, and probably also in any other Script editor.