Skip to content

Commit 32ee70d

Browse files
authored
fix(lsp): type of target is URI (#1119)
Rather than "string". This was a bug in the metamodel.json we were using Signed-off-by: Rudi Grinberg <[email protected]>
1 parent 0f773b6 commit 32ee70d

File tree

3 files changed

+11
-8
lines changed

3 files changed

+11
-8
lines changed

lsp/bin/metamodel/metaModel.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5601,8 +5601,8 @@
56015601
{
56025602
"name": "target",
56035603
"type": {
5604-
"kind": "base",
5605-
"name": "string"
5604+
"kind": "reference",
5605+
"name": "URI"
56065606
},
56075607
"optional": true,
56085608
"documentation": "The uri this link points to. If missing a resolve request is sent later."

lsp/src/types.ml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29394,7 +29394,7 @@ module DocumentLink = struct
2939429394
type t =
2939529395
{ data : Json.t option [@yojson.option]
2939629396
; range : Range.t
29397-
; target : string Json.Nullable_option.t
29397+
; target : DocumentUri.t Json.Nullable_option.t
2939829398
[@default None] [@yojson_drop_default ( = )]
2939929399
; tooltip : string Json.Nullable_option.t
2940029400
[@default None] [@yojson_drop_default ( = )]
@@ -29434,7 +29434,9 @@ module DocumentLink = struct
2943429434
match Ppx_yojson_conv_lib.( ! ) target_field with
2943529435
| Ppx_yojson_conv_lib.Option.None ->
2943629436
let fvalue =
29437-
Json.Nullable_option.t_of_yojson string_of_yojson _field_yojson
29437+
Json.Nullable_option.t_of_yojson
29438+
DocumentUri.t_of_yojson
29439+
_field_yojson
2943829440
in
2943929441
target_field := Ppx_yojson_conv_lib.Option.Some fvalue
2944029442
| Ppx_yojson_conv_lib.Option.Some _ ->
@@ -29526,7 +29528,7 @@ module DocumentLink = struct
2952629528
if None = v_target then bnds
2952729529
else
2952829530
let arg =
29529-
(Json.Nullable_option.yojson_of_t yojson_of_string) v_target
29531+
(Json.Nullable_option.yojson_of_t DocumentUri.yojson_of_t) v_target
2953029532
in
2953129533
let bnd = ("target", arg) in
2953229534
bnd :: bnds
@@ -29551,7 +29553,8 @@ module DocumentLink = struct
2955129553
[@@@end]
2955229554

2955329555
let create ?(data : Json.t option) ~(range : Range.t)
29554-
?(target : string option) ?(tooltip : string option) (() : unit) : t =
29556+
?(target : DocumentUri.t option) ?(tooltip : string option) (() : unit) :
29557+
t =
2955529558
{ data; range; target; tooltip }
2955629559
end
2955729560

lsp/src/types.mli

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3167,14 +3167,14 @@ module DocumentLink : sig
31673167
type t =
31683168
{ data : Json.t option
31693169
; range : Range.t
3170-
; target : string option
3170+
; target : DocumentUri.t option
31713171
; tooltip : string option
31723172
}
31733173

31743174
val create :
31753175
?data:Json.t
31763176
-> range:Range.t
3177-
-> ?target:string
3177+
-> ?target:DocumentUri.t
31783178
-> ?tooltip:string
31793179
-> unit
31803180
-> t

0 commit comments

Comments
 (0)