Added logging around the creation of the IC10Editor tab
All checks were successful
CI/CD Pipeline / test (pull_request) Successful in 34s
CI/CD Pipeline / build (pull_request) Has been skipped
CI/CD Pipeline / release (pull_request) Has been skipped

This commit is contained in:
2025-12-24 11:10:10 -07:00
parent 42b0b0acf9
commit c7aa30581d
2 changed files with 11 additions and 6 deletions

View File

@@ -14,7 +14,7 @@ public class SlangFormatter : ICodeFormatter
private CancellationTokenSource? _lspCancellationToken;
private object _tokenLock = new();
protected static Editor? Ic10Editor = null;
protected Editor? Ic10Editor = null;
private IC10CodeFormatter iC10CodeFormatter = new IC10CodeFormatter();
private string ic10CompilationResult = "";
private List<SourceMapEntry> ic10SourceMap = new();
@@ -37,6 +37,7 @@ public class SlangFormatter : ICodeFormatter
public SlangFormatter()
: base()
{
L.Info("Slang Constructor");
OnCodeChanged += HandleCodeChanged;
OnCaretMoved += UpdateIc10Formatter;
}
@@ -194,13 +195,20 @@ public class SlangFormatter : ICodeFormatter
private void UpdateIc10Formatter()
{
if (Ic10Editor is null)
var tab = Editor.ParentTab;
if (Ic10Editor == null)
{
var tab = Editor.ParentTab;
L.Info("Ic10Editor was null");
iC10CodeFormatter = new IC10CodeFormatter();
Ic10Editor = new Editor(Editor.KeyHandler);
Ic10Editor.IsReadOnly = true;
iC10CodeFormatter.Editor = Ic10Editor;
tab.ClearExtraEditors();
}
if (tab.Editors.Count < 2)
{
L.Info("Adding new editor tab");
tab.AddEditor(Ic10Editor);
}