Compare commits

...

10 Commits

Author SHA1 Message Date
Matt Parker
dca95db153 ⬆️ Bump version
Some checks failed
Create GitHub Release / execute-parallel-pipeline (push) Has been cancelled
2026-01-31 16:29:58 +10:00
Matt Parker
22da346e16 update godot version in cicd 2026-01-31 16:29:57 +10:00
Matt Parker
fb203e4b4d sidebar button icons light theme 2026-01-31 16:10:22 +10:00
Matt Parker
a5d4216472 sidebar buttons light theme 2026-01-31 16:03:31 +10:00
Matt Parker
a0429295c5 refactor sidebar button style to theme 2026-01-31 15:49:59 +10:00
Matt Parker
c5752bd226 rename fields 2026-01-31 15:42:26 +10:00
Matt Parker
d90c3045c7 improve completion triggering, filtering, insertion 2026-01-31 15:41:51 +10:00
Matt Parker
934c75ece9 Add extra EventWrapper arity 2026-01-31 15:19:48 +10:00
Matt Parker
826fc851c3 rename class 2026-01-31 14:24:48 +10:00
Matt Parker
ac9462586d refactor v2 2026-01-31 14:23:18 +10:00
28 changed files with 338 additions and 267 deletions

View File

@@ -16,7 +16,7 @@ jobs:
- uses: actions/setup-dotnet@v5
- uses: chickensoft-games/setup-godot@v2
with:
version: 4.5.1
version: 4.6.0
use-dotnet: true
include-templates: true
- name: Determine If Release Necessary

View File

@@ -603,12 +603,14 @@ public partial class RoslynAnalysis(ILogger<RoslynAnalysis> logger, BuildService
// This may not be the best way to do this, but it seems to work okay. It may only be a problem because I continue to update the doc in the workspace as the user continues typing, filtering the completion
// I could possibly pause updating the document while the completion list is open, but that seems more complex - handling accepted vs cancelled completions etc
public record IdeCompletionListResult(Document Document, CompletionList CompletionList, LinePosition LinePosition);
public async Task<IdeCompletionListResult> GetCodeCompletionsForDocumentAtPosition(SharpIdeFile fileModel, LinePosition linePosition, CompletionTrigger completionTrigger)
public async Task<IdeCompletionListResult> GetCodeCompletionsForDocumentAtPosition(SharpIdeFile fileModel, string documentText, LinePosition linePosition, CompletionTrigger completionTrigger)
{
using var _ = SharpIdeOtel.Source.StartActivity($"{nameof(RoslynAnalysis)}.{nameof(GetCodeCompletionsForDocumentAtPosition)}");
await _solutionLoadedTcs.Task;
var document = await GetDocumentForSharpIdeFile(fileModel);
Guard.Against.Null(document, nameof(document));
// The document in the workspace may have been further updated since the completion request was made, so we need to fork a document with the text at the time of the completion request
document = document.WithText(SourceText.From(documentText, Encoding.UTF8));
var (completions, triggerLinePosition) = await GetCompletionsAsync(document, linePosition, completionTrigger).ConfigureAwait(false);
return new IdeCompletionListResult(document, completions, triggerLinePosition);
}
@@ -738,7 +740,6 @@ public partial class RoslynAnalysis(ILogger<RoslynAnalysis> logger, BuildService
return (completions, triggerLinePosition);
}
// Currently unused
public async Task<bool> ShouldTriggerCompletionAsync(SharpIdeFile file, string documentText, LinePosition linePosition, CompletionTrigger completionTrigger, CancellationToken cancellationToken = default)
{
await _solutionLoadedTcs.Task;
@@ -746,7 +747,6 @@ public partial class RoslynAnalysis(ILogger<RoslynAnalysis> logger, BuildService
var completionService = CompletionService.GetService(document);
if (completionService is null) throw new InvalidOperationException("Completion service is not available for the document.");
//var sourceText = await document.GetTextAsync(cancellationToken);
var sourceText = SourceText.From(documentText, Encoding.UTF8);
var position = sourceText.Lines.GetPosition(linePosition);
var shouldTrigger = completionService.ShouldTriggerCompletion(document.Project, document.Project.Services, sourceText, position, completionTrigger, CompletionOptions.Default, document.Project.Solution.Options ?? OptionSet.Empty);

View File

@@ -27,3 +27,12 @@ public class EventWrapper<TArg1, TArg2, TReturn>(Func<TArg1, TArg2, TReturn> @ev
await InvokeDelegatesAsync(Event.GetInvocationList(), del => ((Func<TArg1, TArg2, TReturn>)del)(arg, arg2));
}
}
public class EventWrapper<TArg1, TArg2, TArg3, TReturn>(Func<TArg1, TArg2, TArg3, TReturn> @event) : EventWrapperBase<Func<TArg1, TArg2, TArg3, TReturn>>(@event) where TReturn : Task
{
public void InvokeParallelFireAndForget(TArg1 arg1, TArg2 arg2, TArg3 arg3) => FireAndForget(() => InvokeParallelAsync(arg1, arg2, arg3));
public async Task InvokeParallelAsync(TArg1 arg, TArg2 arg2, TArg3 arg3)
{
await InvokeDelegatesAsync(Event.GetInvocationList(), del => ((Func<TArg1, TArg2, TArg3, TReturn>)del)(arg, arg2, arg3));
}
}

View File

@@ -303,45 +303,3 @@ public partial class CustomHighlighter : SyntaxHighlighter
return colour;
}
}
public static class CachedColors
{
public static readonly Color Orange = new("f27718");
public static readonly Color White = new("dcdcdc");
public static readonly Color Yellow = new("dcdcaa");
public static readonly Color CommentGreen = new("57a64a");
public static readonly Color KeywordBlue = new("569cd6");
public static readonly Color LightOrangeBrown = new("d69d85");
public static readonly Color NumberGreen = new("b5cea8");
public static readonly Color InterfaceGreen = new("b8d7a3");
public static readonly Color ClassGreen = new("4ec9b0");
public static readonly Color VariableBlue = new("9cdcfe");
public static readonly Color Gray = new("a9a9a9");
public static readonly Color Pink = new("c586c0");
public static readonly Color ErrorRed = new("da5b5a");
public static readonly Color RazorComponentGreen = new("0b7f7f");
public static readonly Color RazorMetaCodePurple = new("a699e6");
public static readonly Color HtmlDelimiterGray = new("808080");
}
public static class CachedColorsLight
{
public static readonly Color Orange = new("b776fb"); //
public static readonly Color White = new("000000"); //
public static readonly Color Yellow = new("74531f"); //
public static readonly Color CommentGreen = new("008000"); //
public static readonly Color KeywordBlue = new("0000ff"); //
public static readonly Color LightOrangeBrown = new("a31515"); //
public static readonly Color NumberGreen = new("000000"); //
public static readonly Color InterfaceGreen = new("2b91af"); //
public static readonly Color ClassGreen = new("2b91af"); //
public static readonly Color VariableBlue = new("1f377f"); //
public static readonly Color Gray = new("a9a9a9"); //
public static readonly Color Pink = new("c586c0"); //
public static readonly Color ErrorRed = new("da5b5a"); //
public static readonly Color RazorComponentGreen = new("0b7f7f");
public static readonly Color RazorMetaCodePurple = new("826ee6");
public static readonly Color HtmlDelimiterGray = new("808080");
}

View File

@@ -6,44 +6,44 @@ public static class EditorThemeColours
{
public static readonly EditorThemeColorSet Light = new EditorThemeColorSet
{
Orange = CachedColorsLight.Orange,
White = CachedColorsLight.White,
Yellow = CachedColorsLight.Yellow,
CommentGreen = CachedColorsLight.CommentGreen,
KeywordBlue = CachedColorsLight.KeywordBlue,
LightOrangeBrown = CachedColorsLight.LightOrangeBrown,
NumberGreen = CachedColorsLight.NumberGreen,
InterfaceGreen = CachedColorsLight.InterfaceGreen,
ClassGreen = CachedColorsLight.ClassGreen,
VariableBlue = CachedColorsLight.VariableBlue,
Gray = CachedColorsLight.Gray,
Pink = CachedColorsLight.Pink,
ErrorRed = CachedColorsLight.ErrorRed,
Orange = TextEditorDotnetColoursLight.Orange,
White = TextEditorDotnetColoursLight.White,
Yellow = TextEditorDotnetColoursLight.Yellow,
CommentGreen = TextEditorDotnetColoursLight.CommentGreen,
KeywordBlue = TextEditorDotnetColoursLight.KeywordBlue,
LightOrangeBrown = TextEditorDotnetColoursLight.LightOrangeBrown,
NumberGreen = TextEditorDotnetColoursLight.NumberGreen,
InterfaceGreen = TextEditorDotnetColoursLight.InterfaceGreen,
ClassGreen = TextEditorDotnetColoursLight.ClassGreen,
VariableBlue = TextEditorDotnetColoursLight.VariableBlue,
Gray = TextEditorDotnetColoursLight.Gray,
Pink = TextEditorDotnetColoursLight.Pink,
ErrorRed = TextEditorDotnetColoursLight.ErrorRed,
RazorComponentGreen = CachedColorsLight.RazorComponentGreen,
RazorMetaCodePurple = CachedColorsLight.RazorMetaCodePurple,
HtmlDelimiterGray = CachedColorsLight.HtmlDelimiterGray
RazorComponentGreen = TextEditorDotnetColoursLight.RazorComponentGreen,
RazorMetaCodePurple = TextEditorDotnetColoursLight.RazorMetaCodePurple,
HtmlDelimiterGray = TextEditorDotnetColoursLight.HtmlDelimiterGray
};
public static readonly EditorThemeColorSet Dark = new EditorThemeColorSet
{
Orange = CachedColors.Orange,
White = CachedColors.White,
Yellow = CachedColors.Yellow,
CommentGreen = CachedColors.CommentGreen,
KeywordBlue = CachedColors.KeywordBlue,
LightOrangeBrown = CachedColors.LightOrangeBrown,
NumberGreen = CachedColors.NumberGreen,
InterfaceGreen = CachedColors.InterfaceGreen,
ClassGreen = CachedColors.ClassGreen,
VariableBlue = CachedColors.VariableBlue,
Gray = CachedColors.Gray,
Pink = CachedColors.Pink,
ErrorRed = CachedColors.ErrorRed,
Orange = TextEditorDotnetColoursDark.Orange,
White = TextEditorDotnetColoursDark.White,
Yellow = TextEditorDotnetColoursDark.Yellow,
CommentGreen = TextEditorDotnetColoursDark.CommentGreen,
KeywordBlue = TextEditorDotnetColoursDark.KeywordBlue,
LightOrangeBrown = TextEditorDotnetColoursDark.LightOrangeBrown,
NumberGreen = TextEditorDotnetColoursDark.NumberGreen,
InterfaceGreen = TextEditorDotnetColoursDark.InterfaceGreen,
ClassGreen = TextEditorDotnetColoursDark.ClassGreen,
VariableBlue = TextEditorDotnetColoursDark.VariableBlue,
Gray = TextEditorDotnetColoursDark.Gray,
Pink = TextEditorDotnetColoursDark.Pink,
ErrorRed = TextEditorDotnetColoursDark.ErrorRed,
RazorComponentGreen = CachedColors.RazorComponentGreen,
RazorMetaCodePurple = CachedColors.RazorMetaCodePurple,
HtmlDelimiterGray = CachedColors.HtmlDelimiterGray
RazorComponentGreen = TextEditorDotnetColoursDark.RazorComponentGreen,
RazorMetaCodePurple = TextEditorDotnetColoursDark.RazorMetaCodePurple,
HtmlDelimiterGray = TextEditorDotnetColoursDark.HtmlDelimiterGray
};
}
@@ -66,4 +66,46 @@ public class EditorThemeColorSet
public required Color RazorComponentGreen;
public required Color RazorMetaCodePurple;
public required Color HtmlDelimiterGray;
}
public static class TextEditorDotnetColoursDark
{
public static readonly Color Orange = new("f27718");
public static readonly Color White = new("dcdcdc");
public static readonly Color Yellow = new("dcdcaa");
public static readonly Color CommentGreen = new("57a64a");
public static readonly Color KeywordBlue = new("569cd6");
public static readonly Color LightOrangeBrown = new("d69d85");
public static readonly Color NumberGreen = new("b5cea8");
public static readonly Color InterfaceGreen = new("b8d7a3");
public static readonly Color ClassGreen = new("4ec9b0");
public static readonly Color VariableBlue = new("9cdcfe");
public static readonly Color Gray = new("a9a9a9");
public static readonly Color Pink = new("c586c0");
public static readonly Color ErrorRed = new("da5b5a");
public static readonly Color RazorComponentGreen = new("0b7f7f");
public static readonly Color RazorMetaCodePurple = new("a699e6");
public static readonly Color HtmlDelimiterGray = new("808080");
}
public static class TextEditorDotnetColoursLight
{
public static readonly Color Orange = new("b776fb"); //
public static readonly Color White = new("000000"); //
public static readonly Color Yellow = new("74531f"); //
public static readonly Color CommentGreen = new("008000"); //
public static readonly Color KeywordBlue = new("0000ff"); //
public static readonly Color LightOrangeBrown = new("a31515"); //
public static readonly Color NumberGreen = new("000000"); //
public static readonly Color InterfaceGreen = new("2b91af"); //
public static readonly Color ClassGreen = new("2b91af"); //
public static readonly Color VariableBlue = new("1f377f"); //
public static readonly Color Gray = new("a9a9a9"); //
public static readonly Color Pink = new("c586c0"); //
public static readonly Color ErrorRed = new("da5b5a"); //
public static readonly Color RazorComponentGreen = new("0b7f7f");
public static readonly Color RazorMetaCodePurple = new("826ee6");
public static readonly Color HtmlDelimiterGray = new("808080");
}

View File

