refactor common code
This commit is contained in:
@@ -183,6 +183,10 @@ public partial class SharpIdeCodeEdit : CodeEdit
|
||||
ILocalSymbol localSymbol => SymbolInfoComponents.GetLocalVariableSymbolInfo(localSymbol),
|
||||
_ => SymbolInfoComponents.GetUnknownTooltip(roslynSymbol)
|
||||
};
|
||||
symbolInfoNode.FitContent = true;
|
||||
symbolInfoNode.AutowrapMode = TextServer.AutowrapMode.Off;
|
||||
symbolInfoNode.SetAnchorsPreset(Control.LayoutPreset.FullRect);
|
||||
|
||||
panel.AddChild(symbolInfoNode);
|
||||
var vboxContainer = new VBoxContainer();
|
||||
vboxContainer.AddThemeConstantOverride("separation", 0);
|
||||
|
||||
@@ -13,9 +13,6 @@ public static partial class SymbolInfoComponents
|
||||
public static RichTextLabel GetUnknownTooltip(ISymbol symbol)
|
||||
{
|
||||
var label = new RichTextLabel();
|
||||
label.FitContent = true;
|
||||
label.AutowrapMode = TextServer.AutowrapMode.Off;
|
||||
label.SetAnchorsPreset(Control.LayoutPreset.FullRect);
|
||||
label.PushColor(CachedColors.White);
|
||||
label.PushFont(MonospaceFont);
|
||||
label.AddText($"UNHANDLED SYMBOL TYPE: {symbol.GetType().Name} - please create an issue!");
|
||||
|
||||
@@ -8,9 +8,6 @@ public static partial class SymbolInfoComponents
|
||||
public static RichTextLabel GetFieldSymbolInfo(IFieldSymbol symbol)
|
||||
{
|
||||
var label = new RichTextLabel();
|
||||
label.FitContent = true;
|
||||
label.AutowrapMode = TextServer.AutowrapMode.Off;
|
||||
label.SetAnchorsPreset(Control.LayoutPreset.FullRect);
|
||||
label.PushColor(CachedColors.White);
|
||||
label.PushFont(MonospaceFont);
|
||||
label.AddAttributes(symbol);
|
||||
|
||||
@@ -8,9 +8,6 @@ public static partial class SymbolInfoComponents
|
||||
public static RichTextLabel GetLocalVariableSymbolInfo(ILocalSymbol symbol)
|
||||
{
|
||||
var label = new RichTextLabel();
|
||||
label.FitContent = true;
|
||||
label.AutowrapMode = TextServer.AutowrapMode.Off;
|
||||
label.SetAnchorsPreset(Control.LayoutPreset.FullRect);
|
||||
label.PushColor(CachedColors.White);
|
||||
label.PushFont(MonospaceFont);
|
||||
label.AddAttributes(symbol);
|
||||
|
||||
@@ -8,9 +8,6 @@ public static partial class SymbolInfoComponents
|
||||
public static RichTextLabel GetMethodSymbolInfo(IMethodSymbol methodSymbol)
|
||||
{
|
||||
var label = new RichTextLabel();
|
||||
label.FitContent = true;
|
||||
label.AutowrapMode = TextServer.AutowrapMode.Off;
|
||||
label.SetAnchorsPreset(Control.LayoutPreset.FullRect);
|
||||
label.PushColor(CachedColors.White);
|
||||
label.PushFont(MonospaceFont);
|
||||
label.AddAttributes(methodSymbol);
|
||||
|
||||
@@ -8,9 +8,6 @@ public static partial class SymbolInfoComponents
|
||||
public static RichTextLabel GetNamedTypeSymbolInfo(INamedTypeSymbol symbol)
|
||||
{
|
||||
var label = new RichTextLabel();
|
||||
label.FitContent = true;
|
||||
label.AutowrapMode = TextServer.AutowrapMode.Off;
|
||||
label.SetAnchorsPreset(Control.LayoutPreset.FullRect);
|
||||
label.PushColor(CachedColors.White);
|
||||
label.PushFont(MonospaceFont);
|
||||
label.AddAttributes(symbol);
|
||||
|
||||
@@ -8,9 +8,6 @@ public static partial class SymbolInfoComponents
|
||||
public static RichTextLabel GetParameterSymbolInfo(IParameterSymbol symbol)
|
||||
{
|
||||
var label = new RichTextLabel();
|
||||
label.FitContent = true;
|
||||
label.AutowrapMode = TextServer.AutowrapMode.Off;
|
||||
label.SetAnchorsPreset(Control.LayoutPreset.FullRect);
|
||||
label.PushColor(CachedColors.White);
|
||||
label.PushFont(MonospaceFont);
|
||||
label.AddAttributes(symbol);
|
||||
|
||||
@@ -8,9 +8,6 @@ public partial class SymbolInfoComponents
|
||||
public static RichTextLabel GetPropertySymbolInfo(IPropertySymbol symbol)
|
||||
{
|
||||
var label = new RichTextLabel();
|
||||
label.FitContent = true;
|
||||
label.AutowrapMode = TextServer.AutowrapMode.Off;
|
||||
label.SetAnchorsPreset(Control.LayoutPreset.FullRect);
|
||||
label.PushColor(CachedColors.White);
|
||||
label.PushFont(MonospaceFont);
|
||||
label.AddAttributes(symbol);
|
||||
|
||||
Reference in New Issue
Block a user