ExtensionCapabilities class
Custom capabilities advertised via _meta in capability objects.
Extensions should advertise their custom capabilities during initialization so callers can check availability before using extension methods.
Example:
final customCaps = ExtensionCapabilities({
'zed.dev': {
'workspace': true,
'fileNotifications': true,
},
'mycompany.com': {
'customAnalysis': true,
'version': '1.0.0',
},
});
Constructors
-
ExtensionCapabilities([Map<
String, dynamic> _vendors = const {}]) -
Creates extension capabilities from vendor data.
const
-
ExtensionCapabilities.fromJson(Map<
String, dynamic> ? json) -
Creates extension capabilities from JSON (the
_metafield in capabilities).factory
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- isEmpty → bool
-
Whether any extension capabilities are defined.
no setter
- isNotEmpty → bool
-
Whether extension capabilities are defined.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
vendors
→ Iterable<
String> -
All vendor domains with registered capabilities.
no setter
Methods
-
getValue<
T> (String vendorDomain, String capability) → T? - Get a capability value for a vendor.
-
getVendorCapabilities(
String vendorDomain) → Map< String, dynamic> ? - Get capabilities for a specific vendor.
-
hasVendor(
String vendorDomain) → bool - Check if a vendor has registered capabilities.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
supports(
String vendorDomain, String capability) → bool - Check if a specific capability is supported by a vendor.
-
toJson(
) → Map< String, dynamic> -
Convert to JSON for wire format (the
_metafield value in capabilities). -
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited