mirror of
https://github.com/textmate/textmate.git
synced 2026-04-28 03:00:34 -04:00
Encapsulate proxy expansion code
How a proxy items are expanded is not something user code should concern itself with.
This commit is contained in:
@@ -68,9 +68,7 @@ OAK_DEBUG_VAR(BundleMenu);
|
||||
|
||||
case bundles::kItemTypeProxy:
|
||||
{
|
||||
std::string actionClass;
|
||||
if(plist::get_key_path((*item)->plist(), "content", actionClass))
|
||||
OakAddBundlesToMenu(bundles::query(bundles::kFieldSemanticClass, actionClass, scope), hasSelection, true, aMenu, @selector(doBundleItem:));
|
||||
OakAddBundlesToMenu(bundles::items_for_proxy(*item, scope), hasSelection, true, aMenu, @selector(doBundleItem:));
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
@@ -241,6 +241,14 @@ namespace bundles
|
||||
return res;
|
||||
}
|
||||
|
||||
std::vector<item_ptr> items_for_proxy (item_ptr proxyItem, scope::context_t const& scope, int kind, oak::uuid_t const& bundle, bool filter, bool includeDisabledItems)
|
||||
{
|
||||
std::string actionClass;
|
||||
if(plist::get_key_path(proxyItem->plist(), "content", actionClass))
|
||||
return query(kFieldSemanticClass, actionClass, scope, kind, bundle, filter, includeDisabledItems);
|
||||
return std::vector<item_ptr>();
|
||||
}
|
||||
|
||||
item_ptr lookup (oak::uuid_t const& uuid)
|
||||
{
|
||||
iterate(item, AllItems)
|
||||
|
||||
@@ -9,6 +9,7 @@ namespace bundles
|
||||
inline bool set_index (std::vector<item_ptr> const& items) { return set_index(items, std::map< oak::uuid_t, std::vector<oak::uuid_t> >()); }
|
||||
|
||||
PUBLIC std::vector<item_ptr> query (std::string const& field, std::string const& value, scope::context_t const& scope = scope::wildcard, int kind = kItemTypeCommand|kItemTypeDragCommand|kItemTypeGrammar|kItemTypeMacro|kItemTypeSnippet|kItemTypeProxy|kItemTypeTheme, oak::uuid_t const& bundle = oak::uuid_t(), bool filter = true, bool includeDisabledItems = false);
|
||||
PUBLIC std::vector<item_ptr> items_for_proxy (item_ptr proxyItem, scope::context_t const& scope = scope::wildcard, int kind = kItemTypeCommand|kItemTypeDragCommand|kItemTypeGrammar|kItemTypeMacro|kItemTypeSnippet|kItemTypeProxy|kItemTypeTheme, oak::uuid_t const& bundle = oak::uuid_t(), bool filter = true, bool includeDisabledItems = false);
|
||||
PUBLIC item_ptr lookup (oak::uuid_t const& uuid);
|
||||
PUBLIC std::string name_with_selection (item_ptr const& item, bool hasSelection);
|
||||
PUBLIC std::string full_name_with_selection (item_ptr const& item, bool hasSelection);
|
||||
|
||||
Reference in New Issue
Block a user