Opened 5 years ago

Closed 5 years ago

#1826 closed defect (done)

Code editor throws exceptions in some cases related to intellisense

Reported by: abeham Owned by: abeham
Priority: medium Milestone: HeuristicLab 3.3.7
Component: CodeEditor Version: 3.3.7
Keywords: Cc:

Description

When adding a new programmable operator and viewing the code, howevering over the as keyword throws following exception:

System.NullReferenceException: Object reference not set to an instance of an object.
   at ICSharpCode.SharpDevelop.Dom.CtrlSpaceResolveHelper.GetResultFromDeclarationLine(IClass callingClass, IMethodOrProperty callingMember, Int32 caretLine, Int32 caretColumn, ExpressionResult expressionResult)
   at ICSharpCode.SharpDevelop.Dom.NRefactoryResolver.NRefactoryResolver.Resolve(ExpressionResult expressionResult, ParseInformation parseInfo, String fileContent)
   at HeuristicLab.CodeEditor.ToolTipProvider.OnToolTipRequest(Object sender, ToolTipRequestEventArgs e)
   at ICSharpCode.TextEditor.ToolTipRequestEventHandler.Invoke(Object sender, ToolTipRequestEventArgs e)
   at ICSharpCode.TextEditor.TextArea.RequestToolTip(Point mousePos)
   at ICSharpCode.TextEditor.TextArea.OnMouseHover(EventArgs e)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

Change History (9)

comment:1 Changed 5 years ago by epitzer

  • Status changed from new to accepted

comment:2 Changed 5 years ago by epitzer

r7746 check for null expression before resolving symbol for tool tip information

comment:3 Changed 5 years ago by epitzer

  • Owner changed from epitzer to abeham
  • Status changed from accepted to reviewing

comment:4 Changed 5 years ago by abeham

  • Owner changed from abeham to epitzer
  • Status changed from reviewing to assigned

Thanks for fixing this. I received another exception when intellisense wants to pop up after typing a "." on an enumerable of an anonymous type. To reproduce paste the following code into a programmable operator.

var myEnum = Enumerable.Range(0, 100).Select(x => new { Linear = x, Squared = x*x }).ToArray();

Then try to write e.g. "myEnum.Count();". A NullReferenceException will be thrown once you type the "." at which point the view will become out of sync. You can type further text, but it will show up only when you close and reopen the view. Maybe you can generally prevent the view from going out of sync with the text in case exceptions occur.

comment:5 Changed 5 years ago by abeham

  • Summary changed from Code editor throws exception when howevering over the "as" keyword to Code editor throws exceptions in some cases related to intellisense

comment:6 Changed 5 years ago by abeham

Btw, I noticed intellisense doesn't work well with anonymous types in general. It doesn't list the properties in the intellisense popup window. Don't know if that would be a lot of effort to fix or is that a sharpdevelop limitation?

comment:7 Changed 5 years ago by epitzer

  • Owner changed from epitzer to abeham
  • Status changed from assigned to reviewing

r7983 catch exceptions from sharp develop code completion

comment:8 Changed 5 years ago by abeham

  • Status changed from reviewing to readytorelease

I tested it. Thanks for fixing this!

comment:9 Changed 5 years ago by mkommend

  • Resolution set to done
  • Status changed from readytorelease to closed
  • Version changed from 3.3.6 to 3.3.7
Note: See TracTickets for help on using tickets.