Remove conditional IC10 formatting
This commit is contained in:
@@ -187,9 +187,12 @@ public class SlangFormatter : ICodeFormatter
|
|||||||
var caretPos = Editor.CaretPos.Line;
|
var caretPos = Editor.CaretPos.Line;
|
||||||
|
|
||||||
// get the slang sourceMap at the current editor line
|
// get the slang sourceMap at the current editor line
|
||||||
var lines = ic10SourceMap.FindAll(entry =>
|
var lines = ic10SourceMap
|
||||||
|
.FindAll(entry =>
|
||||||
entry.SlangSource.StartLine == caretPos || entry.SlangSource.EndLine == caretPos
|
entry.SlangSource.StartLine == caretPos || entry.SlangSource.EndLine == caretPos
|
||||||
);
|
)
|
||||||
|
.ConvertAll(el => el.Ic10Line)
|
||||||
|
.ToHashSet();
|
||||||
|
|
||||||
// extract the current "context" of the ic10 compilation. The current Slang source line
|
// extract the current "context" of the ic10 compilation. The current Slang source line
|
||||||
// should be directly next to the compiled IC10 source line, and we should highlight the
|
// should be directly next to the compiled IC10 source line, and we should highlight the
|
||||||
@@ -197,21 +200,19 @@ public class SlangFormatter : ICodeFormatter
|
|||||||
|
|
||||||
iC10CodeFormatter.ResetCode(ic10CompilationResult);
|
iC10CodeFormatter.ResetCode(ic10CompilationResult);
|
||||||
|
|
||||||
if (lines.Count < 1)
|
uint index = 0;
|
||||||
|
foreach (var line in iC10CodeFormatter.Lines)
|
||||||
{
|
{
|
||||||
return;
|
if (lines.Contains(index))
|
||||||
|
{
|
||||||
|
index += 1;
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
|
line.ForEach(token =>
|
||||||
iC10CodeFormatter.Lines = new StyledText();
|
|
||||||
|
|
||||||
var minLine = lines.Min(map => map.Ic10Line);
|
|
||||||
var maxLine = lines.Max(map => map.Ic10Line);
|
|
||||||
|
|
||||||
foreach (var line in lines)
|
|
||||||
{
|
{
|
||||||
iC10CodeFormatter
|
token.Style.Color = ColorDefault;
|
||||||
.Lines[(int)line.Ic10Line]
|
});
|
||||||
.ForEach(token => token.Style.Color = ColorIdentifier);
|
index += 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
2
rust_compiler/Cargo.lock
generated
2
rust_compiler/Cargo.lock
generated
@@ -930,7 +930,7 @@ checksum = "e3a9fe34e3e7a50316060351f37187a3f546bce95496156754b601a5fa71b76e"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "slang"
|
name = "slang"
|
||||||
version = "0.3.4"
|
version = "0.4.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
"clap",
|
"clap",
|
||||||
|
|||||||
Reference in New Issue
Block a user