@@ -113,22 +113,7 @@ module IfThenElse = struct
113
113
let codeAction =
114
114
CodeActions. make ~title: " Replace with switch" ~kind: RefactorRewrite
115
115
~command: None
116
- ~edit:
117
- (Some
118
- Protocol.
119
- {
120
- documentChanges =
121
- [
122
- {
123
- textDocument =
124
- {
125
- version = None ;
126
- uri = path |> Uri. fromPath |> Uri. toString;
127
- };
128
- edits = [{newText; range}];
129
- };
130
- ];
131
- })
116
+ ~edit: (Some (CodeActions. makeEdit [{newText; range}] path))
132
117
in
133
118
codeActions := codeAction :: ! codeActions
134
119
end
@@ -193,22 +178,7 @@ module AddBracesToFn = struct
193
178
let codeAction =
194
179
CodeActions. make ~title: " Add braces to function" ~kind: RefactorRewrite
195
180
~command: None
196
- ~edit:
197
- (Some
198
- Protocol.
199
- {
200
- documentChanges =
201
- [
202
- {
203
- textDocument =
204
- {
205
- version = None ;
206
- uri = path |> Uri. fromPath |> Uri. toString;
207
- };
208
- edits = [{newText; range}];
209
- };
210
- ];
211
- })
181
+ ~edit: (Some (CodeActions. makeEdit [{newText; range}] path))
212
182
in
213
183
codeActions := codeAction :: ! codeActions
214
184
end
@@ -282,22 +252,7 @@ module AddTypeAnnotation = struct
282
252
let codeAction =
283
253
CodeActions. make ~title: " Add type annotation" ~kind: RefactorRewrite
284
254
~command: None
285
- ~edit:
286
- (Some
287
- Protocol.
288
- {
289
- documentChanges =
290
- [
291
- {
292
- textDocument =
293
- {
294
- version = None ;
295
- uri = path |> Uri. fromPath |> Uri. toString;
296
- };
297
- edits = [{newText; range}];
298
- };
299
- ];
300
- })
255
+ ~edit: (Some (CodeActions. makeEdit [{newText; range}] path))
301
256
in
302
257
codeActions := codeAction :: ! codeActions
303
258
| _ -> () ))
@@ -434,22 +389,7 @@ module ExhaustiveSwitch = struct
434
389
let codeAction =
435
390
CodeActions. make ~command: None ~title: " Exhaustive switch"
436
391
~kind: RefactorRewrite
437
- ~edit:
438
- (Some
439
- Protocol.
440
- {
441
- documentChanges =
442
- [
443
- {
444
- textDocument =
445
- {
446
- version = None ;
447
- uri = path |> Uri. fromPath |> Uri. toString;
448
- };
449
- edits = [{newText; range}];
450
- };
451
- ];
452
- })
392
+ ~edit: (Some (CodeActions. makeEdit [{newText; range}] path))
453
393
in
454
394
codeActions := codeAction :: ! codeActions))
455
395
| Some (Switch {switchExpr; completionExpr; pos} ) -> (
@@ -476,22 +416,7 @@ module ExhaustiveSwitch = struct
476
416
let codeAction =
477
417
CodeActions. make ~title: " Exhaustive switch" ~command: None
478
418
~kind: RefactorRewrite (* ~uri:path ~newText ~range *)
479
- ~edit:
480
- (Some
481
- Protocol.
482
- {
483
- documentChanges =
484
- [
485
- {
486
- textDocument =
487
- {
488
- version = None ;
489
- uri = path |> Uri. fromPath |> Uri. toString;
490
- };
491
- edits = [{newText; range}];
492
- };
493
- ];
494
- })
419
+ ~edit: (Some (CodeActions. makeEdit [{newText; range}] path))
495
420
in
496
421
codeActions := codeAction :: ! codeActions))
497
422
end
@@ -589,22 +514,7 @@ module AddDocTemplate = struct
589
514
let codeAction =
590
515
CodeActions. make ~title: " Add Documentation template"
591
516
~kind: RefactorRewrite ~command: None
592
- ~edit:
593
- (Some
594
- Protocol.
595
- {
596
- documentChanges =
597
- [
598
- {
599
- textDocument =
600
- {
601
- version = None ;
602
- uri = path |> Uri. fromPath |> Uri. toString;
603
- };
604
- edits = [{newText; range}];
605
- };
606
- ];
607
- })
517
+ ~edit: (Some (CodeActions. makeEdit [{newText; range}] path))
608
518
in
609
519
codeActions := codeAction :: ! codeActions
610
520
| None -> () )
@@ -690,22 +600,7 @@ module AddDocTemplate = struct
690
600
let codeAction =
691
601
CodeActions. make ~title: " Add Documentation template"
692
602
~kind: RefactorRewrite ~command: None
693
- ~edit:
694
- (Some
695
- Protocol.
696
- {
697
- documentChanges =
698
- [
699
- {
700
- textDocument =
701
- {
702
- version = None ;
703
- uri = path |> Uri. fromPath |> Uri. toString;
704
- };
705
- edits = [{newText; range}];
706
- };
707
- ];
708
- })
603
+ ~edit: (Some (CodeActions. makeEdit [{newText; range}] path))
709
604
in
710
605
codeActions := codeAction :: ! codeActions
711
606
| None -> () )
0 commit comments