@@ -807,19 +807,18 @@ let handle_request
807
807
(* **********************************************************)
808
808
(* ************************ NORMAL HANDLING AFTER INIT ******)
809
809
(* **********************************************************)
810
- | (Initialized istate , Hover (document , { line; column } )) ->
810
+ | (Initialized istate , Hover (document , pos )) ->
811
811
let (istate, ctx, entry, _) = update_file_ctx istate document in
812
812
let result =
813
813
Provider_utils. respect_but_quarantine_unsaved_changes ~ctx ~f: (fun () ->
814
- Ide_hover. go_quarantined ~ctx ~entry ~line ~column )
814
+ Ide_hover. go_quarantined ~ctx ~entry pos )
815
815
in
816
816
(Initialized istate, Ok result)
817
- | ( Initialized istate,
818
- Go_to_implementation (document, { line; column }, document_list) ) ->
817
+ | (Initialized istate , Go_to_implementation (document , pos , document_list )) ->
819
818
let (istate, ctx, entry, _) = update_file_ctx istate document in
820
819
let (istate, result) =
821
820
Provider_utils. respect_but_quarantine_unsaved_changes ~ctx ~f: (fun () ->
822
- match ServerFindRefs. go_from_file_ctx ~ctx ~entry ~line ~column with
821
+ match ServerFindRefs. go_from_file_ctx ~ctx ~entry pos with
823
822
| Some (_name, action)
824
823
when not @@ ServerGoToImpl. is_searchable ~action ->
825
824
(istate, ClientIdeMessage. Invalid_symbol_impl )
@@ -874,17 +873,15 @@ let handle_request
874
873
in
875
874
(Initialized istate, Ok result)
876
875
(* textDocument/rename *)
877
- | ( Initialized istate,
878
- Rename (document, { line; column }, new_name, document_list) ) ->
876
+ | (Initialized istate , Rename (document , pos , new_name , document_list )) ->
879
877
let (istate, ctx, entry, _errors) = update_file_ctx istate document in
880
878
let (istate, result) =
881
879
Provider_utils. respect_but_quarantine_unsaved_changes ~ctx ~f: (fun () ->
882
880
match
883
881
ServerFindRefs. go_from_file_ctx_with_symbol_definition
884
882
~ctx
885
883
~entry
886
- ~line
887
- ~column
884
+ pos
888
885
with
889
886
| None -> (istate, ClientIdeMessage. Not_renameable_position )
890
887
| Some (_definition , action ) when ServerFindRefs. is_local action ->
@@ -945,14 +942,13 @@ let handle_request
945
942
in
946
943
(Initialized istate, Ok result)
947
944
(* textDocument/references - localvar only *)
948
- | ( Initialized istate,
949
- Find_references (document, { line; column }, document_list) ) ->
945
+ | (Initialized istate , Find_references (document , pos , document_list )) ->
950
946
let open Result.Monad_infix in
951
947
(* Update the state of the world with the document as it exists in the IDE *)
952
948
let (istate, ctx, entry, _) = update_file_ctx istate document in
953
949
let (istate, result) =
954
950
Provider_utils. respect_but_quarantine_unsaved_changes ~ctx ~f: (fun () ->
955
- match ServerFindRefs. go_from_file_ctx ~ctx ~entry ~line ~column with
951
+ match ServerFindRefs. go_from_file_ctx ~ctx ~entry pos with
956
952
| Some (name , action ) when ServerFindRefs. is_local action ->
957
953
let result =
958
954
ServerFindRefs. go_for_localvar ctx action
@@ -1091,9 +1087,7 @@ let handle_request
1091
1087
(Initialized istate, Ok result)
1092
1088
(* Autocomplete *)
1093
1089
| ( Initialized istate,
1094
- Completion
1095
- (document, { line; column }, { ClientIdeMessage. is_manually_invoked })
1096
- ) ->
1090
+ Completion (document, pos, { ClientIdeMessage. is_manually_invoked }) ) ->
1097
1091
(* Update the state of the world with the document as it exists in the IDE *)
1098
1092
let (istate, ctx, entry, _) = update_file_ctx istate document in
1099
1093
let sienv_ref = ref istate.sienv in
@@ -1103,8 +1097,7 @@ let handle_request
1103
1097
~entry
1104
1098
~sienv_ref
1105
1099
~is_manually_invoked
1106
- ~line
1107
- ~column
1100
+ pos
1108
1101
~naming_table: istate.naming_table
1109
1102
in
1110
1103
let istate = { istate with sienv = ! sienv_ref } in
@@ -1119,8 +1112,7 @@ let handle_request
1119
1112
(Initialized istate, Ok Completion_resolve. { docblock = result; signature })
1120
1113
(* Autocomplete docblock resolve *)
1121
1114
| ( Initialized istate,
1122
- Completion_resolve_location (file_path, fullname, { line; column }, kind)
1123
- ) ->
1115
+ Completion_resolve_location (file_path, fullname, pos, kind) ) ->
1124
1116
(* We're given a location but it often won't be an opened file.
1125
1117
We will only serve autocomplete docblocks as of truth on disk.
1126
1118
Hence, we construct temporary entry to reflect the file which
@@ -1133,38 +1125,35 @@ let handle_request
1133
1125
let (ctx, entry) = Provider_context. add_entry_if_missing ~ctx ~path in
1134
1126
let result =
1135
1127
Provider_utils. respect_but_quarantine_unsaved_changes ~ctx ~f: (fun () ->
1136
- ServerDocblockAt. go_docblock_ctx ~ctx ~entry ~line ~column ~kind )
1128
+ ServerDocblockAt. go_docblock_ctx ~ctx ~entry pos ~kind )
1137
1129
in
1138
1130
let (Full_name s) = fullname in
1139
1131
let signature = ServerAutoComplete. get_signature ctx s in
1140
1132
(Initialized istate, Ok Completion_resolve. { docblock = result; signature })
1141
1133
(* Document highlighting *)
1142
- | (Initialized istate , Document_highlight (document , { line; column } )) ->
1134
+ | (Initialized istate , Document_highlight (document , pos )) ->
1143
1135
let (istate, ctx, entry, _) = update_file_ctx istate document in
1144
1136
let results =
1145
1137
Provider_utils. respect_but_quarantine_unsaved_changes ~ctx ~f: (fun () ->
1146
- Ide_highlight_refs. go_quarantined ~ctx ~entry ~line ~column )
1138
+ Ide_highlight_refs. go_quarantined ~ctx ~entry pos )
1147
1139
in
1148
1140
(Initialized istate, Ok results)
1149
1141
(* Signature help *)
1150
- | (Initialized istate , Signature_help (document , { line; column } )) ->
1142
+ | (Initialized istate , Signature_help (document , pos )) ->
1151
1143
let (istate, ctx, entry, _) = update_file_ctx istate document in
1152
1144
let results =
1153
1145
Provider_utils. respect_but_quarantine_unsaved_changes ~ctx ~f: (fun () ->
1154
- ServerSignatureHelp. go_quarantined ~ctx ~entry ~line ~column )
1146
+ ServerSignatureHelp. go_quarantined ~ctx ~entry pos )
1155
1147
in
1156
1148
(Initialized istate, Ok results)
1157
- | (Initialized istate, Top_level_def_name_at_pos (document, { line; column }))
1158
- ->
1149
+ | (Initialized istate , Top_level_def_name_at_pos (document , pos )) ->
1159
1150
let (istate, ctx, entry, _) = update_file_ctx istate document in
1160
- let res =
1161
- Ide_top_level_def_name_at_pos. go_quarantined ctx entry ~line ~column
1162
- in
1151
+ let res = Ide_top_level_def_name_at_pos. go_quarantined ctx entry pos in
1163
1152
(Initialized istate, Ok res)
1164
1153
(* AutoClose *)
1165
- | (Initialized istate , AutoClose (document , { line; column } )) ->
1154
+ | (Initialized istate , AutoClose (document , pos )) ->
1166
1155
let (istate, ctx, entry, _) = update_file_ctx istate document in
1167
- let close_tag = AutocloseTags. go_xhp_close_tag ~ctx ~entry ~line ~column in
1156
+ let close_tag = AutocloseTags. go_xhp_close_tag ~ctx ~entry pos in
1168
1157
(Initialized istate, Ok close_tag)
1169
1158
(* Code actions (refactorings, quickfixes) *)
1170
1159
| (Initialized istate , Code_action (document , range )) ->
@@ -1233,19 +1222,19 @@ let handle_request
1233
1222
in
1234
1223
(Initialized istate, Ok result)
1235
1224
(* Go to definition *)
1236
- | (Initialized istate , Definition (document , { line; column } )) ->
1225
+ | (Initialized istate , Definition (document , pos )) ->
1237
1226
let (istate, ctx, entry, _) = update_file_ctx istate document in
1238
1227
let result =
1239
1228
Provider_utils. respect_but_quarantine_unsaved_changes ~ctx ~f: (fun () ->
1240
- ServerGoToDefinition. go_quarantined ~ctx ~entry ~line ~column )
1229
+ ServerGoToDefinition. go_quarantined ~ctx ~entry pos )
1241
1230
in
1242
1231
(Initialized istate, Ok result)
1243
1232
(* Type Definition *)
1244
- | (Initialized istate , Type_definition (document , { line; column } )) ->
1233
+ | (Initialized istate , Type_definition (document , pos )) ->
1245
1234
let (istate, ctx, entry, _) = update_file_ctx istate document in
1246
1235
let result =
1247
1236
Provider_utils. respect_but_quarantine_unsaved_changes ~ctx ~f: (fun () ->
1248
- ServerTypeDefinition. go_quarantined ~ctx ~entry ~line ~column )
1237
+ ServerTypeDefinition. go_quarantined ~ctx ~entry pos )
1249
1238
in
1250
1239
(Initialized istate, Ok result)
1251
1240
(* Workspace Symbol *)
0 commit comments