mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[SourceKit] Add "Active Regions" request
`source.request.activeregions` is a new request that reports all `#if`, `#else` and `#elseif` decls in the response with an `is_active` flag. This is mainly useful for a client to know which branches are active, but for completeness sake, the active decls are also reported. Note: it only reports the positions of the decls, not the entire ranges. It's up to clients to map this to the syntactic structure of a tree. Reporting the ranges of the decls could be confusing in the case of nested `#if`s, where the ranges can overlap.
This commit is contained in:
@@ -83,6 +83,7 @@ UID_KEYS = [
|
||||
KEY('BodyLength', 'key.bodylength'),
|
||||
KEY('DocOffset', 'key.docoffset'),
|
||||
KEY('DocLength', 'key.doclength'),
|
||||
KEY('IsActive', 'key.is_active'),
|
||||
KEY('IsLocal', 'key.is_local'),
|
||||
KEY('InheritedTypes', 'key.inheritedtypes'),
|
||||
KEY('Attributes', 'key.attributes'),
|
||||
@@ -224,6 +225,7 @@ UID_REQUESTS = [
|
||||
REQUEST('CodeCompleteSetCustom', 'source.request.codecomplete.setcustom'),
|
||||
REQUEST('TypeContextInfo', 'source.request.typecontextinfo'),
|
||||
REQUEST('ConformingMethodList', 'source.request.conformingmethods'),
|
||||
REQUEST('ActiveRegions', 'source.request.activeregions'),
|
||||
REQUEST('CursorInfo', 'source.request.cursorinfo'),
|
||||
REQUEST('RangeInfo', 'source.request.rangeinfo'),
|
||||
REQUEST('RelatedIdents', 'source.request.relatedidents'),
|
||||
|
||||
Reference in New Issue
Block a user