Added logging around the creation of the IC10Editor tab
This commit is contained in:
@@ -14,7 +14,7 @@ public class SlangFormatter : ICodeFormatter
|
|||||||
private CancellationTokenSource? _lspCancellationToken;
|
private CancellationTokenSource? _lspCancellationToken;
|
||||||
private object _tokenLock = new();
|
private object _tokenLock = new();
|
||||||
|
|
||||||
protected static Editor? Ic10Editor = null;
|
protected Editor? Ic10Editor = null;
|
||||||
private IC10CodeFormatter iC10CodeFormatter = new IC10CodeFormatter();
|
private IC10CodeFormatter iC10CodeFormatter = new IC10CodeFormatter();
|
||||||
private string ic10CompilationResult = "";
|
private string ic10CompilationResult = "";
|
||||||
private List<SourceMapEntry> ic10SourceMap = new();
|
private List<SourceMapEntry> ic10SourceMap = new();
|
||||||
@@ -37,6 +37,7 @@ public class SlangFormatter : ICodeFormatter
|
|||||||
public SlangFormatter()
|
public SlangFormatter()
|
||||||
: base()
|
: base()
|
||||||
{
|
{
|
||||||
|
L.Info("Slang Constructor");
|
||||||
OnCodeChanged += HandleCodeChanged;
|
OnCodeChanged += HandleCodeChanged;
|
||||||
OnCaretMoved += UpdateIc10Formatter;
|
OnCaretMoved += UpdateIc10Formatter;
|
||||||
}
|
}
|
||||||
@@ -193,14 +194,21 @@ public class SlangFormatter : ICodeFormatter
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void UpdateIc10Formatter()
|
private void UpdateIc10Formatter()
|
||||||
{
|
|
||||||
if (Ic10Editor is null)
|
|
||||||
{
|
{
|
||||||
var tab = Editor.ParentTab;
|
var tab = Editor.ParentTab;
|
||||||
|
if (Ic10Editor == null)
|
||||||
|
{
|
||||||
|
L.Info("Ic10Editor was null");
|
||||||
iC10CodeFormatter = new IC10CodeFormatter();
|
iC10CodeFormatter = new IC10CodeFormatter();
|
||||||
Ic10Editor = new Editor(Editor.KeyHandler);
|
Ic10Editor = new Editor(Editor.KeyHandler);
|
||||||
Ic10Editor.IsReadOnly = true;
|
Ic10Editor.IsReadOnly = true;
|
||||||
iC10CodeFormatter.Editor = Ic10Editor;
|
iC10CodeFormatter.Editor = Ic10Editor;
|
||||||
|
tab.ClearExtraEditors();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (tab.Editors.Count < 2)
|
||||||
|
{
|
||||||
|
L.Info("Adding new editor tab");
|
||||||
tab.AddEditor(Ic10Editor);
|
tab.AddEditor(Ic10Editor);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,5 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.IO;
|
|
||||||
using System.IO.Compression;
|
|
||||||
using System.Text;
|
|
||||||
|
|
||||||
namespace Slang;
|
namespace Slang;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user