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

Crash while edit multiple lines. #4762

Closed
HarshCoastOS opened this issue Oct 4, 2018 · 1 comment
Closed

Crash while edit multiple lines. #4762

HarshCoastOS opened this issue Oct 4, 2018 · 1 comment
Assignees
Labels
Milestone

Comments

@HarshCoastOS
Copy link

[Window Title]
devenv.exe

[Main Instruction]
An unexpected error occurred

[Content]
Please press Ctrl+C to copy the contents of this dialog and report this error to our issue tracker.

[^] Hide details [Close]

[Expanded Information]

Build: 15.8.18241.1

System.NullReferenceException: Object reference not set to an instance of an object.
   at Microsoft.PythonTools.Intellisense.CompletionSessionExtensions.SetTriggerCharacter(IIntellisenseSession session, Char triggerChar)
   at Microsoft.PythonTools.Intellisense.IntellisenseController.<TriggerCompletionSession>d__43.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at Microsoft.PythonTools.Infrastructure.TaskExtensions.ReThrowTaskException(Object state)
   at Microsoft.PythonTools.Infrastructure.TaskExtensions.DoNotWait(Task task)
   at Microsoft.PythonTools.Intellisense.IntellisenseController.HandleChar(Char ch)
   at Microsoft.PythonTools.Intellisense.IntellisenseController.Exec(Guid& pguidCmdGroup, UInt32 nCmdID, UInt32 nCmdexecopt, IntPtr pvaIn, IntPtr pvaOut)
   at Microsoft.VisualStudio.Editor.Implementation.CommandChainNode.InnerExec(Guid& pguidCmdGroup, UInt32 nCmdID, UInt32 nCmdexecopt, IntPtr pvaIn, IntPtr pvaOut)
   at Microsoft.VisualStudio.Editor.Implementation.CommandChainNode.Exec(Guid& pguidCmdGroup, UInt32 nCmdID, UInt32 nCmdexecopt, IntPtr pvaIn, IntPtr pvaOut)
   at Microsoft.PythonTools.Language.EditFilter.ExecWorker(Guid& pguidCmdGroup, UInt32 nCmdID, UInt32 nCmdexecopt, IntPtr pvaIn, IntPtr pvaOut)
   at Microsoft.PythonTools.Language.EditFilter.Exec(Guid& pguidCmdGroup, UInt32 nCmdID, UInt32 nCmdexecopt, IntPtr pvaIn, IntPtr pvaOut)
--- End of stack trace from previous location where exception was thrown ---
   at Microsoft.VisualStudio.Telemetry.WindowsErrorReporting.WatsonReport.GetClrWatsonExceptionInfo(Exception exceptionObject)
@huguesv
Copy link
Contributor

huguesv commented Feb 6, 2019

session is null here:

        internal async Task TriggerCompletionSession(bool completeWord, char triggerChar, bool? commitByDefault = null) {
            var caretPoint = _textView.TextBuffer.CurrentSnapshot.CreateTrackingPoint(_textView.Caret.Position.BufferPosition, PointTrackingMode.Positive);
            var session = _services.CompletionBroker.CreateCompletionSession(_textView, caretPoint, true);
            session.SetTriggerCharacter(triggerChar);
            if (completeWord) {
                session.SetCompleteWordMode();
            }

We probably should make ShouldTriggerIdentifierCompletionSession return false when there's multiple carets.

                            if (ShouldTriggerIdentifierCompletionSession(out commitByDefault)) {
                                TriggerCompletionSession(false, ch, commitByDefault).DoNotWait();
                            }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants