1+ import type { DestinationDescriptorV6 } from "./DestinationDescriptorV6.types" ;
12import type {
2- PartialTargetDescriptor ,
3- ScopeType ,
4- } from "../PartialTargetDescriptor.types" ;
5- import type { DestinationDescriptor } from "../DestinationDescriptor.types" ;
3+ PartialTargetDescriptorV6 ,
4+ ScopeTypeV6 ,
5+ } from "./PartialTargetDescriptorV6.types" ;
66
77/**
88 * A simple action takes only a single target and no other arguments.
99 */
10- const simpleActionNames = [
10+ const _simpleActionNames = [
1111 "addSelection" ,
1212 "addSelectionAfter" ,
1313 "addSelectionBefore" ,
@@ -60,42 +60,20 @@ const simpleActionNames = [
6060 "private.showParseTree" ,
6161] as const ;
6262
63- const complexActionNames = [
64- "callAsFunction" ,
65- "editNew" ,
66- "executeCommand" ,
67- "generateSnippet" ,
68- "getText" ,
69- "highlight" ,
70- "insertSnippet" ,
71- "moveToTarget" ,
72- "pasteFromClipboard" ,
73- "replace" ,
74- "replaceWithTarget" ,
75- "rewrapWithPairedDelimiter" ,
76- "swapTargets" ,
77- "wrapWithPairedDelimiter" ,
78- "wrapWithSnippet" ,
79- "parsed" ,
80- ] as const ;
81-
82- const actionNames = [ ...simpleActionNames , ...complexActionNames ] as const ;
83-
84- type SimpleActionName = ( typeof simpleActionNames ) [ number ] ;
85- type ActionType = ( typeof actionNames ) [ number ] ;
63+ type SimpleActionName = ( typeof _simpleActionNames ) [ number ] ;
8664
8765/**
8866 * A simple action takes only a single target and no other arguments.
8967 */
9068interface SimpleActionDescriptor {
9169 name : SimpleActionName ;
92- target : PartialTargetDescriptor ;
70+ target : PartialTargetDescriptorV6 ;
9371}
9472
9573interface BringMoveActionDescriptor {
9674 name : "replaceWithTarget" | "moveToTarget" ;
97- source : PartialTargetDescriptor ;
98- destination : DestinationDescriptor ;
75+ source : PartialTargetDescriptorV6 ;
76+ destination : DestinationDescriptorV6 ;
9977}
10078
10179interface CallActionDescriptor {
@@ -104,37 +82,37 @@ interface CallActionDescriptor {
10482 /**
10583 * The target to use as the function to be called.
10684 */
107- callee : PartialTargetDescriptor ;
85+ callee : PartialTargetDescriptorV6 ;
10886
10987 /**
11088 * The target to wrap in a function call.
11189 */
112- argument : PartialTargetDescriptor ;
90+ argument : PartialTargetDescriptorV6 ;
11391}
11492
11593interface SwapActionDescriptor {
11694 name : "swapTargets" ;
117- target1 : PartialTargetDescriptor ;
118- target2 : PartialTargetDescriptor ;
95+ target1 : PartialTargetDescriptorV6 ;
96+ target2 : PartialTargetDescriptorV6 ;
11997}
12098
12199interface WrapWithPairedDelimiterActionDescriptor {
122100 name : "wrapWithPairedDelimiter" | "rewrapWithPairedDelimiter" ;
123101 left : string ;
124102 right : string ;
125- target : PartialTargetDescriptor ;
103+ target : PartialTargetDescriptorV6 ;
126104}
127105
128106interface PasteActionDescriptor {
129107 name : "pasteFromClipboard" ;
130- destination : DestinationDescriptor ;
108+ destination : DestinationDescriptorV6 ;
131109}
132110
133111interface GenerateSnippetActionDescriptor {
134112 name : "generateSnippet" ;
135113 dirPath ?: string ;
136114 snippetName ?: string ;
137- target : PartialTargetDescriptor ;
115+ target : PartialTargetDescriptorV6 ;
138116}
139117
140118interface NamedInsertSnippetArg {
@@ -145,15 +123,15 @@ interface NamedInsertSnippetArg {
145123interface CustomInsertSnippetArg {
146124 type : "custom" ;
147125 body : string ;
148- scopeTypes ?: ScopeType [ ] ;
126+ scopeTypes ?: ScopeTypeV6 [ ] ;
149127 substitutions ?: Record < string , string > ;
150128}
151129type InsertSnippetArg = NamedInsertSnippetArg | CustomInsertSnippetArg ;
152130
153131interface InsertSnippetActionDescriptor {
154132 name : "insertSnippet" ;
155133 snippetDescription : InsertSnippetArg ;
156- destination : DestinationDescriptor ;
134+ destination : DestinationDescriptorV6 ;
157135}
158136
159137interface NamedWrapWithSnippetArg {
@@ -165,14 +143,14 @@ interface CustomWrapWithSnippetArg {
165143 type : "custom" ;
166144 body : string ;
167145 variableName ?: string ;
168- scopeType ?: ScopeType ;
146+ scopeType ?: ScopeTypeV6 ;
169147}
170148type WrapWithSnippetArg = NamedWrapWithSnippetArg | CustomWrapWithSnippetArg ;
171149
172150interface WrapWithSnippetActionDescriptor {
173151 name : "wrapWithSnippet" ;
174152 snippetDescription : WrapWithSnippetArg ;
175- target : PartialTargetDescriptor ;
153+ target : PartialTargetDescriptorV6 ;
176154}
177155
178156interface ExecuteCommandOptions {
@@ -187,26 +165,26 @@ interface ExecuteCommandActionDescriptor {
187165 name : "executeCommand" ;
188166 commandId : string ;
189167 options ?: ExecuteCommandOptions ;
190- target : PartialTargetDescriptor ;
168+ target : PartialTargetDescriptorV6 ;
191169}
192170
193171type ReplaceWith = string [ ] | { start : number } ;
194172
195173interface ReplaceActionDescriptor {
196174 name : "replace" ;
197175 replaceWith : ReplaceWith ;
198- destination : DestinationDescriptor ;
176+ destination : DestinationDescriptorV6 ;
199177}
200178
201179interface HighlightActionDescriptor {
202180 name : "highlight" ;
203181 highlightId ?: string ;
204- target : PartialTargetDescriptor ;
182+ target : PartialTargetDescriptorV6 ;
205183}
206184
207185interface EditNewActionDescriptor {
208186 name : "editNew" ;
209- destination : DestinationDescriptor ;
187+ destination : DestinationDescriptorV6 ;
210188}
211189
212190interface GetTextActionOptions {
@@ -217,7 +195,7 @@ interface GetTextActionOptions {
217195interface GetTextActionDescriptor {
218196 name : "getText" ;
219197 options ?: GetTextActionOptions ;
220- target : PartialTargetDescriptor ;
198+ target : PartialTargetDescriptorV6 ;
221199}
222200
223201interface ParsedActionDescriptor {
0 commit comments