display icons in completions
This commit is contained in:
@@ -452,7 +452,8 @@ public partial class SharpIdeCodeEdit : CodeEdit
|
|||||||
SymbolKind.Field => CodeCompletionKind.Member,
|
SymbolKind.Field => CodeCompletionKind.Member,
|
||||||
_ => CodeCompletionKind.PlainText
|
_ => CodeCompletionKind.PlainText
|
||||||
};
|
};
|
||||||
AddCodeCompletionOption(godotCompletionType, completionItem.DisplayText, completionItem.DisplayText, value: new RefCountedContainer<CompletionItem>(completionItem));
|
var icon = GetIconForSymbolKind(symbolKind);
|
||||||
|
AddCodeCompletionOption(godotCompletionType, completionItem.DisplayText, completionItem.DisplayText, icon: icon, value: new RefCountedContainer<CompletionItem>(completionItem));
|
||||||
}
|
}
|
||||||
// partially working - displays menu only when caret is what CodeEdit determines as valid
|
// partially working - displays menu only when caret is what CodeEdit determines as valid
|
||||||
UpdateCodeCompletionOptions(true);
|
UpdateCodeCompletionOptions(true);
|
||||||
|
|||||||
@@ -0,0 +1,24 @@
|
|||||||
|
using Godot;
|
||||||
|
using Microsoft.CodeAnalysis;
|
||||||
|
|
||||||
|
namespace SharpIDE.Godot.Features.CodeEditor;
|
||||||
|
|
||||||
|
public partial class SharpIdeCodeEdit
|
||||||
|
{
|
||||||
|
private readonly Texture2D _csharpMethodIcon = ResourceLoader.Load<Texture2D>("uid://b17p18ijhvsep");
|
||||||
|
private readonly Texture2D _csharpClassIcon = ResourceLoader.Load<Texture2D>("uid://b027uufaewitj");
|
||||||
|
|
||||||
|
private Texture2D? GetIconForSymbolKind(SymbolKind? symbolKind)
|
||||||
|
{
|
||||||
|
var texture = symbolKind switch
|
||||||
|
{
|
||||||
|
SymbolKind.Method => _csharpMethodIcon,
|
||||||
|
SymbolKind.NamedType => _csharpClassIcon,
|
||||||
|
//SymbolKind.Local => ,
|
||||||
|
//SymbolKind.Property => ,
|
||||||
|
//SymbolKind.Field => ,
|
||||||
|
_ => null
|
||||||
|
};
|
||||||
|
return texture;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
uid://daa1p18jx6lgd
|
||||||
@@ -23,9 +23,9 @@
|
|||||||
inkscape:pageopacity="0"
|
inkscape:pageopacity="0"
|
||||||
inkscape:pagecheckerboard="0"
|
inkscape:pagecheckerboard="0"
|
||||||
inkscape:deskcolor="#505050"
|
inkscape:deskcolor="#505050"
|
||||||
inkscape:zoom="0.36468749"
|
inkscape:zoom="0.72937499"
|
||||||
inkscape:cx="-246.78664"
|
inkscape:cx="268.72323"
|
||||||
inkscape:cy="-157.66924"
|
inkscape:cy="572.40789"
|
||||||
inkscape:window-width="2560"
|
inkscape:window-width="2560"
|
||||||
inkscape:window-height="1369"
|
inkscape:window-height="1369"
|
||||||
inkscape:window-x="-8"
|
inkscape:window-x="-8"
|
||||||
@@ -37,36 +37,36 @@
|
|||||||
transform="matrix(1.0007541,0,0,0.96334492,-0.19807395,9.6729914)">
|
transform="matrix(1.0007541,0,0,0.96334492,-0.19807395,9.6729914)">
|
||||||
|
|
||||||
<path
|
<path
|
||||||
style="fill:#403424;fill-opacity:1;stroke:#cea755;stroke-width:16.0783;stroke-linecap:round;stroke-linejoin:round;stroke-dasharray:none;stroke-opacity:1"
|
style="fill:#403424;fill-opacity:1;stroke:#cea755;stroke-width:18.2675;stroke-linecap:round;stroke-linejoin:round;stroke-dasharray:none;stroke-opacity:1"
|
||||||
d="m 184.70795,151.59145 187.36566,0"
|
d="M 176.72005,205.08565 H 389.59663"
|
||||||
id="path1"
|
id="path1"
|
||||||
sodipodi:nodetypes="cc" /><path
|
sodipodi:nodetypes="cc" /><path
|
||||||
style="fill:none;fill-opacity:1;stroke:#cea755;stroke-width:20.0634;stroke-linecap:round;stroke-linejoin:round;stroke-dasharray:none;stroke-opacity:1"
|
style="fill:none;fill-opacity:1;stroke:#cea755;stroke-width:22.7951;stroke-linecap:round;stroke-linejoin:round;stroke-dasharray:none;stroke-opacity:1"
|
||||||
d="m 270.75724,158.53018 v 143.18643 l 101.31637,-1.47512"
|
d="m 274.48545,212.96912 v 162.68209 l 115.11118,-1.67596"
|
||||||
id="path2"
|
id="path2"
|
||||||
sodipodi:nodetypes="ccc" /><rect
|
sodipodi:nodetypes="ccc" /><rect
|
||||||
style="fill:#403424;fill-opacity:1;stroke:#cea755;stroke-width:26.7609;stroke-linecap:round;stroke-linejoin:round;stroke-dasharray:none;stroke-opacity:1"
|
style="fill:#403424;fill-opacity:1;stroke:#cea755;stroke-width:30.4046;stroke-linecap:round;stroke-linejoin:round;stroke-dasharray:none;stroke-opacity:1"
|
||||||
id="rect1"
|
id="rect1"
|
||||||
width="212.32658"
|
width="241.23607"
|
||||||
height="90.832863"
|
height="103.20028"
|
||||||
x="-70.075668"
|
x="-126.29682"
|
||||||
y="152.38043"
|
y="172.61281"
|
||||||
ry="0.052403569"
|
ry="0.059538618"
|
||||||
transform="matrix(0.70232098,-0.71186041,0.68460871,0.72891077,0,0)" /><rect
|
transform="matrix(0.70232098,-0.71186041,0.68460871,0.72891077,0,0)" /><rect
|
||||||
style="fill:#403424;fill-opacity:1;stroke:#cea755;stroke-width:20.0694;stroke-linecap:round;stroke-linejoin:round;stroke-dasharray:none;stroke-opacity:1"
|
style="fill:#403424;fill-opacity:1;stroke:#cea755;stroke-width:22.802;stroke-linecap:round;stroke-linejoin:round;stroke-dasharray:none;stroke-opacity:1"
|
||||||
id="rect1-8"
|
id="rect1-8"
|
||||||
width="124.5406"
|
width="141.49753"
|
||||||
height="71.029877"
|
height="80.701004"
|
||||||
x="93.227089"
|
x="59.23584"
|
||||||
y="368.03781"
|
y="417.30453"
|
||||||
ry="0.040978782"
|
ry="0.04655828"
|
||||||
transform="matrix(0.69729101,-0.71678815,0.69231756,0.72159295,0,0)" /><rect
|
transform="matrix(0.69729101,-0.71678815,0.69231756,0.72159295,0,0)" /><rect
|
||||||
style="fill:#403424;fill-opacity:1;stroke:#cea755;stroke-width:20.0694;stroke-linecap:round;stroke-linejoin:round;stroke-dasharray:none;stroke-opacity:1"
|
style="fill:#403424;fill-opacity:1;stroke:#cea755;stroke-width:22.802;stroke-linecap:round;stroke-linejoin:round;stroke-dasharray:none;stroke-opacity:1"
|
||||||
id="rect1-8-1"
|
id="rect1-8-1"
|
||||||
width="124.5406"
|
width="141.49753"
|
||||||
height="71.029877"
|
height="80.701004"
|
||||||
x="0.070390612"
|
x="-46.604679"
|
||||||
y="480.65121"
|
y="545.25085"
|
||||||
ry="0.040978782"
|
ry="0.04655828"
|
||||||
transform="matrix(0.69729101,-0.71678815,0.69231756,0.72159295,0,0)" /></g>
|
transform="matrix(0.69729101,-0.71678815,0.69231756,0.72159295,0,0)" /></g>
|
||||||
</svg>
|
</svg>
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 2.7 KiB After Width: | Height: | Size: 2.7 KiB |
Reference in New Issue
Block a user