@@ -216,28 +216,30 @@ public partial class SharpIdeCodeEdit : CodeEdit
private void OnTextChanged()
{
var text = Text;
var pendingCompletionTrigger = _pendingCompletionTrigger;
_pendingCompletionTrigger = null;
var cursorPosition = GetCaretPosition();
_ = Task.GodotRun(async () =>
{
var __ = SharpIdeOtel.Source.StartActivity($"{nameof(SharpIdeCodeEdit)}.{nameof(OnTextChanged)}");
_currentFile.IsDirty.Value = true;
await _fileChangedService.SharpIdeFileChanged(_currentFile, Text, FileChangeType.IdeUnsavedChange);
await _fileChangedService.SharpIdeFileChanged(_currentFile, text, FileChangeType.IdeUnsavedChange);
if (pendingCompletionTrigger is not null)
{
var cursorPosition = GetCaretPosition();
_completionTrigger = pendingCompletionTrigger;
var linePosition = new LinePosition(cursorPosition.line, cursorPosition.col);
completionTrigger = pendingCompletionTrigger;
pendingCompletionTrigger = null;
var shouldTriggerCompletion = await _roslynAnalysis.ShouldTriggerCompletionAsync(_currentFile, Text, linePosition, completionTrigger!.Value);
GD.Print($"Code completion trigger typed: '{completionTrigger.Value.Character}' at {linePosition.Line}:{linePosition.Character} should trigger: {shouldTriggerCompletion}");
var shouldTriggerCompletion = await _roslynAnalysis.ShouldTriggerCompletionAsync(_currentFile, text, linePosition, _completionTrigger!.Value);
GD.Print($"Code completion trigger typed: '{_completionTrigger.Value.Character}' at {linePosition.Line}:{linePosition.Character} should trigger: {shouldTriggerCompletion}");
if (shouldTriggerCompletion)
{
await OnCodeCompletionRequested(completionTrigger.Value);
await OnCodeCompletionRequested(_completionTrigger.Value, text, cursorPosition);
}
}
else if (pendingCompletionFilterReason is not null)
else if (_pendingCompletionFilterReason is not null)
{
var filterReason = pendingCompletionFilterReason.Value;
pendingCompletionFilterReason = null;
var filterReason = _pendingCompletionFilterReason.Value;
_pendingCompletionFilterReason = null;
await CustomFilterCodeCompletionCandidates(filterReason);
}
__?.Dispose();

View File

@@ -67,12 +67,12 @@ public partial class SharpIdeCodeEdit
return texture;
}
private EventWrapper<CompletionTrigger, Task> CustomCodeCompletionRequested { get; } = new(_ => Task.CompletedTask);
private CompletionList? completionList;
private Document? completionResultDocument;
private CompletionTrigger? completionTrigger;
private CompletionTrigger? pendingCompletionTrigger;
private CompletionFilterReason? pendingCompletionFilterReason;
private EventWrapper<CompletionTrigger, string, (int,int), Task> CustomCodeCompletionRequested { get; } = new((_, _, _) => Task.CompletedTask);
private CompletionList? _completionList;
private Document? _completionResultDocument;
private CompletionTrigger? _completionTrigger;
private CompletionTrigger? _pendingCompletionTrigger;
private CompletionFilterReason? _pendingCompletionFilterReason;
private readonly List<string> _codeCompletionTriggers =
[
@@ -83,9 +83,9 @@ public partial class SharpIdeCodeEdit
private void ResetCompletionPopupState()
{
_codeCompletionOptions = ImmutableArray<SharpIdeCompletionItem>.Empty;
completionList = null;
completionResultDocument = null;
completionTrigger = null;
_completionList = null;
_completionResultDocument = null;
_completionTrigger = null;
_completionTriggerPosition = null;
_codeCompletionCurrentSelected = 0;
_codeCompletionForceItemCenter = -1;
@@ -93,47 +93,44 @@ public partial class SharpIdeCodeEdit
private async Task CustomFilterCodeCompletionCandidates(CompletionFilterReason filterReason)
{
if (completionList is null || completionList.ItemsList.Count is 0) return;
var cursorPosition = GetCaretPosition();
if (_completionList is null || _completionList.ItemsList.Count is 0) return;
var cursorPosition = await this.InvokeAsync(() => GetCaretPosition());
var linePosition = new LinePosition(cursorPosition.line, cursorPosition.col);
var filteredCompletions = RoslynAnalysis.FilterCompletions(_currentFile, Text, linePosition, completionList, completionTrigger!.Value, filterReason);
var filteredCompletions = RoslynAnalysis.FilterCompletions(_currentFile, Text, linePosition, _completionList, _completionTrigger!.Value, filterReason);
_codeCompletionOptions = filteredCompletions;
await this.InvokeAsync(QueueRedraw);
}
private async Task OnCodeCompletionRequested(CompletionTrigger completionTrigger)
private async Task OnCodeCompletionRequested(CompletionTrigger completionTrigger, string documentTextAtTimeOfCompletionRequest, (int, int) completionCaretPosition)
{
var (caretLine, caretColumn) = GetCaretPosition();
var (caretLine, caretColumn) = completionCaretPosition;
GD.Print($"Code completion requested at line {caretLine}, column {caretColumn}");
_ = Task.GodotRun(async () =>
{
var linePos = new LinePosition(caretLine, caretColumn);
var linePos = new LinePosition(caretLine, caretColumn);
var completionsResult = await _roslynAnalysis.GetCodeCompletionsForDocumentAtPosition(_currentFile, linePos, completionTrigger);
var completionsResult = await _roslynAnalysis.GetCodeCompletionsForDocumentAtPosition(_currentFile, documentTextAtTimeOfCompletionRequest, linePos, completionTrigger);
// We can't draw until we get this position
_completionTriggerPosition = await this.InvokeAsync(() => GetPosAtLineColumn(completionsResult.LinePosition.Line, completionsResult.LinePosition.Character));
// We can't draw until we get this position
_completionTriggerPosition = await this.InvokeAsync(() => GetPosAtLineColumn(completionsResult.LinePosition.Line, completionsResult.LinePosition.Character));
completionList = completionsResult.CompletionList;
completionResultDocument = completionsResult.Document;
var filterReason = completionTrigger.Kind switch
{
CompletionTriggerKind.Insertion => CompletionFilterReason.Insertion,
CompletionTriggerKind.Deletion => CompletionFilterReason.Deletion,
CompletionTriggerKind.InvokeAndCommitIfUnique => CompletionFilterReason.Other,
_ => throw new ArgumentOutOfRangeException(nameof(completionTrigger.Kind), completionTrigger.Kind, null),
};
await CustomFilterCodeCompletionCandidates(filterReason);
GD.Print($"Found {completionsResult.CompletionList.ItemsList.Count} completions, displaying menu");
});
_completionList = completionsResult.CompletionList;
_completionResultDocument = completionsResult.Document;
var filterReason = completionTrigger.Kind switch
{
CompletionTriggerKind.Insertion => CompletionFilterReason.Insertion,
CompletionTriggerKind.Deletion => CompletionFilterReason.Deletion,
CompletionTriggerKind.InvokeAndCommitIfUnique => CompletionFilterReason.Other,
_ => throw new ArgumentOutOfRangeException(nameof(completionTrigger.Kind), completionTrigger.Kind, null),
};
await CustomFilterCodeCompletionCandidates(filterReason);
GD.Print($"Found {completionsResult.CompletionList.ItemsList.Count} completions, displaying menu");
}
public void ApplySelectedCodeCompletion()
{
var selectedIndex = _codeCompletionCurrentSelected;
var completionItem = _codeCompletionOptions[selectedIndex];
var document = completionResultDocument;
var document = _completionResultDocument;
_ = Task.GodotRun(async () =>
{
Guard.Against.Null(document);

View File

@@ -14,8 +14,8 @@ public partial class SharpIdeCodeEdit
{
if (@event.IsActionPressed(InputStringNames.CodeEditorRequestCompletions))
{
completionTrigger = new CompletionTrigger(CompletionTriggerKind.InvokeAndCommitIfUnique);
CustomCodeCompletionRequested.InvokeParallelFireAndForget(completionTrigger!.Value);
_completionTrigger = new CompletionTrigger(CompletionTriggerKind.InvokeAndCommitIfUnique);
CustomCodeCompletionRequested.InvokeParallelFireAndForget(_completionTrigger!.Value, Text, GetCaretPosition());
return true;
}
}
@@ -67,7 +67,7 @@ public partial class SharpIdeCodeEdit
}
else if (@event.IsActionPressed(InputStringNames.Backspace))
{
pendingCompletionFilterReason = CompletionFilterReason.Deletion;
_pendingCompletionFilterReason = CompletionFilterReason.Deletion;
return false;
}
@@ -104,13 +104,13 @@ public partial class SharpIdeCodeEdit
var unicodeString = char.ConvertFromUtf32((int)keyEvent.Unicode);
if (isCodeCompletionPopupOpen && keyEvent.Unicode >= 32)
{
pendingCompletionFilterReason = CompletionFilterReason.Insertion;
_pendingCompletionFilterReason = CompletionFilterReason.Insertion;
return false; // Let the text update happen
}
if (isCodeCompletionPopupOpen is false && _codeCompletionTriggers.Contains(unicodeString, StringComparer.OrdinalIgnoreCase))
{
pendingCompletionTrigger = CompletionTrigger.CreateInsertionTrigger(unicodeString[0]);
_pendingCompletionTrigger = CompletionTrigger.CreateInsertionTrigger(unicodeString[0]);
return false;
}
}

View File

@@ -13,7 +13,7 @@ public static partial class SymbolInfoComponents
public static RichTextLabel GetUnknownTooltip(ISymbol symbol)
{
var label = new RichTextLabel();
label.PushColor(CachedColors.White);
label.PushColor(TextEditorDotnetColoursDark.White);
label.PushFont(MonospaceFont);
label.AddText($"UNHANDLED SYMBOL TYPE: {symbol.GetType().Name} - please create an issue!");
label.Newline();
@@ -44,7 +44,7 @@ public static partial class SymbolInfoComponents
private static void AddAccessibilityModifier(this RichTextLabel label, ISymbol methodSymbol)
{
label.PushColor(CachedColors.KeywordBlue);
label.PushColor(TextEditorDotnetColoursDark.KeywordBlue);
label.AddText(methodSymbol.DeclaredAccessibility.GetAccessibilityString());
label.Pop();
}
@@ -53,7 +53,7 @@ public static partial class SymbolInfoComponents
{
if (symbol.IsSealed)
{
label.PushColor(CachedColors.KeywordBlue);
label.PushColor(TextEditorDotnetColoursDark.KeywordBlue);
label.AddText("sealed");
label.Pop();
label.AddText(" ");
@@ -64,7 +64,7 @@ public static partial class SymbolInfoComponents
{
if (methodSymbol.IsOverride)
{
label.PushColor(CachedColors.KeywordBlue);
label.PushColor(TextEditorDotnetColoursDark.KeywordBlue);
label.AddText("override");
label.Pop();
label.AddText(" ");
@@ -76,7 +76,7 @@ public static partial class SymbolInfoComponents
if (symbol is INamedTypeSymbol { TypeKind: TypeKind.Interface }) return;
if (symbol.IsAbstract)
{
label.PushColor(CachedColors.KeywordBlue);
label.PushColor(TextEditorDotnetColoursDark.KeywordBlue);
label.AddText("abstract");
label.Pop();
label.AddText(" ");
@@ -87,7 +87,7 @@ public static partial class SymbolInfoComponents
{
if (methodSymbol.IsVirtual)
{
label.PushColor(CachedColors.KeywordBlue);
label.PushColor(TextEditorDotnetColoursDark.KeywordBlue);
label.AddText("virtual");
label.Pop();
label.AddText(" ");
@@ -141,7 +141,7 @@ public static partial class SymbolInfoComponents
foreach (var (index, ns) in namespaces.Index())
{
label.PushColor(CachedColors.KeywordBlue);
label.PushColor(TextEditorDotnetColoursDark.KeywordBlue);
label.AddText(ns);
label.Pop();
if (index < namespaces.Length - 1) label.AddText(".");
@@ -151,7 +151,7 @@ public static partial class SymbolInfoComponents
private static void AddAttribute(this RichTextLabel label, AttributeData attribute, bool newLines)
{
label.AddText("[");
label.PushColor(CachedColors.ClassGreen);
label.PushColor(TextEditorDotnetColoursDark.ClassGreen);
var displayString = attribute.AttributeClass?.ToDisplayString(SymbolDisplayFormat.MinimallyQualifiedFormat);
if (displayString?.EndsWith("Attribute") is true) displayString = displayString[..^9]; // remove last 9 chars
label.AddText(displayString ?? "unknown");
@@ -167,13 +167,13 @@ public static partial class SymbolInfoComponents
var typeChar = metadataName[0];
var typeColour = typeChar switch
{
'N' => CachedColors.KeywordBlue,
'T' => CachedColors.ClassGreen,
'F' => CachedColors.White,
'P' => CachedColors.White,
'M' => CachedColors.Yellow,
'E' => CachedColors.White,
_ => CachedColors.Orange
'N' => TextEditorDotnetColoursDark.KeywordBlue,
'T' => TextEditorDotnetColoursDark.ClassGreen,
'F' => TextEditorDotnetColoursDark.White,
'P' => TextEditorDotnetColoursDark.White,
'M' => TextEditorDotnetColoursDark.Yellow,
'E' => TextEditorDotnetColoursDark.White,
_ => TextEditorDotnetColoursDark.Orange
};
var minimalTypeName = (typeChar, metadataName) switch
{
@@ -222,7 +222,7 @@ public static partial class SymbolInfoComponents
var name = reader.GetAttribute(DocumentationCommentXmlNames.NameAttributeName);
if (name is not null)
{
label.PushColor(CachedColors.ClassGreen);
label.PushColor(TextEditorDotnetColoursDark.ClassGreen);
label.AddText(name);
label.Pop();
}
@@ -232,7 +232,7 @@ public static partial class SymbolInfoComponents
var name = reader.GetAttribute(DocumentationCommentXmlNames.NameAttributeName);
if (name is not null)
{
label.PushColor(CachedColors.VariableBlue);
label.PushColor(TextEditorDotnetColoursDark.VariableBlue);
label.AddText(name);
label.Pop();
}
@@ -242,7 +242,7 @@ public static partial class SymbolInfoComponents
var nameOrCref = reader.GetAttribute(DocumentationCommentXmlNames.CrefAttributeName) ?? reader.GetAttribute(DocumentationCommentXmlNames.NameAttributeName);
if (nameOrCref is not null)
{
label.PushColor(CachedColors.White);
label.PushColor(TextEditorDotnetColoursDark.White);
label.AddText(nameOrCref);
label.Pop();
}
@@ -270,7 +270,7 @@ public static partial class SymbolInfoComponents
if (docComment.ParameterNames.Length is not 0)
{
label.PushCell();
label.PushColor(CachedColors.Gray);
label.PushColor(TextEditorDotnetColoursDark.Gray);
label.AddText("Params: ");
label.Pop();
label.Pop();
@@ -279,7 +279,7 @@ public static partial class SymbolInfoComponents
var parameterText = docComment.GetParameterText(parameterName);
if (parameterText is null) continue;
label.PushCell();
label.PushColor(CachedColors.VariableBlue);
label.PushColor(TextEditorDotnetColoursDark.VariableBlue);
label.AddText(parameterName);
label.Pop();
label.AddText(" - ");
@@ -296,7 +296,7 @@ public static partial class SymbolInfoComponents
if (docComment.TypeParameterNames.Length is not 0)
{
label.PushCell();
label.PushColor(CachedColors.Gray);
label.PushColor(TextEditorDotnetColoursDark.Gray);
label.AddText("Type Params: ");
label.Pop();
label.Pop();
@@ -305,7 +305,7 @@ public static partial class SymbolInfoComponents
var typeParameterText = docComment.GetTypeParameterText(typeParameterName);
if (typeParameterText is null) continue;
label.PushCell();
label.PushColor(CachedColors.ClassGreen);
label.PushColor(TextEditorDotnetColoursDark.ClassGreen);
label.AddText(typeParameterName);
label.Pop();
label.AddText(" - ");
@@ -321,7 +321,7 @@ public static partial class SymbolInfoComponents
if (docComment.ReturnsText is not null)
{
label.PushCell();
label.PushColor(CachedColors.Gray);
label.PushColor(TextEditorDotnetColoursDark.Gray);
label.AddText("Returns: ");
label.Pop();
label.Pop();
@@ -333,7 +333,7 @@ public static partial class SymbolInfoComponents
if (docComment.ExceptionTypes.Length is not 0)
{
label.PushCell();
label.PushColor(CachedColors.Gray);
label.PushColor(TextEditorDotnetColoursDark.Gray);
label.AddText("Exceptions: ");
label.Pop();
label.Pop();
@@ -342,7 +342,7 @@ public static partial class SymbolInfoComponents
var exceptionText = docComment.GetExceptionTexts(exceptionTypeName).FirstOrDefault();
if (exceptionText is null) continue;
label.PushCell();
label.PushColor(CachedColors.ClassGreen);
label.PushColor(TextEditorDotnetColoursDark.ClassGreen);
label.AddText(exceptionTypeName.Split('.').Last());
label.Pop();
label.AddText(" - ");
@@ -359,7 +359,7 @@ public static partial class SymbolInfoComponents
if (docComment.RemarksText is not null)
{
label.PushCell();
label.PushColor(CachedColors.Gray);
label.PushColor(TextEditorDotnetColoursDark.Gray);
label.AddText("Remarks: ");
label.Pop();
label.Pop();
@@ -389,7 +389,7 @@ public static partial class SymbolInfoComponents
private static RichTextLabel AddUnknownType(this RichTextLabel label, ITypeSymbol symbol)
{
label.PushColor(CachedColors.Orange);
label.PushColor(TextEditorDotnetColoursDark.Orange);
label.AddText("[UNKNOWN TYPE]");
label.AddText(symbol.ToDisplayString(SymbolDisplayFormat.MinimallyQualifiedFormat));
label.Pop();
@@ -443,7 +443,7 @@ public static partial class SymbolInfoComponents
private static RichTextLabel AddTypeParameter(this RichTextLabel label, ITypeParameterSymbol symbol)
{
label.PushColor(CachedColors.ClassGreen);
label.PushColor(TextEditorDotnetColoursDark.ClassGreen);
label.AddText(symbol.Name);
label.Pop();
return label;
@@ -451,7 +451,7 @@ public static partial class SymbolInfoComponents
private static RichTextLabel AddDynamicType(this RichTextLabel label, IDynamicTypeSymbol symbol)
{
label.PushColor(CachedColors.KeywordBlue);
label.PushColor(TextEditorDotnetColoursDark.KeywordBlue);
label.AddText(symbol.Name);
label.Pop();
return label;
@@ -464,29 +464,29 @@ public static partial class SymbolInfoComponents
{
{SpecialType: not SpecialType.None} => symbol.SpecialType switch
{
SpecialType.System_Collections_IEnumerable => CachedColors.InterfaceGreen,
SpecialType.System_Collections_Generic_IEnumerable_T => CachedColors.InterfaceGreen,
SpecialType.System_Collections_Generic_IList_T => CachedColors.InterfaceGreen,
SpecialType.System_Collections_Generic_ICollection_T => CachedColors.InterfaceGreen,
SpecialType.System_Collections_IEnumerator => CachedColors.InterfaceGreen,
SpecialType.System_Collections_Generic_IEnumerator_T => CachedColors.InterfaceGreen,
SpecialType.System_Collections_Generic_IReadOnlyList_T => CachedColors.InterfaceGreen,
SpecialType.System_Collections_Generic_IReadOnlyCollection_T => CachedColors.InterfaceGreen,
SpecialType.System_IDisposable => CachedColors.InterfaceGreen,
SpecialType.System_IAsyncResult => CachedColors.InterfaceGreen,
_ => CachedColors.KeywordBlue
SpecialType.System_Collections_IEnumerable => TextEditorDotnetColoursDark.InterfaceGreen,
SpecialType.System_Collections_Generic_IEnumerable_T => TextEditorDotnetColoursDark.InterfaceGreen,
SpecialType.System_Collections_Generic_IList_T => TextEditorDotnetColoursDark.InterfaceGreen,
SpecialType.System_Collections_Generic_ICollection_T => TextEditorDotnetColoursDark.InterfaceGreen,
SpecialType.System_Collections_IEnumerator => TextEditorDotnetColoursDark.InterfaceGreen,
SpecialType.System_Collections_Generic_IEnumerator_T => TextEditorDotnetColoursDark.InterfaceGreen,
SpecialType.System_Collections_Generic_IReadOnlyList_T => TextEditorDotnetColoursDark.InterfaceGreen,
SpecialType.System_Collections_Generic_IReadOnlyCollection_T => TextEditorDotnetColoursDark.InterfaceGreen,
SpecialType.System_IDisposable => TextEditorDotnetColoursDark.InterfaceGreen,
SpecialType.System_IAsyncResult => TextEditorDotnetColoursDark.InterfaceGreen,
_ => TextEditorDotnetColoursDark.KeywordBlue
},
INamedTypeSymbol namedTypeSymbol => namedTypeSymbol.TypeKind switch
{
TypeKind.Class => CachedColors.ClassGreen,
TypeKind.Interface => CachedColors.InterfaceGreen,
TypeKind.Struct => CachedColors.ClassGreen,
TypeKind.Enum => CachedColors.InterfaceGreen,
TypeKind.Delegate => CachedColors.ClassGreen,
TypeKind.Dynamic => CachedColors.KeywordBlue,
_ => CachedColors.Orange
TypeKind.Class => TextEditorDotnetColoursDark.ClassGreen,
TypeKind.Interface => TextEditorDotnetColoursDark.InterfaceGreen,
TypeKind.Struct => TextEditorDotnetColoursDark.ClassGreen,
TypeKind.Enum => TextEditorDotnetColoursDark.InterfaceGreen,
TypeKind.Delegate => TextEditorDotnetColoursDark.ClassGreen,
TypeKind.Dynamic => TextEditorDotnetColoursDark.KeywordBlue,
_ => TextEditorDotnetColoursDark.Orange
},
_ => CachedColors.Orange
_ => TextEditorDotnetColoursDark.Orange
};
return colour;
}

View File

@@ -8,7 +8,7 @@ public static partial class SymbolInfoComponents
public static RichTextLabel GetDiagnostic(SharpIdeDiagnostic diagnostic)
{
var label = new RichTextLabel();
label.PushColor(CachedColors.White);
label.PushColor(TextEditorDotnetColoursDark.White);
label.PushFontSize(14);
label.AddText(diagnostic.Diagnostic.GetMessage());
label.Pop();

View File

@@ -9,7 +9,7 @@ public static partial class SymbolInfoComponents
public static RichTextLabel GetDiscardSymbolInfo(IDiscardSymbol symbol)
{
var label = new RichTextLabel();
label.PushColor(CachedColors.White);
label.PushColor(TextEditorDotnetColoursDark.White);
label.PushFont(MonospaceFont);
label.AddText("discard ");
label.AddType(symbol.Type);
@@ -22,7 +22,7 @@ public static partial class SymbolInfoComponents
private static void AddDiscard(this RichTextLabel label, IDiscardSymbol _)
{
label.PushColor(CachedColors.VariableBlue);
label.PushColor(TextEditorDotnetColoursDark.VariableBlue);
label.AddText("_");
label.Pop();
}

View File

@@ -9,9 +9,9 @@ public static partial class SymbolInfoComponents
public static RichTextLabel GetDynamicTypeSymbolInfo(IDynamicTypeSymbol symbol)
{
var label = new RichTextLabel();
label.PushColor(CachedColors.White);
label.PushColor(TextEditorDotnetColoursDark.White);
label.PushFont(MonospaceFont);
label.PushColor(CachedColors.KeywordBlue);
label.PushColor(TextEditorDotnetColoursDark.KeywordBlue);
label.AddText(symbol.ToDisplayString());
label.Pop();
label.Pop();

View File

@@ -15,12 +15,12 @@ public static partial class SymbolInfoComponents
}
var label = new RichTextLabel();
label.PushColor(CachedColors.White);
label.PushColor(TextEditorDotnetColoursDark.White);
label.PushFont(MonospaceFont);
label.AddAttributes(symbol);
label.AddFieldName(symbol);
label.AddText(" = ");
label.PushColor(CachedColors.NumberGreen);
label.PushColor(TextEditorDotnetColoursDark.NumberGreen);
label.AddText($"{symbol.ConstantValue}");
label.Pop();
label.AddText(";");

View File

@@ -9,7 +9,7 @@ public static partial class SymbolInfoComponents
public static RichTextLabel GetEventSymbolInfo(IEventSymbol symbol)
{
var label = new RichTextLabel();
label.PushColor(CachedColors.White);
label.PushColor(TextEditorDotnetColoursDark.White);
label.PushFont(MonospaceFont);
label.AddAccessibilityModifier(symbol);
label.AddEventKeyword(symbol);
@@ -26,7 +26,7 @@ public static partial class SymbolInfoComponents
private static void AddEventKeyword(this RichTextLabel label, IEventSymbol symbol)
{
label.PushColor(CachedColors.KeywordBlue);
label.PushColor(TextEditorDotnetColoursDark.KeywordBlue);
label.AddText("event ");
label.Pop();
}
@@ -39,7 +39,7 @@ public static partial class SymbolInfoComponents
private static void AddEventName(this RichTextLabel label, IEventSymbol symbol)
{
label.PushColor(CachedColors.White);
label.PushColor(TextEditorDotnetColoursDark.White);
label.AddText(symbol.Name);
label.Pop();
}
@@ -47,11 +47,11 @@ public static partial class SymbolInfoComponents
private static void AddEventMethods(this RichTextLabel label, IEventSymbol symbol)
{
label.AddText(" { ");
label.PushColor(CachedColors.KeywordBlue);
label.PushColor(TextEditorDotnetColoursDark.KeywordBlue);
label.AddText("add");
label.Pop();
label.AddText("; ");
label.PushColor(CachedColors.KeywordBlue);
label.PushColor(TextEditorDotnetColoursDark.KeywordBlue);
label.AddText("remove");
label.Pop();
label.AddText("; }");

View File

@@ -8,7 +8,7 @@ public static partial class SymbolInfoComponents
public static RichTextLabel GetFieldSymbolInfo(IFieldSymbol symbol)
{
var label = new RichTextLabel();
label.PushColor(CachedColors.White);
label.PushColor(TextEditorDotnetColoursDark.White);
label.PushFont(MonospaceFont);
label.AddAttributes(symbol);
label.AddAccessibilityModifier(symbol);
@@ -35,7 +35,7 @@ public static partial class SymbolInfoComponents
{
if (symbol.IsStatic)
{
label.PushColor(CachedColors.KeywordBlue);
label.PushColor(TextEditorDotnetColoursDark.KeywordBlue);
label.AddText("static");
label.Pop();
label.AddText(" ");
@@ -46,7 +46,7 @@ public static partial class SymbolInfoComponents
{
if (fieldSymbol.IsReadOnly)
{
label.PushColor(CachedColors.KeywordBlue);
label.PushColor(TextEditorDotnetColoursDark.KeywordBlue);
label.AddText("readonly");
label.Pop();
label.AddText(" ");
@@ -57,7 +57,7 @@ public static partial class SymbolInfoComponents
{
if (symbol.IsRequired)
{
label.PushColor(CachedColors.KeywordBlue);
label.PushColor(TextEditorDotnetColoursDark.KeywordBlue);
label.AddText("required");
label.Pop();
label.AddText(" ");
@@ -72,7 +72,7 @@ public static partial class SymbolInfoComponents
private static void AddFieldName(this RichTextLabel label, IFieldSymbol fieldSymbol)
{
label.PushColor(CachedColors.White);
label.PushColor(TextEditorDotnetColoursDark.White);
label.AddText(fieldSymbol.Name);
label.Pop();
}

View File

@@ -9,7 +9,7 @@ public static partial class SymbolInfoComponents
public static RichTextLabel GetLabelSymbolInfo(ILabelSymbol symbol)
{
var label = new RichTextLabel();
label.PushColor(CachedColors.White);
label.PushColor(TextEditorDotnetColoursDark.White);
label.PushFont(MonospaceFont);
label.AddText("label ");
label.AddLabelName(symbol);
@@ -20,7 +20,7 @@ public static partial class SymbolInfoComponents
private static void AddLabelName(this RichTextLabel label, ILabelSymbol symbol)
{
label.PushColor(CachedColors.White);
label.PushColor(TextEditorDotnetColoursDark.White);
label.AddText(symbol.Name);
label.Pop();
}

View File

@@ -8,7 +8,7 @@ public static partial class SymbolInfoComponents
public static RichTextLabel GetLocalVariableSymbolInfo(ILocalSymbol symbol)
{
var label = new RichTextLabel();
label.PushColor(CachedColors.White);
label.PushColor(TextEditorDotnetColoursDark.White);
label.PushFont(MonospaceFont);
label.AddAttributes(symbol);
label.AddText("local variable ");
@@ -35,7 +35,7 @@ public static partial class SymbolInfoComponents
private static void AddLocalVariableName(this RichTextLabel label, ILocalSymbol symbol)
{
label.PushColor(CachedColors.VariableBlue);
label.PushColor(TextEditorDotnetColoursDark.VariableBlue);
label.AddText(symbol.Name);
label.Pop();
}

View File

@@ -10,7 +10,7 @@ public static partial class SymbolInfoComponents
public static RichTextLabel GetMethodSymbolInfo(IMethodSymbol methodSymbol)
{
var label = new RichTextLabel();
label.PushColor(CachedColors.White);
label.PushColor(TextEditorDotnetColoursDark.White);
label.PushFont(MonospaceFont);
label.AddAttributes(methodSymbol);
label.AddAccessibilityModifier(methodSymbol);
@@ -41,7 +41,7 @@ public static partial class SymbolInfoComponents
{
if (methodSymbol.IsStatic || methodSymbol.ReducedFrom?.IsStatic is true)
{
label.PushColor(CachedColors.KeywordBlue);
label.PushColor(TextEditorDotnetColoursDark.KeywordBlue);
label.AddText("static");
label.Pop();
label.AddText(" ");
@@ -52,7 +52,7 @@ public static partial class SymbolInfoComponents
{
if (methodSymbol.IsAsync)
{
label.PushColor(CachedColors.KeywordBlue);
label.PushColor(TextEditorDotnetColoursDark.KeywordBlue);
label.AddText("async");
label.Pop();
label.AddText(" ");
@@ -63,7 +63,7 @@ public static partial class SymbolInfoComponents
{
if (methodSymbol.ReturnsVoid)
{
label.PushColor(CachedColors.KeywordBlue);
label.PushColor(TextEditorDotnetColoursDark.KeywordBlue);
label.AddText("void");
label.Pop();
return;
@@ -74,7 +74,7 @@ public static partial class SymbolInfoComponents
private static void AddMethodName(this RichTextLabel label, IMethodSymbol methodSymbol)
{
label.PushColor(CachedColors.Yellow);
label.PushColor(TextEditorDotnetColoursDark.Yellow);
label.AddText(methodSymbol.Name);
label.Pop();
}
@@ -82,12 +82,12 @@ public static partial class SymbolInfoComponents
private static void AddTypeParameters(this RichTextLabel label, IMethodSymbol methodSymbol)
{
if (methodSymbol.TypeParameters.Length == 0) return;
label.PushColor(CachedColors.White);
label.PushColor(TextEditorDotnetColoursDark.White);
label.AddText("<");
label.Pop();
foreach (var (index, typeParameter) in methodSymbol.TypeParameters.Index())
{
label.PushColor(CachedColors.ClassGreen);
label.PushColor(TextEditorDotnetColoursDark.ClassGreen);
label.AddText(typeParameter.Name);
label.Pop();
if (index < methodSymbol.TypeParameters.Length - 1)
@@ -95,7 +95,7 @@ public static partial class SymbolInfoComponents
label.AddText(", ");
}
}
label.PushColor(CachedColors.White);
label.PushColor(TextEditorDotnetColoursDark.White);
label.AddText(">");
label.Pop();
}
@@ -104,7 +104,7 @@ public static partial class SymbolInfoComponents
{
if (methodSymbol.IsExtensionMethod)
{
label.PushColor(CachedColors.KeywordBlue);
label.PushColor(TextEditorDotnetColoursDark.KeywordBlue);
label.AddText("this");
label.Pop();
label.AddText(" ");
@@ -123,21 +123,21 @@ public static partial class SymbolInfoComponents
}
if (parameterSymbol.RefKind != RefKind.None) // ref, in, out
{
label.PushColor(CachedColors.KeywordBlue);
label.PushColor(TextEditorDotnetColoursDark.KeywordBlue);
label.AddText(parameterSymbol.RefKind.ToString().ToLower());
label.Pop();
label.AddText(" ");
}
else if (parameterSymbol.IsParams)
{
label.PushColor(CachedColors.KeywordBlue);
label.PushColor(TextEditorDotnetColoursDark.KeywordBlue);
label.AddText("params");
label.Pop();
label.AddText(" ");
}
label.AddType(parameterSymbol.Type);
label.AddText(" ");
label.PushColor(CachedColors.VariableBlue);
label.PushColor(TextEditorDotnetColoursDark.VariableBlue);
label.AddText(parameterSymbol.Name);
label.Pop();
// default value
@@ -146,7 +146,7 @@ public static partial class SymbolInfoComponents
label.AddText(" = ");
if (parameterSymbol.ExplicitDefaultValue is null)
{
label.PushColor(CachedColors.KeywordBlue);
label.PushColor(TextEditorDotnetColoursDark.KeywordBlue);
label.AddText("null");
label.Pop();
}
@@ -160,19 +160,19 @@ public static partial class SymbolInfoComponents
if (enumMember != null)
{
label.PushColor(CachedColors.InterfaceGreen);
label.PushColor(TextEditorDotnetColoursDark.InterfaceGreen);
label.AddText(parameterSymbol.Type.Name);
label.Pop();
label.PushColor(CachedColors.White);
label.PushColor(TextEditorDotnetColoursDark.White);
label.AddText(".");
label.Pop();
label.PushColor(CachedColors.White);
label.PushColor(TextEditorDotnetColoursDark.White);
label.AddText(enumMember.Name);
label.Pop();
}
else
{
label.PushColor(CachedColors.InterfaceGreen);
label.PushColor(TextEditorDotnetColoursDark.InterfaceGreen);
label.AddText(parameterSymbol.Type.Name);
label.Pop();
label.AddText($"({explicitDefaultValue})");
@@ -180,7 +180,7 @@ public static partial class SymbolInfoComponents
}
else if (parameterSymbol.ExplicitDefaultValue is string str)
{
label.PushColor(CachedColors.LightOrangeBrown);
label.PushColor(TextEditorDotnetColoursDark.LightOrangeBrown);
label.AddText($"""
"{str}"
""");
@@ -188,7 +188,7 @@ public static partial class SymbolInfoComponents
}
else if (parameterSymbol.ExplicitDefaultValue is bool b)
{
label.PushColor(CachedColors.KeywordBlue);
label.PushColor(TextEditorDotnetColoursDark.KeywordBlue);
label.AddText(b ? "true" : "false");
label.Pop();
}
@@ -214,7 +214,7 @@ public static partial class SymbolInfoComponents
if (typeParameters.Length != typeArguments.Length) throw new Exception("Type parameters and type arguments length mismatch.");
foreach (var (index, (typeArgument, typeParameter)) in methodSymbol.TypeArguments.Zip(typeParameters).Index())
{
label.PushColor(CachedColors.ClassGreen);
label.PushColor(TextEditorDotnetColoursDark.ClassGreen);
label.AddType(typeParameter);
label.Pop();
label.AddText(" is ");
@@ -234,7 +234,7 @@ public static partial class SymbolInfoComponents
if (hasConstraints is false) continue;
label.AddText(" ");
label.PushColor(CachedColors.KeywordBlue);
label.PushColor(TextEditorDotnetColoursDark.KeywordBlue);
label.AddText("where");
label.Pop();
label.AddText(" ");
@@ -244,7 +244,7 @@ public static partial class SymbolInfoComponents
if (typeParameter.HasReferenceTypeConstraint)
{
label.PushColor(CachedColors.KeywordBlue);
label.PushColor(TextEditorDotnetColoursDark.KeywordBlue);
label.AddText("class");
label.Pop();
}
@@ -252,7 +252,7 @@ public static partial class SymbolInfoComponents
if (typeParameter.HasValueTypeConstraint)
{
MaybeAddComma();
label.PushColor(CachedColors.KeywordBlue);
label.PushColor(TextEditorDotnetColoursDark.KeywordBlue);
label.AddText("struct");
label.Pop();
}
@@ -260,7 +260,7 @@ public static partial class SymbolInfoComponents
if (typeParameter.HasUnmanagedTypeConstraint)
{
MaybeAddComma();
label.PushColor(CachedColors.KeywordBlue);
label.PushColor(TextEditorDotnetColoursDark.KeywordBlue);
label.AddText("unmanaged");
label.Pop();
}
@@ -268,7 +268,7 @@ public static partial class SymbolInfoComponents
if (typeParameter.HasNotNullConstraint)
{
MaybeAddComma();
label.PushColor(CachedColors.KeywordBlue);
label.PushColor(TextEditorDotnetColoursDark.KeywordBlue);
label.AddText("notnull");
label.Pop();
}
@@ -282,7 +282,7 @@ public static partial class SymbolInfoComponents
if (typeParameter.HasConstructorConstraint)
{
MaybeAddComma();
label.PushColor(CachedColors.KeywordBlue);
label.PushColor(TextEditorDotnetColoursDark.KeywordBlue);
label.AddText("new");
label.Pop();
label.AddText("()");
@@ -291,7 +291,7 @@ public static partial class SymbolInfoComponents
if (typeParameter.AllowsRefLikeType)
{
MaybeAddComma();
label.PushColor(CachedColors.KeywordBlue);
label.PushColor(TextEditorDotnetColoursDark.KeywordBlue);
label.AddText("allows ref struct");
label.Pop();
}

View File

@@ -8,7 +8,7 @@ public static partial class SymbolInfoComponents
public static RichTextLabel GetNamedTypeSymbolInfo(INamedTypeSymbol symbol)
{
var label = new RichTextLabel();
label.PushColor(CachedColors.White);
label.PushColor(TextEditorDotnetColoursDark.White);
label.PushFont(MonospaceFont);
label.AddAttributes(symbol);
label.AddAccessibilityModifier(symbol);
@@ -39,7 +39,7 @@ public static partial class SymbolInfoComponents
private static void AddNamedTypeSymbolType(this RichTextLabel label, INamedTypeSymbol symbol)
{
label.PushColor(CachedColors.KeywordBlue);
label.PushColor(TextEditorDotnetColoursDark.KeywordBlue);
label.AddText(GetNamedTypeSymbolTypeName(symbol));
label.Pop();
label.AddText(" ");
@@ -80,7 +80,7 @@ public static partial class SymbolInfoComponents
if (containingModule is not null)
{
label.Newline();
label.PushColor(CachedColors.White);
label.PushColor(TextEditorDotnetColoursDark.White);
label.AddText($"from module {containingModule.Name}");
label.Pop();
}
@@ -90,7 +90,7 @@ public static partial class SymbolInfoComponents
{
if (symbol.IsReadOnly)
{
label.PushColor(CachedColors.KeywordBlue);
label.PushColor(TextEditorDotnetColoursDark.KeywordBlue);
label.AddText("readonly");
label.Pop();
label.AddText(" ");

View File

@@ -9,9 +9,9 @@ public static partial class SymbolInfoComponents
public static RichTextLabel GetNamespaceSymbolInfo(INamespaceSymbol symbol)
{
var label = new RichTextLabel();
label.PushColor(CachedColors.White);
label.PushColor(TextEditorDotnetColoursDark.White);
label.PushFont(MonospaceFont);
label.PushColor(CachedColors.KeywordBlue);
label.PushColor(TextEditorDotnetColoursDark.KeywordBlue);
label.AddText("namespace");
label.Pop(); // color
label.AddText(" ");

View File

@@ -8,7 +8,7 @@ public static partial class SymbolInfoComponents
public static RichTextLabel GetParameterSymbolInfo(IParameterSymbol symbol)
{
var label = new RichTextLabel();
label.PushColor(CachedColors.White);
label.PushColor(TextEditorDotnetColoursDark.White);
label.PushFont(MonospaceFont);
label.AddAttributes(symbol);
label.AddText("parameter ");
@@ -37,7 +37,7 @@ public static partial class SymbolInfoComponents
private static void AddParameterName(this RichTextLabel label, IParameterSymbol symbol)
{
label.PushColor(CachedColors.VariableBlue);
label.PushColor(TextEditorDotnetColoursDark.VariableBlue);
label.AddText(symbol.Name);
label.Pop();
}

View File

@@ -8,7 +8,7 @@ public partial class SymbolInfoComponents
public static RichTextLabel GetPropertySymbolInfo(IPropertySymbol symbol)
{
var label = new RichTextLabel();
label.PushColor(CachedColors.White);
label.PushColor(TextEditorDotnetColoursDark.White);
label.PushFont(MonospaceFont);
label.AddAttributes(symbol);
label.AddAccessibilityModifier(symbol);
@@ -35,7 +35,7 @@ public partial class SymbolInfoComponents
{
if (symbol.IsReadOnly)
{
label.PushColor(CachedColors.KeywordBlue);
label.PushColor(TextEditorDotnetColoursDark.KeywordBlue);
label.AddText("readonly");
label.Pop();
label.AddText(" ");
@@ -46,7 +46,7 @@ public partial class SymbolInfoComponents
{
if (symbol.IsRequired)
{
label.PushColor(CachedColors.KeywordBlue);
label.PushColor(TextEditorDotnetColoursDark.KeywordBlue);
label.AddText("required");
label.Pop();
label.AddText(" ");
@@ -61,7 +61,7 @@ public partial class SymbolInfoComponents
private static void AddPropertyName(this RichTextLabel label, IPropertySymbol symbol)
{
label.PushColor(CachedColors.White);
label.PushColor(TextEditorDotnetColoursDark.White);
label.AddText(symbol.Name);
label.Pop();
}
@@ -72,10 +72,10 @@ public partial class SymbolInfoComponents
if (symbol.GetMethod is not null)
{
label.PushColor(CachedColors.KeywordBlue);
label.PushColor(TextEditorDotnetColoursDark.KeywordBlue);
label.AddText("get");
label.Pop();
label.PushColor(CachedColors.White);
label.PushColor(TextEditorDotnetColoursDark.White);
label.AddText(";");
label.Pop();
label.AddText(" ");
@@ -84,7 +84,7 @@ public partial class SymbolInfoComponents
{
if (setMethod.DeclaredAccessibility != symbol.DeclaredAccessibility)
{
label.PushColor(CachedColors.KeywordBlue);
label.PushColor(TextEditorDotnetColoursDark.KeywordBlue);
label.AddText(setMethod.DeclaredAccessibility.ToString().ToLower());
label.Pop();
label.AddText(" ");
@@ -92,19 +92,19 @@ public partial class SymbolInfoComponents
if (setMethod.IsInitOnly)
{
label.PushColor(CachedColors.KeywordBlue);
label.PushColor(TextEditorDotnetColoursDark.KeywordBlue);
label.AddText("init");
label.Pop();
label.PushColor(CachedColors.White);
label.PushColor(TextEditorDotnetColoursDark.White);
label.AddText(";");
label.Pop();
}
else
{
label.PushColor(CachedColors.KeywordBlue);
label.PushColor(TextEditorDotnetColoursDark.KeywordBlue);
label.AddText("set");
label.Pop();
label.PushColor(CachedColors.White);
label.PushColor(TextEditorDotnetColoursDark.White);
label.AddText(";");
label.Pop();
}

View File

@@ -8,7 +8,7 @@ public static partial class SymbolInfoComponents
public static RichTextLabel GetTypeParameterSymbolInfo(ITypeParameterSymbol symbol)
{
var label = new RichTextLabel();
label.PushColor(CachedColors.White);
label.PushColor(TextEditorDotnetColoursDark.White);
label.PushFont(MonospaceFont);
label.AddTypeParameter(symbol);
label.AddText(" in ");

View File

@@ -34,12 +34,12 @@ public partial class ThreadsVariablesSubTab
var variableValueDisplayColour = variable switch
{
_ when variable.PresentationHint?.Attributes is { } attrs && (attrs & VariablePresentationHint.AttributesValue.FailedEvaluation) != 0 => CachedColors.ErrorRed,
{ Value: "null" } => CachedColors.KeywordBlue,
{ Value: "true" or "false" } => CachedColors.KeywordBlue,
{ Type: "string" or "char" } => CachedColors.LightOrangeBrown,
{ Type: "byte" or "sbyte" or "short" or "ushort" or "int" or "uint" or "long" or "ulong" or "nint" or "nuint" or "float" or "double" or "decimal" } => CachedColors.NumberGreen,
{ Type: "byte?" or "sbyte?" or "short?" or "ushort?" or "int?" or "uint?" or "long?" or "ulong?" or "nint?" or "nuint?" or "float?" or "double?" or "decimal?" } => CachedColors.NumberGreen, // value here will never actually be null, as we handled "null" value above
_ when variable.PresentationHint?.Attributes is { } attrs && (attrs & VariablePresentationHint.AttributesValue.FailedEvaluation) != 0 => TextEditorDotnetColoursDark.ErrorRed,
{ Value: "null" } => TextEditorDotnetColoursDark.KeywordBlue,
{ Value: "true" or "false" } => TextEditorDotnetColoursDark.KeywordBlue,
{ Type: "string" or "char" } => TextEditorDotnetColoursDark.LightOrangeBrown,
{ Type: "byte" or "sbyte" or "short" or "ushort" or "int" or "uint" or "long" or "ulong" or "nint" or "nuint" or "float" or "double" or "decimal" } => TextEditorDotnetColoursDark.NumberGreen,
{ Type: "byte?" or "sbyte?" or "short?" or "ushort?" or "int?" or "uint?" or "long?" or "ulong?" or "nint?" or "nuint?" or "float?" or "double?" or "decimal?" } => TextEditorDotnetColoursDark.NumberGreen, // value here will never actually be null, as we handled "null" value above
_ => VariableWhiteColor
};

View File

@@ -4,8 +4,6 @@
[ext_resource type="ButtonGroup" uid="uid://c2nmo2x3va0gi" path="res://Features/LeftSideBar/LeftBottomSidebarButtonGroup.tres" id="2_1aad6"]
[ext_resource type="Texture2D" uid="uid://ccj0dw81x3bkc" path="res://Features/LeftSideBar/Resources/SidebarFolder.svg" id="2_jg03n"]
[ext_resource type="Texture2D" uid="uid://uukf1nwjhthv" path="res://Features/LeftSideBar/Resources/SidebarProblem.svg" id="4_prju6"]
[ext_resource type="StyleBox" uid="uid://cosaurtj574yc" path="res://Features/LeftSideBar/Resources/LeftSideBarButtonStyleNormal.tres" id="4_umcfu"]
[ext_resource type="StyleBox" uid="uid://d26wbe6o067ko" path="res://Features/LeftSideBar/Resources/LeftSideBarButtonStylePressed.tres" id="5_csqeq"]
[ext_resource type="Texture2D" uid="uid://cre7q0efp4vrq" path="res://Features/LeftSideBar/Resources/SidebarRun.svg" id="5_jg03n"]
[ext_resource type="Texture2D" uid="uid://b0170ypw8uf3a" path="res://Features/LeftSideBar/Resources/Terminal.svg" id="6_ddh6f"]
[ext_resource type="Texture2D" uid="uid://butisxqww0boc" path="res://Features/LeftSideBar/Resources/SidebarDebug.svg" id="6_jg03n"]
@@ -42,9 +40,8 @@ layout_mode = 2
unique_name_in_owner = true
custom_minimum_size = Vector2(0, 50)
layout_mode = 2
theme_type_variation = &"IdeSidebarButton"
theme_override_font_sizes/font_size = 13
theme_override_styles/normal = ExtResource("4_umcfu")
theme_override_styles/pressed = ExtResource("5_csqeq")
toggle_mode = true
button_pressed = true
text = "Explorer"
@@ -61,9 +58,8 @@ size_flags_vertical = 3
unique_name_in_owner = true
custom_minimum_size = Vector2(0, 50)
layout_mode = 2
theme_type_variation = &"IdeSidebarButton"
theme_override_font_sizes/font_size = 13
theme_override_styles/normal = ExtResource("4_umcfu")
theme_override_styles/pressed = ExtResource("5_csqeq")
toggle_mode = true
button_group = ExtResource("2_1aad6")
text = "Problems"
@@ -76,9 +72,8 @@ expand_icon = true
unique_name_in_owner = true
custom_minimum_size = Vector2(0, 50)
layout_mode = 2
theme_type_variation = &"IdeSidebarButton"
theme_override_font_sizes/font_size = 13
theme_override_styles/normal = ExtResource("4_umcfu")
theme_override_styles/pressed = ExtResource("5_csqeq")
toggle_mode = true
button_pressed = true
button_group = ExtResource("2_1aad6")
@@ -92,9 +87,8 @@ expand_icon = true
unique_name_in_owner = true
custom_minimum_size = Vector2(0, 50)
layout_mode = 2
theme_type_variation = &"IdeSidebarButton"
theme_override_font_sizes/font_size = 13
theme_override_styles/normal = ExtResource("4_umcfu")
theme_override_styles/pressed = ExtResource("5_csqeq")
toggle_mode = true
button_group = ExtResource("2_1aad6")
text = "Debug"
@@ -107,9 +101,8 @@ expand_icon = true
unique_name_in_owner = true
custom_minimum_size = Vector2(0, 50)
layout_mode = 2
theme_type_variation = &"IdeSidebarButton"
theme_override_font_sizes/font_size = 13
theme_override_styles/normal = ExtResource("4_umcfu")
theme_override_styles/pressed = ExtResource("5_csqeq")
toggle_mode = true
button_group = ExtResource("2_1aad6")
text = "Build"
@@ -123,9 +116,8 @@ unique_name_in_owner = true
visible = false
custom_minimum_size = Vector2(0, 50)
layout_mode = 2
theme_type_variation = &"IdeSidebarButton"
theme_override_font_sizes/font_size = 13
theme_override_styles/normal = ExtResource("4_umcfu")
theme_override_styles/pressed = ExtResource("5_csqeq")
toggle_mode = true
button_group = ExtResource("2_1aad6")
text = "IDE"
@@ -138,9 +130,8 @@ expand_icon = true
unique_name_in_owner = true
custom_minimum_size = Vector2(0, 50)
layout_mode = 2
theme_type_variation = &"IdeSidebarButton"
theme_override_font_sizes/font_size = 13
theme_override_styles/normal = ExtResource("4_umcfu")
theme_override_styles/pressed = ExtResource("5_csqeq")
toggle_mode = true
button_group = ExtResource("2_1aad6")
text = "NuGet"
@@ -153,9 +144,8 @@ expand_icon = true
unique_name_in_owner = true
custom_minimum_size = Vector2(0, 50)
layout_mode = 2
theme_type_variation = &"IdeSidebarButton"
theme_override_font_sizes/font_size = 13
theme_override_styles/normal = ExtResource("4_umcfu")
theme_override_styles/pressed = ExtResource("5_csqeq")
toggle_mode = true
button_group = ExtResource("2_1aad6")
text = "Tests"

View File

@@ -38,6 +38,31 @@ corner_radius_bottom_right = 3
corner_radius_bottom_left = 3
corner_detail = 5
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_dsk6k"]
content_margin_left = 4.0
content_margin_top = 4.0
content_margin_right = 4.0
content_margin_bottom = 4.0
bg_color = Color(0.1, 0.1, 0.1, 0.6)
draw_center = false
corner_radius_top_left = 3
corner_radius_top_right = 3
corner_radius_bottom_right = 3
corner_radius_bottom_left = 3
corner_detail = 5
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_njudc"]
content_margin_left = 4.0
content_margin_top = 4.0
content_margin_right = 4.0
content_margin_bottom = 4.0
bg_color = Color(0, 0, 0, 0.39215687)
corner_radius_top_left = 3
corner_radius_top_right = 3
corner_radius_bottom_right = 3
corner_radius_bottom_left = 3
corner_detail = 5
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_3gh6f"]
content_margin_left = 0.0
content_margin_top = 0.0
@@ -85,6 +110,9 @@ Gray600Label/base_type = &"Label"
Gray600Label/colors/font_color = Color(0.67058825, 0.67058825, 0.67058825, 1)
Gray700Label/base_type = &"Label"
Gray700Label/colors/font_color = Color(0.83137256, 0.83137256, 0.83137256, 1)
IdeSidebarButton/base_type = &"Button"
IdeSidebarButton/styles/normal = SubResource("StyleBoxFlat_dsk6k")
IdeSidebarButton/styles/pressed = SubResource("StyleBoxFlat_njudc")
Panel/styles/panel = SubResource("StyleBoxFlat_3gh6f")
PanelContainer/styles/panel = SubResource("StyleBoxFlat_6e8is")
PopupPanel/styles/panel = SubResource("StyleBoxFlat_amw38")

View File

@@ -108,6 +108,43 @@ corner_radius_bottom_right = 3
corner_radius_bottom_left = 3
corner_detail = 5
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_5ta8e"]
content_margin_left = 4.0
content_margin_top = 4.0
content_margin_right = 4.0
content_margin_bottom = 4.0
bg_color = Color(0, 0, 0, 0.05882353)
corner_radius_top_left = 3
corner_radius_top_right = 3
corner_radius_bottom_right = 3
corner_radius_bottom_left = 3
corner_detail = 5
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_dsk6k"]
content_margin_left = 4.0
content_margin_top = 4.0
content_margin_right = 4.0
content_margin_bottom = 4.0
bg_color = Color(0.1, 0.1, 0.1, 0.6)
draw_center = false
corner_radius_top_left = 3
corner_radius_top_right = 3
corner_radius_bottom_right = 3
corner_radius_bottom_left = 3
corner_detail = 5
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_njudc"]
content_margin_left = 4.0
content_margin_top = 4.0
content_margin_right = 4.0
content_margin_bottom = 4.0
bg_color = Color(0, 0, 0, 0.13725491)
corner_radius_top_left = 3
corner_radius_top_right = 3
corner_radius_bottom_right = 3
corner_radius_bottom_left = 3
corner_detail = 5
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_guqd5"]
content_margin_left = 4.0
content_margin_top = 4.0
@@ -231,6 +268,14 @@ Gray600Label/base_type = &"Label"
Gray600Label/colors/font_color = Color(0.33, 0.33, 0.33, 1)
Gray700Label/base_type = &"Label"
Gray700Label/colors/font_color = Color(0.17, 0.17, 0.17, 1)
IdeSidebarButton/base_type = &"Button"
IdeSidebarButton/colors/icon_hover_color = Color(0.3019608, 0.3019608, 0.3019608, 1)
IdeSidebarButton/colors/icon_hover_pressed_color = Color(0.3019608, 0.3019608, 0.3019608, 1)
IdeSidebarButton/colors/icon_normal_color = Color(0.3, 0.3, 0.3, 1)
IdeSidebarButton/colors/icon_pressed_color = Color(0.3019608, 0.3019608, 0.3019608, 1)
IdeSidebarButton/styles/hover = SubResource("StyleBoxFlat_5ta8e")
IdeSidebarButton/styles/normal = SubResource("StyleBoxFlat_dsk6k")
IdeSidebarButton/styles/pressed = SubResource("StyleBoxFlat_njudc")
Label/colors/font_color = Color(0.17, 0.17, 0.17, 1)
LineEdit/colors/caret_color = Color(0.05, 0.05, 0.05, 1)
LineEdit/colors/font_color = Color(0.12, 0.12, 0.12, 1)

View File

@@ -1 +1 @@
0.1.19
0.1.20