File tree Expand file tree Collapse file tree 2 files changed +7
-9
lines changed Expand file tree Collapse file tree 2 files changed +7
-9
lines changed Original file line number Diff line number Diff line change @@ -200,13 +200,12 @@ let rename ~path ~line ~col ~newName =
200
200
|> List. map (fun (uri , _ ) ->
201
201
let path = Uri2. toPath uri in
202
202
let dir = Filename. dirname path in
203
- let ext = Filename. extension path in
204
- let sep = Filename. dir_sep in
205
- let newPath = dir ^ sep ^ newName ^ ext in
203
+ let newPath =
204
+ Filename. concat dir (newName ^ Filename. extension path)
205
+ in
206
206
let newUri = Uri2. fromPath newPath in
207
207
Protocol.
208
208
{
209
- kind = `rename ;
210
209
oldUri = uri |> Uri2. toString;
211
210
newUri = newUri |> Uri2. toString;
212
211
})
Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ type location = {uri : string; range : range}
18
18
19
19
type documentSymbolItem = {name : string ; kind : int ; location : location }
20
20
21
- type renameFile = {kind : [ `rename ] ; oldUri : string ; newUri : string }
21
+ type renameFile = {oldUri : string ; newUri : string }
22
22
23
23
type textEdit = {range : range ; newText : string }
24
24
@@ -80,14 +80,13 @@ let stringifyDocumentSymbolItem i =
80
80
(Json. escape i.name) i.kind
81
81
(stringifyLocation i.location)
82
82
83
- let stringifyRenameFile rf =
83
+ let stringifyRenameFile {oldUri; newUri} =
84
84
Printf. sprintf {| {
85
- " kind" : " %s " ,
85
+ " kind" : " rename " ,
86
86
" oldUri" : " %s" ,
87
87
" newUri" : " %s"
88
88
}| }
89
- (match rf.kind with `rename -> " rename" )
90
- (Json. escape rf.oldUri) (Json. escape rf.newUri)
89
+ (Json. escape oldUri) (Json. escape newUri)
91
90
92
91
let stringifyTextEdit te =
93
92
Printf. sprintf {| {
You can’t perform that action at this time.
0 commit comments