The current version of Editor.NET (2.5) crashes if the following text is typed into a C# syntax:
var str = new [] {
The NUllReferenceException actually pops up in CsParser.GenerateImplicitClass and to be fixed there, but I think additionally you should encapsulate the execution of an action inside BackgroundThread with a try-catch in order to avoid async unhandled exceptions in general.
Best,
Ralf
Hi Ventuz,
Thank you for the bug report, this problem has been fixed already in AlterNET CodeEditor, as Editor.NET is no longer developed.
Here's the fix to this bug:
protected virtual string GenerateImplicitClass(ISyntaxNode memberList, out ISyntaxNode typeNode)
{
string result = string.Empty;
typeNode = null;
ISyntaxNode parent = GetImplicitNode(SyntaxTree.Current);
if (parent != null)
{
Point pos = parent.Position;
ISyntaxNode node = new SyntaxNode(pos, string.Empty, (int)NetNodeType.Class, SyntaxNodeOptions.CodeCompletion);
if (memberList.HasChildren) // added line
foreach (ISyntaxNode child in memberList.ChildList)
{
...
and I'm uploading fixed assembly as well:
http://www.alternetsoft.com/projects/QWhale_dlls.zip
We will also look at your suggestion as to handle parsing exceptions when using background thread.
regards,
Andrew
Thank you for the bug report, this problem has been fixed already in AlterNET CodeEditor, as Editor.NET is no longer developed.
Here's the fix to this bug:
protected virtual string GenerateImplicitClass(ISyntaxNode memberList, out ISyntaxNode typeNode)
{
string result = string.Empty;
typeNode = null;
ISyntaxNode parent = GetImplicitNode(SyntaxTree.Current);
if (parent != null)
{
Point pos = parent.Position;
ISyntaxNode node = new SyntaxNode(pos, string.Empty, (int)NetNodeType.Class, SyntaxNodeOptions.CodeCompletion);
if (memberList.HasChildren) // added line
foreach (ISyntaxNode child in memberList.ChildList)
{
...
and I'm uploading fixed assembly as well:
http://www.alternetsoft.com/projects/QWhale_dlls.zip
We will also look at your suggestion as to handle parsing exceptions when using background thread.
regards,
Andrew