This version of Unity is unsupported.

SearchExpressionContext.ResolveAlias

Declaration

public string ResolveAlias(string defaultLabel);

Declaration

public string ResolveAlias(Search.SearchExpression expr, string defaultLabel);

Parameters

defaultLabel If no exeuction frames are present this becomes the default alias to be resolved.
expr Default expression to look to resolve the alias. If null, use the runtime to resolve the alias.

Returns

string Returns a resolved alias.

Description

Try to resolve an alias value using the SearchExpressionRuntime attached to this context. Each frame if asked to resolve a SearchExpression.alias.

[Description("Returns ids of current selection")]
[SearchExpressionEvaluator(SearchExpressionEvaluationHints.ThreadNotSupported)]
public static IEnumerable<SearchItem> SelectionIds(SearchExpressionContext c)
{
    var instanceIds = UnityEditor.Selection.instanceIDs;
    foreach (var id in instanceIds)
    {
        yield return SearchExpression.CreateItem(id, c.ResolveAlias("selected id"));
    }
}