wip -- lsp mappings to various types

This commit is contained in:
2025-11-30 20:31:06 -07:00
parent 5db31d087d
commit 06a151ab7e
18 changed files with 640 additions and 255 deletions

View File

@@ -1,15 +1,20 @@
namespace Slang;
using System.Timers;
using StationeersIC10Editor;
public class SlangFormatter : ICodeFormatter
{
private Timer _timer;
public static readonly uint ColorInstruction = ColorFromHTML("#ffff00");
public static readonly uint ColorString = ColorFromHTML("#ce9178");
public override Line ParseLine(string line)
public SlangFormatter()
{
return Marshal.TokenizeLine(line);
_timer = new Timer(250);
this.OnCodeChanged += HandleCodeChanged;
}
public override string Compile()
@@ -17,4 +22,19 @@ public class SlangFormatter : ICodeFormatter
L.Info("ICodeFormatter attempted to compile source code.");
return this.Lines.RawText;
}
public override Line ParseLine(string line)
{
return new Line(line);
}
private void HandleCodeChanged()
{
_timer.Stop();
_timer.Dispose();
_timer = new Timer(250);
_timer.Elapsed += (_, _) => HandleLsp();
}
private void HandleLsp() { }
}