@@ -9,7 +9,7 @@ import { Range } from 'vs/editor/common/core/range';
99import { TextModel } from 'vs/editor/common/model/textModel' ;
1010import * as modes from 'vs/editor/common/modes' ;
1111import { getCodeActions } from 'vs/editor/contrib/codeAction/codeAction' ;
12- import { CodeActionKind } from 'vs/editor/contrib/codeAction/types' ;
12+ import { CodeActionKind , CodeActionTriggerType } from 'vs/editor/contrib/codeAction/types' ;
1313import { IMarkerData , MarkerSeverity } from 'vs/platform/markers/common/markers' ;
1414import { CancellationToken } from 'vs/base/common/cancellation' ;
1515
@@ -125,7 +125,7 @@ suite('CodeAction', () => {
125125 testData . tsLint . abc
126126 ] ;
127127
128- const { validActions : actions } = await getCodeActions ( model , new Range ( 1 , 1 , 2 , 1 ) , { type : 'manual' } , CancellationToken . None ) ;
128+ const { validActions : actions } = await getCodeActions ( model , new Range ( 1 , 1 , 2 , 1 ) , { type : CodeActionTriggerType . Manual } , CancellationToken . None ) ;
129129 assert . equal ( actions . length , 6 ) ;
130130 assert . deepEqual ( actions , expected ) ;
131131 } ) ;
@@ -140,20 +140,20 @@ suite('CodeAction', () => {
140140 disposables . add ( modes . CodeActionProviderRegistry . register ( 'fooLang' , provider ) ) ;
141141
142142 {
143- const { validActions : actions } = await getCodeActions ( model , new Range ( 1 , 1 , 2 , 1 ) , { type : 'auto' , filter : { include : new CodeActionKind ( 'a' ) } } , CancellationToken . None ) ;
143+ const { validActions : actions } = await getCodeActions ( model , new Range ( 1 , 1 , 2 , 1 ) , { type : CodeActionTriggerType . Auto , filter : { include : new CodeActionKind ( 'a' ) } } , CancellationToken . None ) ;
144144 assert . equal ( actions . length , 2 ) ;
145145 assert . strictEqual ( actions [ 0 ] . title , 'a' ) ;
146146 assert . strictEqual ( actions [ 1 ] . title , 'a.b' ) ;
147147 }
148148
149149 {
150- const { validActions : actions } = await getCodeActions ( model , new Range ( 1 , 1 , 2 , 1 ) , { type : 'auto' , filter : { include : new CodeActionKind ( 'a.b' ) } } , CancellationToken . None ) ;
150+ const { validActions : actions } = await getCodeActions ( model , new Range ( 1 , 1 , 2 , 1 ) , { type : CodeActionTriggerType . Auto , filter : { include : new CodeActionKind ( 'a.b' ) } } , CancellationToken . None ) ;
151151 assert . equal ( actions . length , 1 ) ;
152152 assert . strictEqual ( actions [ 0 ] . title , 'a.b' ) ;
153153 }
154154
155155 {
156- const { validActions : actions } = await getCodeActions ( model , new Range ( 1 , 1 , 2 , 1 ) , { type : 'auto' , filter : { include : new CodeActionKind ( 'a.b.c' ) } } , CancellationToken . None ) ;
156+ const { validActions : actions } = await getCodeActions ( model , new Range ( 1 , 1 , 2 , 1 ) , { type : CodeActionTriggerType . Auto , filter : { include : new CodeActionKind ( 'a.b.c' ) } } , CancellationToken . None ) ;
157157 assert . equal ( actions . length , 0 ) ;
158158 }
159159 } ) ;
@@ -172,7 +172,7 @@ suite('CodeAction', () => {
172172
173173 disposables . add ( modes . CodeActionProviderRegistry . register ( 'fooLang' , provider ) ) ;
174174
175- const { validActions : actions } = await getCodeActions ( model , new Range ( 1 , 1 , 2 , 1 ) , { type : 'auto' , filter : { include : new CodeActionKind ( 'a' ) } } , CancellationToken . None ) ;
175+ const { validActions : actions } = await getCodeActions ( model , new Range ( 1 , 1 , 2 , 1 ) , { type : CodeActionTriggerType . Auto , filter : { include : new CodeActionKind ( 'a' ) } } , CancellationToken . None ) ;
176176 assert . equal ( actions . length , 1 ) ;
177177 assert . strictEqual ( actions [ 0 ] . title , 'a' ) ;
178178 } ) ;
@@ -186,13 +186,13 @@ suite('CodeAction', () => {
186186 disposables . add ( modes . CodeActionProviderRegistry . register ( 'fooLang' , provider ) ) ;
187187
188188 {
189- const { validActions : actions } = await getCodeActions ( model , new Range ( 1 , 1 , 2 , 1 ) , { type : 'auto' } , CancellationToken . None ) ;
189+ const { validActions : actions } = await getCodeActions ( model , new Range ( 1 , 1 , 2 , 1 ) , { type : CodeActionTriggerType . Auto } , CancellationToken . None ) ;
190190 assert . equal ( actions . length , 1 ) ;
191191 assert . strictEqual ( actions [ 0 ] . title , 'b' ) ;
192192 }
193193
194194 {
195- const { validActions : actions } = await getCodeActions ( model , new Range ( 1 , 1 , 2 , 1 ) , { type : 'auto' , filter : { include : CodeActionKind . Source , includeSourceActions : true } } , CancellationToken . None ) ;
195+ const { validActions : actions } = await getCodeActions ( model , new Range ( 1 , 1 , 2 , 1 ) , { type : CodeActionTriggerType . Auto , filter : { include : CodeActionKind . Source , includeSourceActions : true } } , CancellationToken . None ) ;
196196 assert . equal ( actions . length , 1 ) ;
197197 assert . strictEqual ( actions [ 0 ] . title , 'a' ) ;
198198 }
@@ -209,7 +209,7 @@ suite('CodeAction', () => {
209209
210210 {
211211 const { validActions : actions } = await getCodeActions ( model , new Range ( 1 , 1 , 2 , 1 ) , {
212- type : 'auto' , filter : {
212+ type : CodeActionTriggerType . Auto , filter : {
213213 include : CodeActionKind . Source . append ( 'test' ) ,
214214 excludes : [ CodeActionKind . Source ] ,
215215 includeSourceActions : true ,
@@ -234,7 +234,7 @@ suite('CodeAction', () => {
234234 disposables . add ( modes . CodeActionProviderRegistry . register ( 'fooLang' , provider ) ) ;
235235
236236 const { validActions : actions } = await getCodeActions ( model , new Range ( 1 , 1 , 2 , 1 ) , {
237- type : 'auto' ,
237+ type : CodeActionTriggerType . Auto ,
238238 filter : {
239239 include : CodeActionKind . QuickFix
240240 }
0 commit comments