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