diff --git a/CHANGELOG.md b/CHANGELOG.md index c7cf6c436c6..da0459b8f6b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -41,6 +41,7 @@ - Use a single vendored @rescript/react package across the repo. https://github.com/rescript-lang/rescript/pull/7525 - Improve deprecated attribute extraction and support record form. https://github.com/rescript-lang/rescript/pull/8396 - Refactor analysis to decouple I/O from core logic. https://github.com/rescript-lang/rescript/pull/8426 +- Remove vendored `Json` library and use `yojson` and `lsp` library for analysis. https://github.com/rescript-lang/rescript/pull/8436 #### :house: Internal diff --git a/analysis.opam b/analysis.opam index 8350d0a8a98..209189df6e4 100644 --- a/analysis.opam +++ b/analysis.opam @@ -11,6 +11,8 @@ depends: [ "ocaml" {>= "5.0.0"} "cppo" {= "1.8.0"} "odoc" {with-doc} + "lsp" {= "1.22.0"} + "yojson" {= "2.2.2"} ] build: [ ["dune" "subst"] {dev} diff --git a/analysis/bin/main.ml b/analysis/bin/main.ml index 0afe23855ab..98b66acc7fa 100644 --- a/analysis/bin/main.ml +++ b/analysis/bin/main.ml @@ -180,13 +180,12 @@ let main () = | _ -> raise (Failure "unsupported type") in let source = Files.readFile path |> Option.value ~default:"" in - let res = - Codemod.transform ~source - ~pos:(int_of_string line, int_of_string col) - ~debug ~typ ~hint - |> Json.escape - in - Printf.printf "\"%s\"" res + `String + (Codemod.transform ~source + ~pos:(int_of_string line, int_of_string col) + ~debug ~typ ~hint) + |> Yojson.Safe.pretty_to_string ~std:true + |> print_endline | [_; "diagnosticSyntax"; path] -> Cli.diagnosticSyntax ~path | [_; "references"; path; line; col] -> Cli.references ~path ~pos:(int_of_string line, int_of_string col) ~debug @@ -198,8 +197,9 @@ let main () = ~newName ~debug | [_; "semanticTokens"; currentFile] -> Cli.semanticTokens ~path:currentFile | [_; "createInterface"; path; cmiFile] -> - Printf.printf "\"%s\"" - (Json.escape (CreateInterface.command ~path ~cmiFile)) + `String (CreateInterface.command ~path ~cmiFile) + |> Yojson.Safe.pretty_to_string ~std:true + |> print_endline | [_; "format"; path] -> Cli.format ~path | [_; "test"; path] -> Cli.test ~path | [_; "cmt"; rescript_json; cmt_path] -> CmtViewer.dump rescript_json cmt_path diff --git a/analysis/reanalyze/src/EmitJson.ml b/analysis/reanalyze/src/EmitJson.ml index 26cf1f199fb..6a636bc8c07 100644 --- a/analysis/reanalyze/src/EmitJson.ml +++ b/analysis/reanalyze/src/EmitJson.ml @@ -4,18 +4,19 @@ let start () = Printf.printf "[" let finish () = Printf.printf "\n]\n" let emitClose () = "\n}" +let jsonString text = Yojson.Safe.to_string (`String text) let emitItem ~ppf ~name ~kind ~file ~range ~message = let open Format in items := !items + 1; let startLine, startCharacter, endLine, endCharacter = range in fprintf ppf "%s{\n" (if !items = 1 then "\n" else ",\n"); - fprintf ppf " \"name\": \"%s\",\n" name; - fprintf ppf " \"kind\": \"%s\",\n" kind; - fprintf ppf " \"file\": \"%s\",\n" file; + fprintf ppf " \"name\": %s,\n" (jsonString name); + fprintf ppf " \"kind\": %s,\n" (jsonString kind); + fprintf ppf " \"file\": %s,\n" (jsonString file); fprintf ppf " \"range\": [%d,%d,%d,%d],\n" startLine startCharacter endLine endCharacter; - fprintf ppf " \"message\": \"%s\"" message + fprintf ppf " \"message\": %s" (jsonString message) let locToPos (loc : Location.t) = (loc.loc_start.pos_lnum - 1, loc.loc_start.pos_cnum - loc.loc_start.pos_bol) @@ -24,6 +25,6 @@ let emitAnnotate ~pos ~text ~action = let line, character = pos in Format.asprintf ",\n\ - \ \"annotate\": { \"line\": %d, \"character\": %d, \"text\": \"%s\", \ - \"action\": \"%s\"}" - line character text action + \ \"annotate\": { \"line\": %d, \"character\": %d, \"text\": %s, \ + \"action\": %s}" + line character (jsonString text) (jsonString action) diff --git a/analysis/reanalyze/src/Log_.ml b/analysis/reanalyze/src/Log_.ml index 5a03ae55515..19e03cf8aef 100644 --- a/analysis/reanalyze/src/Log_.ml +++ b/analysis/reanalyze/src/Log_.ml @@ -164,12 +164,12 @@ let logIssue ~config ~(issue : Issue.t) = let open Format in let loc = issue.loc in if config.DceConfig.cli.json then - let file = Json.escape loc.loc_start.pos_fname in + let file = loc.loc_start.pos_fname in let startLine = loc.loc_start.pos_lnum - 1 in let startCharacter = loc.loc_start.pos_cnum - loc.loc_start.pos_bol in let endLine = loc.loc_end.pos_lnum - 1 in let endCharacter = loc.loc_end.pos_cnum - loc.loc_start.pos_bol in - let message = Json.escape (descriptionToMessage issue.description) in + let message = descriptionToMessage issue.description in Format.asprintf "%a%s%s" (fun ppf () -> EmitJson.emitItem ~ppf ~name:issue.name diff --git a/analysis/reanalyze/src/Paths.ml b/analysis/reanalyze/src/Paths.ml index 8e0f51ef7a4..f47282ee089 100644 --- a/analysis/reanalyze/src/Paths.ml +++ b/analysis/reanalyze/src/Paths.ml @@ -1,5 +1,11 @@ let rescriptJson = "rescript.json" +(** If `t` is an object (`Assoc), get the value associated with the given string key *) +let get key t = + match t with + | `Assoc items -> List.assoc_opt key items + | _ -> None + let readFile filename = try (* windows can't use open_in *) @@ -33,50 +39,49 @@ let setReScriptProjectRoot = lazy (setProjectRootFromCwd ()) module Config = struct let readSuppress conf = - match Json.get "suppress" conf with - | Some (Array elements) -> + match conf |> get "suppress" with + | Some (`List elements) -> let names = elements - |> List.filter_map (fun (x : Json.t) -> + |> List.filter_map (fun (x : Yojson.Safe.t) -> match x with - | String s -> Some s + | `String s -> Some s | _ -> None) in runConfig.suppress <- names @ runConfig.suppress | _ -> () let readUnsuppress conf = - match Json.get "unsuppress" conf with - | Some (Array elements) -> + match conf |> get "unsuppress" with + | Some (`List elements) -> let names = elements - |> List.filter_map (fun (x : Json.t) -> + |> List.filter_map (fun (x : Yojson.Safe.t) -> match x with - | String s -> Some s + | `String s -> Some s | _ -> None) in runConfig.unsuppress <- names @ runConfig.unsuppress | _ -> () let readAnalysis conf = - match Json.get "analysis" conf with - | Some (Array elements) -> + match conf |> get "analysis" with + | Some (`List elements) -> elements - |> List.iter (fun (x : Json.t) -> + |> List.iter (fun (x : Yojson.Safe.t) -> match x with - | String "all" -> RunConfig.all () - | String "dce" -> RunConfig.dce () - | String "exception" -> RunConfig.exception_ () - | String "termination" -> RunConfig.termination () + | `String "all" -> RunConfig.all () + | `String "dce" -> RunConfig.dce () + | `String "exception" -> RunConfig.exception_ () + | `String "termination" -> RunConfig.termination () | _ -> ()) | _ -> (* if no "analysis" specified, default to dce *) RunConfig.dce () let readTransitive conf = - match Json.get "transitive" conf with - | Some True -> RunConfig.transitive true - | Some False -> RunConfig.transitive false + match conf |> get "transitive" with + | Some (`Bool bool) -> RunConfig.transitive bool | _ -> () (* Read the config from rescript.json and apply it to runConfig and suppress and unsuppress *) @@ -85,10 +90,9 @@ module Config = struct let rescriptFile = Filename.concat runConfig.projectRoot rescriptJson in let processText text = - match Json.parse text with - | None -> () + match try Some (Yojson.Safe.from_string text) with _ -> None with | Some json -> ( - match Json.get "reanalyze" json with + match get "reanalyze" json with | Some conf -> readSuppress conf; readUnsuppress conf; @@ -97,6 +101,7 @@ module Config = struct | None -> (* if no "analysis" specified, default to dce *) RunConfig.dce ()) + | _ -> () in match readFile rescriptFile with @@ -145,18 +150,23 @@ let readCmtScan () = ["lib"; "bs"; ".sourcedirs.json"] |> List.fold_left Filename.concat runConfig.bsbProjectRoot in - let get key fn json = - Json.get key json |> Option.to_list |> List.filter_map fn + let get_fn key fn json = + get key json |> Option.to_list |> List.filter_map fn in - let read_entry (json : Json.t) = - let build_root = json |> get "build_root" Json.string in + let read_entry (json : Yojson.Safe.t) = + let build_root = + json |> get_fn "build_root" Yojson.Safe.Util.to_string_option + in let scan_dirs = - match json |> get "scan_dirs" Json.array with - | [arr] -> arr |> List.filter_map Json.string + match json |> get "scan_dirs" with + | Some (`List arr) -> + arr |> List.filter_map Yojson.Safe.Util.to_string_option | _ -> [] in let also_scan_build_root = - match json |> get "also_scan_build_root" Json.bool with + match + json |> get_fn "also_scan_build_root" Yojson.Safe.Util.to_bool_option + with | [b] -> b | _ -> false in @@ -167,9 +177,9 @@ let readCmtScan () = match readFile sourceDirsFile with | None -> [] | Some text -> ( - match Json.parse text with + match try Some (Yojson.Safe.from_string text) with _ -> None with | None -> [] | Some json -> ( - match json |> get "cmt_scan" Json.array with - | [arr] -> arr |> List.filter_map read_entry + match get "cmt_scan" json with + | Some (`List arr) -> arr |> List.filter_map read_entry | _ -> [])) diff --git a/analysis/reanalyze/src/dune b/analysis/reanalyze/src/dune index 3106987397f..7573766dfb3 100644 --- a/analysis/reanalyze/src/dune +++ b/analysis/reanalyze/src/dune @@ -2,4 +2,4 @@ (name reanalyze) (flags (-w "+6+26+27+32+33+39")) - (libraries reactive jsonlib ml str unix)) + (libraries reactive yojson ml str unix)) diff --git a/analysis/src/Cli.ml b/analysis/src/Cli.ml index bd8ced94a14..727313cb800 100644 --- a/analysis/src/Cli.ml +++ b/analysis/src/Cli.ml @@ -1,164 +1,160 @@ +let print_string json = + Yojson.Safe.pretty_to_string ~std:true json |> print_endline +let print_null () = `Null |> print_string +let print_list l = `List l |> print_string + let completion ~debug ~path ~pos ~currentFile = let full = Cmt.loadFullCmtFromPath ~path in let kindFile = Files.classifySourceFile currentFile in match Files.readFile currentFile with - | None | Some "" -> Protocol.null |> print_endline + | None | Some "" -> print_null () | Some source -> Commands.completion ~debug ~source ~kindFile ~pos ~full - |> List.map Protocol.stringifyCompletionItem - |> Protocol.array |> print_endline + |> List.map (fun c -> Lsp.Types.CompletionItem.yojson_of_t c) + |> print_list let completionResolve ~path ~modulePath = let full = Cmt.loadFullCmtFromPath ~path in - let result = - match Commands.completionResolve ~full ~modulePath with - | None -> Protocol.null - | Some content -> Protocol.wrapInQuotes content - in - print_endline result + match Commands.completionResolve ~full ~modulePath with + | None -> print_null () + | Some (`MarkupContent {value}) -> `String value |> print_string let inlayhint ~path ~pos ~maxLength ~debug = let full = Cmt.loadFullCmtFromPath ~path in let kindFile = Files.classifySourceFile path in match Files.readFile path with - | None -> Protocol.null |> print_endline + | None -> print_null () | Some source -> ( match Hint.inlay ~source ~kindFile ~pos ~maxLength ~full ~debug with | Some hints -> hints - |> List.map Protocol.stringifyHint - |> Protocol.array |> print_endline - | None -> Protocol.null |> print_endline) + |> List.map (fun h -> Lsp.Types.InlayHint.yojson_of_t h) + |> print_list + | None -> print_null ()) let codeLens ~path ~debug = let full = Cmt.loadFullCmtFromPath ~path in let kindFile = Files.classifySourceFile path in match Files.readFile path with - | None -> Protocol.null |> print_endline + | None -> print_null () | Some source -> ( match Hint.codeLens ~source ~kindFile ~full ~debug with | Some lens -> - lens - |> List.map Protocol.stringifyCodeLens - |> Protocol.array |> print_endline - | None -> Protocol.null |> print_endline) + lens |> List.map (fun l -> Lsp.Types.CodeLens.yojson_of_t l) |> print_list + | None -> print_null ()) let hover ~path ~pos ~currentFile ~debug ~supportsMarkdownLinks = let full = Cmt.loadFullCmtFromPath ~path in let kindFile = Files.classifySourceFile currentFile in match Files.readFile currentFile with - | None -> Protocol.null |> print_endline - | Some source -> - let result = - match - Commands.hover ~source ~kindFile ~pos ~debug ~supportsMarkdownLinks - ~full - with - | Some value -> Protocol.stringifyHover value - | None -> Protocol.null - in - print_endline result + | None -> print_null () + | Some source -> ( + match + Commands.hover ~source ~kindFile ~pos ~debug ~supportsMarkdownLinks ~full + with + | Some value -> Lsp.Types.Hover.yojson_of_t value |> print_string + | None -> print_null ()) let signatureHelp ~path ~pos ~currentFile ~debug ~allowForConstructorPayloads = let full = Cmt.loadFullCmtFromPath ~path in let kindFile = Files.classifySourceFile currentFile in match Files.readFile currentFile with - | None -> Protocol.null |> print_endline - | Some source -> - Commands.signatureHelp ~source ~kindFile ~pos ~allowForConstructorPayloads - ~full ~debug - |> Protocol.stringifySignatureHelp |> print_endline + | None -> print_null () + | Some source -> ( + match + SignatureHelp.signatureHelp ~source ~kindFile ~pos + ~allowForConstructorPayloads ~full ~debug + with + | None -> print_null () + | Some s -> Lsp.Types.SignatureHelp.yojson_of_t s |> print_string) let codeAction ~path ~startPos ~endPos ~currentFile ~debug = let kindFile = Files.classifySourceFile currentFile in match Files.readFile currentFile with - | None -> Protocol.null |> print_endline + | None -> print_null () | Some source -> Xform.extractCodeActions ~path ~startPos ~endPos ~source ~kindFile ~debug - |> CodeActions.stringifyCodeActions |> print_endline + |> List.map (fun c -> Lsp.Types.CodeAction.yojson_of_t c) + |> print_list let definition ~path ~pos ~debug = let full = Cmt.loadFullCmtFromPath ~path in - print_endline - (match Commands.definition ~full ~pos ~debug with - | None -> Protocol.null - | Some location -> location |> Protocol.stringifyLocation) + + match Commands.definition ~full ~pos ~debug with + | None -> print_null () + | Some location -> location |> Lsp.Types.Location.yojson_of_t |> print_string let typeDefinition ~path ~pos ~debug = let full = Cmt.loadFullCmtFromPath ~path in - print_endline - (match Commands.typeDefinition ~full ~pos ~debug with - | None -> Protocol.null - | Some location -> location |> Protocol.stringifyLocation) + match Commands.typeDefinition ~full ~pos ~debug with + | None -> print_null () + | Some location -> location |> Lsp.Types.Location.yojson_of_t |> print_string let references ~path ~pos ~debug = let full = Cmt.loadFullCmtFromPath ~path in let allLocs = Commands.references ~full ~pos ~debug in - print_endline - (if allLocs = [] then Protocol.null - else - "[\n" - ^ (allLocs |> List.map Protocol.stringifyLocation |> String.concat ",\n") - ^ "\n]") + if allLocs = [] then print_null () + else + allLocs + |> List.map (fun l -> Lsp.Types.Location.yojson_of_t l) + |> print_list let rename ~path ~pos ~newName ~debug = let full = Cmt.loadFullCmtFromPath ~path in - let result = - match Commands.rename ~full ~pos ~newName ~debug with - | None -> Protocol.null - | Some (fileRenames, textDocumentEdits) -> - let fileRenamesString = - fileRenames |> List.map Protocol.stringifyRenameFile - in - let textDocumentEditsString = - textDocumentEdits |> List.map Protocol.stringifyTextDocumentEdit - in - "[\n" - ^ (fileRenamesString @ textDocumentEditsString |> String.concat ",\n") - ^ "\n]" - in - print_endline result + match Commands.rename ~full ~pos ~newName ~debug with + | Some {documentChanges = Some documentChanges} -> + documentChanges + |> List.map (fun c -> + match c with + | `RenameFile r -> Lsp.Types.RenameFile.yojson_of_t r + | `TextDocumentEdit te -> Lsp.Types.TextDocumentEdit.yojson_of_t te + | `DeleteFile df -> Lsp.Types.DeleteFile.yojson_of_t df + | `CreateFile cf -> Lsp.Types.CreateFile.yojson_of_t cf) + |> print_list + | _ -> print_null () let prepareRename ~path ~pos ~debug = let full = Cmt.loadFullCmtFromPath ~path in - let result = - match Commands.prepareRename ~full ~pos ~debug with - | None -> Protocol.null - | Some (Range range) -> Protocol.stringifyRange range - | Some (Placeholder rangeph) -> - Protocol.stringifyRangeWithPlaceholder rangeph - in - print_endline result + match Commands.prepareRename ~full ~pos ~debug with + | None -> print_null () + | Some {range; placeholder = None} -> + Lsp.Types.Range.yojson_of_t range |> print_string + | Some {range; placeholder = Some placeholder} -> + `Assoc + [ + ("range", Lsp.Types.Range.yojson_of_t range); + ("placeholder", `String placeholder); + ] + |> print_string let format ~path = match Files.readFile path with - | None -> Protocol.null |> print_endline + | None -> print_null () | Some source -> ( let kindFile = Files.classifySourceFile path in match Commands.format ~source ~kindFile with | Ok textEdits -> ( match textEdits with - | {newText} :: _ -> Printf.printf "\"%s\"" (Json.escape newText) - | _ -> Protocol.null |> print_endline) - | Error _ -> Protocol.null |> print_endline) + | {newText} :: _ -> print_string (`String newText) + | _ -> print_null ()) + | Error _ -> print_null ()) let diagnosticSyntax ~path = match Files.readFile path with - | None -> Protocol.array [""] |> print_endline + | None -> print_list [] | Some source -> let kindFile = Files.classifySourceFile path in Diagnostics.document_syntax ~source ~kindFile - |> List.map Protocol.stringifyDiagnostic - |> Protocol.array |> print_endline + |> List.map Lsp.Types.Diagnostic.yojson_of_t + |> print_list let semanticTokens ~path = match Files.readFile path with - | None -> Protocol.null |> print_endline + | None -> print_null () | Some source -> let kindFile = Files.classifySourceFile path in let tokens = SemanticTokens.semanticTokens ~source ~kindFile in - let data = SemanticTokens.Token.arrayToJsonString tokens.data in - Printf.printf "{\"data\":%s}" data + Lsp.Types.SemanticTokens.yojson_of_t tokens |> print_string let test ~path = Uri.stripPath := true; @@ -327,26 +323,61 @@ let test ~path = in Sys.remove currentFile; codeActions - |> List.iter (fun {Protocol.title; edit = {documentChanges}} -> + |> List.iter (fun {Lsp.Types.CodeAction.title; edit} -> Printf.printf "Hit: %s\n" title; - documentChanges - |> List.iter (fun dc -> - match dc with - | Protocol.TextDocumentEdit tde -> - Printf.printf "\nTextDocumentEdit: %s\n" - tde.textDocument.uri; + match edit with + | Some {documentChanges} -> + documentChanges |> Option.get + |> List.iter + (fun + (dc : + [ `CreateFile of Lsp.Types.CreateFile.t + | `DeleteFile of Lsp.Types.DeleteFile.t + | `RenameFile of Lsp.Types.RenameFile.t + | `TextDocumentEdit of + Lsp.Types.TextDocumentEdit.t ]) + -> + match dc with + | `TextDocumentEdit tde -> + let filename = + tde.textDocument.uri |> Uri.toPath + |> Filename.basename + in + Printf.printf "\nTextDocumentEdit: %s\n" filename; - tde.edits - |> List.iter (fun {Protocol.range; newText} -> - let indent = - String.make range.start.character ' ' - in - Printf.printf - "%s\nnewText:\n%s<--here\n%s%s\n" - (Protocol.stringifyRange range) - indent indent newText) - | CreateFile cf -> - Printf.printf "\nCreateFile: %s\n" cf.uri)) + tde.edits + |> List.iter + (fun + (edit : + [ `AnnotatedTextEdit of + Lsp.Types.AnnotatedTextEdit.t + | `TextEdit of Lsp.Types.TextEdit.t ]) + -> + let start_char, newText, range = + match edit with + | `TextEdit te -> + ( te.range.start.character, + te.newText, + te.range ) + | `AnnotatedTextEdit te -> + ( te.range.start.character, + te.newText, + te.range ) + in + let indent = String.make start_char ' ' in + Printf.printf + "%s\nnewText:\n%s<--here\n%s%s\n" + (Lsp.Types.Range.yojson_of_t range + |> Yojson.Safe.pretty_to_string) + indent indent newText) + | `CreateFile cf -> + let filename = + cf.uri |> Uri.toPath |> Filename.basename + in + Printf.printf "\nCreateFile: %s\n" filename + | _ -> + failwith "not implemented text document edit test") + | None -> ()) | "c-a" -> let hint = String.sub rest 3 (String.length rest - 3) in print_endline diff --git a/analysis/src/CodeActions.ml b/analysis/src/CodeActions.ml index 013395b3abe..8f64eaba9a7 100644 --- a/analysis/src/CodeActions.ml +++ b/analysis/src/CodeActions.ml @@ -1,27 +1,23 @@ (* This is the return that's expected when resolving code actions *) -type result = Protocol.codeAction list - -let stringifyCodeActions codeActions = - Printf.sprintf {|%s|} - (codeActions |> List.map Protocol.stringifyCodeAction |> Protocol.array) let make ~title ~kind ~uri ~newText ~range = - let uri = uri |> Uri.fromPath |> Uri.toString in - { - Protocol.title; - codeActionKind = kind; - edit = - { - documentChanges = - [ - TextDocumentEdit - { - Protocol.textDocument = {version = None; uri}; - edits = [{newText; range}]; - }; - ]; - }; - } + let textDocument = + Lsp.Types.OptionalVersionedTextDocumentIdentifier.create + ~uri:(Uri.fromString uri) () + in + let edit = + Lsp.Types.WorkspaceEdit.create + ~documentChanges: + [ + `TextDocumentEdit + (Lsp.Types.TextDocumentEdit.create + ~edits:[`TextEdit (Lsp.Types.TextEdit.create ~range ~newText)] + ~textDocument); + ] + () + in + Lsp.Types.CodeAction.create ~title ~kind ~edit () let makeWithDocumentChanges ~title ~kind ~documentChanges = - {Protocol.title; codeActionKind = kind; edit = {documentChanges}} + let edit = Lsp.Types.WorkspaceEdit.create ~documentChanges () in + Lsp.Types.CodeAction.create ~title ~kind ~edit () diff --git a/analysis/src/Commands.ml b/analysis/src/Commands.ml index 0ce67fad485..8d74388bb7b 100644 --- a/analysis/src/Commands.ml +++ b/analysis/src/Commands.ml @@ -33,7 +33,13 @@ let completionResolve ~(full : SharedTypes.full option) ~modulePath = None | Some file -> Some (file.structure.docstring |> String.concat "\n\n")) in - docstring + match docstring with + | None -> None + | Some value -> + Some + (`MarkupContent + (Lsp.Types.MarkupContent.create ~kind:Lsp.Types.MarkupKind.Markdown + ~value)) let hover ~source ~kindFile ~pos ~supportsMarkdownLinks ~full ~debug = let result = @@ -72,17 +78,21 @@ let hover ~source ~kindFile ~pos ~supportsMarkdownLinks ~full ~debug = if skipZero then None else Hover.newHover ~supportsMarkdownLinks ~full locItem) in - result + match result with + | None -> None + | Some value -> + Some + (Lsp.Types.Hover.create + ~contents: + (`MarkupContent + (Lsp.Types.MarkupContent.create + ~kind:Lsp.Types.MarkupKind.Markdown ~value)) + ()) let signatureHelp ~source ~kindFile ~pos ~allowForConstructorPayloads ~full ~debug = - match - SignatureHelp.signatureHelp ~debug ~source ~kindFile ~pos - ~allowForConstructorPayloads ~full - with - | None -> - {Protocol.signatures = []; activeSignature = None; activeParameter = None} - | Some res -> res + SignatureHelp.signatureHelp ~debug ~source ~kindFile ~pos + ~allowForConstructorPayloads ~full let definition ~full ~pos ~debug = let locationOpt = @@ -112,10 +122,8 @@ let definition ~full ~pos ~debug = if skipLoc then None else Some - { - Protocol.uri = Files.canonicalizeUri uri; - range = Utils.cmtLocToRange loc; - } + (Lsp.Types.Location.create ~range:(Utils.cmtLocToRange loc) + ~uri:(Files.canonicalizeUri uri |> Uri.fromString)) | Some _ -> None)) in locationOpt @@ -132,10 +140,8 @@ let typeDefinition ~full ~pos ~debug = | None -> None | Some (uri, loc) -> Some - { - Protocol.uri = Files.canonicalizeUri uri; - range = Utils.cmtLocToRange loc; - })) + (Lsp.Types.Location.create ~range:(Utils.cmtLocToRange loc) + ~uri:(Files.canonicalizeUri uri |> Uri.fromString)))) in maybeLocation @@ -157,10 +163,8 @@ let references ~full ~pos ~debug = | None -> Uri.toTopLevelLoc uri2 in - { - Protocol.uri = Uri.toString uri2; - range = Utils.cmtLocToRange loc; - } + Lsp.Types.Location.create ~range:(Utils.cmtLocToRange loc) + ~uri:(Uri.toString uri2 |> Uri.fromString) :: acc) []) in @@ -189,17 +193,19 @@ let rename ~full ~pos ~newName ~debug = let fileRenames = referencesToToplevelModules |> List.map (fun uri -> - let path = Uri.toPath uri in - let dir = Filename.dirname path in + let path = Uri.toString uri in + let dir = + match Filename.dirname path with + | "." -> "" + | other -> other + in let newPath = Filename.concat dir (newName ^ Filename.extension path) in - let newUri = Uri.fromPath newPath in - Protocol. - { - oldUri = uri |> Uri.toString; - newUri = newUri |> Uri.toString; - }) + `RenameFile + (Lsp.Types.RenameFile.create ~newUri:(newPath |> Uri.fromPath) + ~oldUri:(uri |> Uri.toString |> Uri.fromString) + ())) in let textDocumentEdits = let module StringMap = Misc.StringMap in @@ -209,8 +215,9 @@ let rename ~full ~pos ~newName ~debug = |> List.fold_left (fun acc (uri, loc) -> let textEdit = - Protocol. - {range = Utils.cmtLocToRange loc; newText = newName} + `TextEdit + (Lsp.Types.TextEdit.create ~newText:newName + ~range:(Utils.cmtLocToRange loc)) in match StringMap.find_opt uri acc with | None -> StringMap.add uri [textEdit] acc @@ -220,16 +227,27 @@ let rename ~full ~pos ~newName ~debug = in StringMap.fold (fun uri edits acc -> + let textDocument = + Lsp.Types.OptionalVersionedTextDocumentIdentifier.create + ~version:0 ~uri:(Uri.fromString uri) () + in let textDocumentEdit = - Protocol.{textDocument = {uri; version = None}; edits} + `TextDocumentEdit + (Lsp.Types.TextDocumentEdit.create ~edits ~textDocument) in textDocumentEdit :: acc) textEditsByUri [] in - Some (fileRenames, textDocumentEdits)) + let documentChanges = fileRenames @ textDocumentEdits in + Some (Lsp.Types.WorkspaceEdit.create ~documentChanges ())) in result +type prepareRenameResult = { + range: Lsp.Types.Range.t; + placeholder: string option; +} + let prepareRename ~full ~pos ~debug = match full with | None -> None @@ -245,10 +263,7 @@ let prepareRename ~full ~pos ~debug = Some name | _ -> None in - Some - (match placeholderOpt with - | None -> Protocol.Range range - | Some placeholder -> Protocol.Placeholder {range; placeholder})) + Some {range; placeholder = placeholderOpt}) let format ~source ~kindFile = let create_range text = @@ -259,15 +274,12 @@ let format ~source ~kindFile = | Some line -> String.length line | None -> 0 in - Protocol. - { - range = - { - start = {line = 0; character = 0}; - end_ = {line = lines_len - 1; character}; - }; - newText = text; - } + let range = + Lsp.Types.Range.create + ~start:(Lsp.Types.Position.create ~line:0 ~character:0) + ~end_:(Lsp.Types.Position.create ~line:(lines_len - 1) ~character) + in + Lsp.Types.TextEdit.create ~newText:text ~range in let result = diff --git a/analysis/src/CompletionBackEnd.ml b/analysis/src/CompletionBackEnd.ml index 4ea79d7755a..8d934ca165d 100644 --- a/analysis/src/CompletionBackEnd.ml +++ b/analysis/src/CompletionBackEnd.ml @@ -379,8 +379,9 @@ let kindToDetail name (kind : Completion.kind) = let kindToData filePath (kind : Completion.kind) = match kind with - | FileModule f -> Some [("modulePath", f); ("filePath", filePath)] - | _ -> None + | FileModule f -> + Some (`Assoc [("modulePath", `String f); ("filePath", `String filePath)]) + | _ -> Some `Null let findAllCompletions ~(env : QueryEnv.t) ~prefix ~exact ~namesUsed ~(completionContext : Completable.completionContext) = @@ -816,24 +817,29 @@ let mkItem ?data ?additionalTextEdits name ~kind ~detail ~deprecated ~docstring let tags = match deprecated with | None -> [] - | Some _ -> [1 (* deprecated *)] + | Some _ -> [Lsp.Types.CompletionItemTag.Deprecated (* deprecated *)] in - Protocol. - { - label = name; - kind; - tags; - detail; - documentation = - (if docContent = "" then None - else Some {kind = "markdown"; value = docContent}); - sortText = None; - insertText = None; - insertTextFormat = None; - filterText = None; - data; - additionalTextEdits; - } + + let documentation = + match String.length docContent > 0 with + | true -> + Some + (`MarkupContent + (Lsp.Types.MarkupContent.create ~kind:Lsp.Types.MarkupKind.Markdown + ~value:docContent)) + | false -> None + in + + let deprecated = if Option.is_some deprecated then Some true else None in + let data = + match data with + | Some `Null | None -> None + | Some other -> Some other + in + + Lsp.Types.CompletionItem.create ~label:name ~kind ~tags ~detail ?documentation + ?deprecated ?data ?additionalTextEdits ?sortText:None ?insertText:None + ?insertTextFormat:None ?filterText:None () let completionToItem { @@ -852,7 +858,7 @@ let completionToItem let item = mkItem name ?additionalTextEdits ?data:(kindToData (full.file.uri |> Uri.toPath) kind) - ~kind:(Completion.kindToInt kind) + ~kind:(Completion.kindToLspCompletionItem kind) ~deprecated ~detail: (match detail with @@ -2129,12 +2135,12 @@ let rec processCompletable ~debug ~full ~scope ~env ~pos ~forHover completable = if debug then print_endline "Could not read package.json"; [] | Some s -> ( - match Json.parse s with - | Some (Object items) -> + match YojsonHelpers.from_string_opt s with + | Some (`Assoc items) -> items |> List.filter_map (fun (key, t) -> match (key, t) with - | ("dependencies" | "devDependencies"), Json.Object o -> + | ("dependencies" | "devDependencies"), `Assoc o -> Some (o |> List.filter_map (fun (pkgName, _) -> diff --git a/analysis/src/Diagnostics.ml b/analysis/src/Diagnostics.ml index 970936c022b..1dad9a9b6fa 100644 --- a/analysis/src/Diagnostics.ml +++ b/analysis/src/Diagnostics.ml @@ -8,16 +8,18 @@ let document_syntax ~source ~kindFile = let _, endline, endcol = Location.get_pos_info (Res_diagnostics.get_end_pos diagnostic) in - Protocol. - { - range = - { - start = {line = startline - 1; character = startcol}; - end_ = {line = endline - 1; character = endcol}; - }; - message = Res_diagnostics.explain diagnostic; - severity = 1; - }) + let range = + Lsp.Types.Range.create + ~start: + (Lsp.Types.Position.create ~line:(startline - 1) + ~character:startcol) + ~end_: + (Lsp.Types.Position.create ~line:(endline - 1) + ~character:endcol) + in + Lsp.Types.Diagnostic.create ~range + ~message:(`String (Res_diagnostics.explain diagnostic)) + ~severity:Lsp.Types.DiagnosticSeverity.Error ()) in if kindFile = Files.Res then let parseImplementation = diff --git a/analysis/src/DocumentSymbol.ml b/analysis/src/DocumentSymbol.ml index 0e5b982b5bf..856b0299063 100644 --- a/analysis/src/DocumentSymbol.ml +++ b/analysis/src/DocumentSymbol.ml @@ -1,29 +1,5 @@ (* https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_documentSymbol *) -type kind = - | Module - | Property - | Constructor - | Function - | Variable - | Constant - | String - | Number - | EnumMember - | TypeParameter - -let kindNumber = function - | Module -> 2 - | Property -> 7 - | Constructor -> 9 - | Function -> 12 - | Variable -> 13 - | Constant -> 14 - | String -> 15 - | Number -> 16 - | EnumMember -> 22 - | TypeParameter -> 26 - let command ~path = let symbols = ref [] in let addSymbol name loc kind = @@ -33,19 +9,21 @@ let command ~path = && loc.loc_end.pos_cnum >= 0 then let range = Utils.cmtLocToRange loc in - let symbol : Protocol.documentSymbolItem = - {name; range; kind = kindNumber kind; children = []} + let symbol = + Lsp.Types.DocumentSymbol.create ~name ~range ~selectionRange:range + ~children:[] ~kind () in symbols := symbol :: !symbols in let rec exprKind (exp : Parsetree.expression) = match exp.pexp_desc with - | Pexp_fun _ -> Function + | Pexp_fun _ -> Lsp.Types.SymbolKind.Function | Pexp_constraint (e, _) -> exprKind e - | Pexp_constant (Pconst_string _) -> String - | Pexp_constant (Pconst_float _ | Pconst_integer _) -> Number - | Pexp_constant _ -> Constant - | _ -> Variable + | Pexp_constant (Pconst_string _) -> Lsp.Types.SymbolKind.String + | Pexp_constant (Pconst_float _ | Pconst_integer _) -> + Lsp.Types.SymbolKind.Number + | Pexp_constant _ -> Lsp.Types.SymbolKind.Constant + | _ -> Lsp.Types.SymbolKind.Variable in let processTypeKind (tk : Parsetree.type_kind) = match tk with @@ -153,7 +131,7 @@ let command ~path = end_ = {line = el1; character = ec1}; }; } : - Protocol.documentSymbolItem) + Lsp.Types.DocumentSymbol.t) ({ range = { @@ -161,12 +139,12 @@ let command ~path = end_ = {line = el2; character = ec2}; }; } : - Protocol.documentSymbolItem) = + Lsp.Types.DocumentSymbol.t) = (sl1 > sl2 || (sl1 = sl2 && sc1 >= sc2)) && (el1 < el2 || (el1 = el2 && ec1 <= ec2)) in - let compareSymbol (s1 : Protocol.documentSymbolItem) - (s2 : Protocol.documentSymbolItem) = + let compareSymbol (s1 : Lsp.Types.DocumentSymbol.t) + (s2 : Lsp.Types.DocumentSymbol.t) = let n = compare s1.range.start.line s2.range.start.line in if n <> 0 then n else @@ -182,10 +160,13 @@ let command ~path = | [] -> [symbol] | last :: rest -> if isInside symbol last then - let newLast = - {last with children = last.children |> addSymbolToChildren ~symbol} - in - newLast :: rest + match last.children with + | Some c -> + let newLast = + {last with children = Some (c |> addSymbolToChildren ~symbol)} + in + newLast :: rest + | _ -> rest else symbol :: children in let rec addSortedSymbolsToChildren ~sortedSymbols children = @@ -198,4 +179,6 @@ let command ~path = in let sortedSymbols = !symbols |> List.sort compareSymbol in let symbolsWithChildren = [] |> addSortedSymbolsToChildren ~sortedSymbols in - print_endline (Protocol.stringifyDocumentSymbolItems symbolsWithChildren) + `List (symbolsWithChildren |> List.map Lsp.Types.DocumentSymbol.yojson_of_t) + |> Yojson.Safe.pretty_to_string ~std:true + |> print_endline diff --git a/analysis/src/FindFiles.ml b/analysis/src/FindFiles.ml index 9b2fd500849..9457640f958 100644 --- a/analysis/src/FindFiles.ml +++ b/analysis/src/FindFiles.ml @@ -6,33 +6,34 @@ let bind f x = Option.bind x f let getSourceDirectories ~includeDev ~baseDir config = let rec handleItem current item = match item with - | Json.Array contents -> - List.map (handleItem current) contents |> List.concat - | Json.String text -> [current /+ text] - | Json.Object _ -> ( + | `List contents -> List.map (handleItem current) contents |> List.concat + | `String text -> [current /+ text] + | `Assoc _ -> ( let dir = - item |> Json.get "dir" |> bind Json.string + item |> YojsonHelpers.get "dir" + |> bind Yojson.Safe.Util.to_string_option |> Option.value ~default:"Must specify directory" in let typ = if includeDev then "lib" else - item |> Json.get "type" |> bind Json.string + item |> YojsonHelpers.get "type" + |> bind Yojson.Safe.Util.to_string_option |> Option.value ~default:"lib" in if typ = "dev" then [] else - match item |> Json.get "subdirs" with - | None | Some Json.False -> [current /+ dir] - | Some Json.True -> + match item |> YojsonHelpers.get "subdirs" with + | None | Some (`Bool false) -> [current /+ dir] + | Some (`Bool true) -> Files.collectDirs (baseDir /+ current /+ dir) |> List.filter (fun name -> name <> Filename.current_dir_name) |> List.map (Files.relpath baseDir) | Some item -> (current /+ dir) :: handleItem (current /+ dir) item) | _ -> failwith "Invalid subdirs entry" in - match config |> Json.get "sources" with + match config |> YojsonHelpers.get "sources" with | None -> [] | Some item -> handleItem "" item @@ -94,28 +95,36 @@ let nameSpaceToName n = |> String.concat "" let getNamespace config = - let ns = config |> Json.get "namespace" in - let fromString = ns |> bind Json.string in + let ns = config |> YojsonHelpers.get "namespace" in + let fromString = ns |> bind Yojson.Safe.Util.to_string_option in let isNamespaced = - ns |> bind Json.bool |> Option.value ~default:(fromString |> Option.is_some) + ns + |> bind Yojson.Safe.Util.to_bool_option + |> Option.value ~default:(fromString |> Option.is_some) in let either x y = if x = None then y else x in if isNamespaced then - let fromName = config |> Json.get "name" |> bind Json.string in + let fromName = + config |> YojsonHelpers.get "name" + |> bind Yojson.Safe.Util.to_string_option + in either fromString fromName |> Option.map nameSpaceToName else None module StringSet = Set.Make (String) let getPublic config = - let public = config |> Json.get "public" in + let public = config |> YojsonHelpers.get "public" in match public with | None -> None | Some public -> ( - match public |> Json.array with + match public |> YojsonHelpers.to_list_opt with | None -> None | Some public -> - Some (public |> List.filter_map Json.string |> StringSet.of_list)) + Some + (public + |> List.filter_map Yojson.Safe.Util.to_string_option + |> StringSet.of_list)) let collectFiles directory = let allFiles = Files.readDirectory directory in @@ -141,7 +150,7 @@ let collectFiles directory = let readSourcedirsPackageRoots base = let sourceDirsFile = base /+ "lib" /+ "bs" /+ ".sourcedirs.json" in let readPackageEntry = function - | Json.Array [Json.String name; Json.String path] -> + | `List [`String name; `String path] -> let path = if Filename.is_relative path then base /+ path else path in Some (name, path) | _ -> None @@ -149,10 +158,12 @@ let readSourcedirsPackageRoots base = match Files.readFile sourceDirsFile with | None -> [] | Some text -> ( - match Json.parse text with + match YojsonHelpers.from_string_opt text with | None -> [] | Some json -> ( - match json |> Json.get "pkgs" |> bind Json.array with + match + json |> YojsonHelpers.get "pkgs" |> bind YojsonHelpers.to_list_opt + with | None -> [] | Some packages -> packages |> List.filter_map readPackageEntry)) @@ -242,20 +253,29 @@ let findProjectFiles ~public ~namespace ~path ~sourceDirectories ~libBs = let findDependencyFiles base config = let deps = match - ( config |> Json.get "dependencies" |> bind Json.array, - config |> Json.get "bs-dependencies" |> bind Json.array ) + ( config + |> YojsonHelpers.get "dependencies" + |> bind YojsonHelpers.to_list_opt, + config + |> YojsonHelpers.get "bs-dependencies" + |> bind YojsonHelpers.to_list_opt ) with | None, None -> [] - | Some deps, None | _, Some deps -> deps |> List.filter_map Json.string + | Some deps, None | _, Some deps -> + deps |> List.filter_map Yojson.Safe.Util.to_string_option in let devDeps = match - ( config |> Json.get "dev-dependencies" |> bind Json.array, - config |> Json.get "bs-dev-dependencies" |> bind Json.array ) + ( config + |> YojsonHelpers.get "dev-dependencies" + |> bind YojsonHelpers.to_list_opt, + config + |> YojsonHelpers.get "bs-dev-dependencies" + |> bind YojsonHelpers.to_list_opt ) with | None, None -> [] | Some devDeps, None | _, Some devDeps -> - devDeps |> List.filter_map Json.string + devDeps |> List.filter_map (fun x -> Some (Yojson.Safe.Util.to_string x)) in let deps = deps @ devDeps in Log.log ("Dependencies: " ^ String.concat " " deps); @@ -264,12 +284,12 @@ let findDependencyFiles base config = deps |> List.map (fun name -> let result = - Json.bind (findPackageRoot ~base ~sourcedirsPackageRoots name) + bind (fun path -> let rescriptJsonPath = path /+ "rescript.json" in let parseText text = - match Json.parse text with + match YojsonHelpers.from_string_opt text with | Some inner -> ( let namespace = getNamespace inner in let sourceDirectories = @@ -298,6 +318,7 @@ let findDependencyFiles base config = match Files.readFile rescriptJsonPath with | Some text -> parseText text | None -> None) + (findPackageRoot ~base ~sourcedirsPackageRoots name) in match result with diff --git a/analysis/src/Hint.ml b/analysis/src/Hint.ml index 81881be3bc0..d5f10838077 100644 --- a/analysis/src/Hint.ml +++ b/analysis/src/Hint.ml @@ -1,8 +1,8 @@ open SharedTypes type inlayHintKind = Type -let inlayKindToNumber = function - | Type -> 1 +let inlayKindToLspInlayHint = function + | Type -> Lsp.Types.InlayHintKind.Type let locItemToTypeHint ~full:{file; package} locItem = match locItem.locType with @@ -83,7 +83,7 @@ let inlay ~source ~kindFile ~pos ~maxLength ~full ~debug = | Some full -> let result = !hints - |> List.filter_map (fun ((range : Protocol.range), hintKind) -> + |> List.filter_map (fun ((range : Lsp.Types.Range.t), hintKind) -> match References.getLocItem ~full ~pos:(range.start.line, range.start.character + 1) @@ -91,20 +91,17 @@ let inlay ~source ~kindFile ~pos ~maxLength ~full ~debug = with | None -> None | Some locItem -> ( - let position : Protocol.position = - {line = range.start.line; character = range.end_.character} + let position = + Lsp.Types.Position.create ~line:range.start.line + ~character:range.end_.character in match locItemToTypeHint locItem ~full with | Some label -> ( + let kind = inlayKindToLspInlayHint hintKind in + let label = ": " ^ label in let result = - Protocol. - { - kind = inlayKindToNumber hintKind; - position; - paddingLeft = true; - paddingRight = false; - label = ": " ^ label; - } + Lsp.Types.InlayHint.create ~position ~kind ~paddingLeft:true + ~paddingRight:false ~label:(`String label) () in match maxlen with | Some value -> @@ -148,29 +145,24 @@ let codeLens ~source ~kindFile ~full ~debug = | Some full -> let result = !lenses - |> List.filter_map (fun (range : Protocol.range) -> + |> List.filter_map (fun (range : Lsp.Types.Range.t) -> match References.getLocItem ~full ~pos:(range.start.line, range.start.character + 1) ~debug with | Some {locType = Typed (_, typeExpr, _)} -> - Some - Protocol. - { - range; - command = - Some - { - (* Code lenses can run commands. An empty command string means we just want the editor - to print the text, not link to running a command. *) - command = ""; - (* Print the type with a huge line width, because the code lens always prints on a - single line in the editor. *) - title = - typeExpr |> Shared.typeToString ~lineWidth:400; - }; - } + (* Code lenses can run commands. An empty command string means we just want the editor + to print the text, not link to running a command. *) + let command = + Lsp.Types.Command.create + ~command:"" + (* Print the type with a huge line width, because the code lens always prints on a + single line in the editor. *) + ~title:(typeExpr |> Shared.typeToString ~lineWidth:400) + () + in + Some (Lsp.Types.CodeLens.create ~range ~command ()) | _ -> None) in Some result diff --git a/analysis/src/Loc.ml b/analysis/src/Loc.ml index 635b787128e..6febb9a6267 100644 --- a/analysis/src/Loc.ml +++ b/analysis/src/Loc.ml @@ -9,18 +9,18 @@ let toString (loc : t) = let hasPos ~pos loc = start loc <= pos && pos < end_ loc -(** Allows the character after the end to be included. Ie when the cursor is at the +(** Allows the character after the end to be included. Ie when the cursor is at the end of the word, like `someIdentifier`. Useful in some scenarios. *) let hasPosInclusiveEnd ~pos loc = start loc <= pos && pos <= end_ loc let mkPosition (pos : Pos.t) = let line, character = pos in - {Protocol.line; character} + Lsp.Types.Position.create ~line ~character let rangeOfLoc (loc : t) = let start = loc |> start |> mkPosition in let end_ = loc |> end_ |> mkPosition in - {Protocol.start; end_} + Lsp.Types.Range.create ~start ~end_ let isInside (x : t) (y : t) = x.loc_start.pos_cnum >= y.loc_start.pos_cnum diff --git a/analysis/src/Markdown.ml b/analysis/src/Markdown.ml index 0f82050fb0d..16d7f0c7a26 100644 --- a/analysis/src/Markdown.ml +++ b/analysis/src/Markdown.ml @@ -2,7 +2,7 @@ let spacing = "\n```\n \n```\n" let codeBlock code = Printf.sprintf "```rescript\n%s\n```" code let divider = "\n---\n" -type link = {startPos: Protocol.position; file: string; label: string} +type link = {startPos: Lsp.Types.Position.t; file: string; label: string} let linkToCommandArgs link = Printf.sprintf "[\"%s\",%i,%i]" link.file link.startPos.line diff --git a/analysis/src/Packages.ml b/analysis/src/Packages.ml index 8852119d17f..5edab49e2cf 100644 --- a/analysis/src/Packages.ml +++ b/analysis/src/Packages.ml @@ -41,38 +41,38 @@ let newBsPackage ~rootPath = | true -> BuildSystem.getStdlib rootPath | false -> BuildSystem.getLibBs rootPath in - match Json.parse raw with + match YojsonHelpers.from_string_opt raw with | Some config -> ( let namespace = FindFiles.getNamespace config in let rescriptVersion = getReScriptVersion () in let suffix = - match config |> Json.get "suffix" with - | Some (String suffix) -> suffix + match config |> YojsonHelpers.get "suffix" with + | Some (`String suffix) -> suffix | _ -> ".js" in let genericJsxModule = - let jsxConfig = config |> Json.get "jsx" in + let jsxConfig = config |> YojsonHelpers.get "jsx" in match jsxConfig with | Some jsxConfig -> ( - match jsxConfig |> Json.get "module" with - | Some (String m) when String.lowercase_ascii m <> "react" -> Some m + match jsxConfig |> YojsonHelpers.get "module" with + | Some (`String m) when String.lowercase_ascii m <> "react" -> Some m | _ -> None) | None -> None in let autocomplete = - match config |> Json.get "editor" with + match config |> YojsonHelpers.get "editor" with | Some editorConfig -> ( - match editorConfig |> Json.get "autocomplete" with - | Some (Object map) -> + match editorConfig |> YojsonHelpers.get "autocomplete" with + | Some (`Assoc map) -> map |> List.fold_left (fun acc (key, value) -> match value with - | Json.Array items -> + | `List items -> let values = items |> List.filter_map (function - | Json.String s -> Some s + | `String s -> Some s | _ -> None) in Misc.StringMap.add key values acc @@ -132,8 +132,10 @@ let newBsPackage ~rootPath = let bind f x = Option.bind x f in let compiler_flags = match - ( Json.get "compiler-flags" config |> bind Json.array, - Json.get "bsc-flags" config |> bind Json.array ) + ( YojsonHelpers.get "compiler-flags" config + |> bind YojsonHelpers.to_list_opt, + YojsonHelpers.get "bsc-flags" config + |> bind YojsonHelpers.to_list_opt ) with | Some compiler_flags, None | _, Some compiler_flags -> compiler_flags @@ -141,12 +143,15 @@ let newBsPackage ~rootPath = in let no_pervasives = compiler_flags - |> List.exists (fun s -> Json.string s = Some "-nopervasives") + |> List.exists (fun s -> + match s with + | `String s -> s = "-nopervasives" + | _ -> false) in let opens_from_compiler_flags = List.fold_left (fun opens item -> - match item |> Json.string with + match item |> Yojson.Safe.Util.to_string_option with | None -> opens | Some s -> ( let parts = String.split_on_char ' ' s in diff --git a/analysis/src/Protocol.ml b/analysis/src/Protocol.ml deleted file mode 100644 index 447584b7e9b..00000000000 --- a/analysis/src/Protocol.ml +++ /dev/null @@ -1,388 +0,0 @@ -type position = {line: int; character: int} -type range = {start: position; end_: position} -type markupContent = {kind: string; value: string} - -(* https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#command *) -type command = {title: string; command: string} - -(* https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#codeLens *) -type codeLens = {range: range; command: command option} - -type inlayHint = { - position: position; - label: string; - kind: int; - paddingLeft: bool; - paddingRight: bool; -} - -(* https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#parameterInformation *) -type parameterInformation = {label: int * int; documentation: markupContent} - -(* https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#signatureInformation *) -type signatureInformation = { - label: string; - parameters: parameterInformation list; - documentation: markupContent option; -} - -(* https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#signatureHelp *) -type signatureHelp = { - signatures: signatureInformation list; - activeSignature: int option; - activeParameter: int option; -} - -(* https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#insertTextFormat *) -type insertTextFormat = Snippet - -let insertTextFormatToInt f = - match f with - | Snippet -> 2 - -type textEdit = {range: range; newText: string} - -type completionItem = { - label: string; - kind: int; - tags: int list; - detail: string; - sortText: string option; - filterText: string option; - insertTextFormat: insertTextFormat option; - insertText: string option; - documentation: markupContent option; - data: (string * string) list option; - additionalTextEdits: textEdit list option; -} - -type location = {uri: string; range: range} -type documentSymbolItem = { - name: string; - kind: int; - range: range; - children: documentSymbolItem list; -} -type prepareRenameWithPlaceholder = {range: range; placeholder: string} -type prepareRename = - | Range of range - | Placeholder of prepareRenameWithPlaceholder -type renameFile = {oldUri: string; newUri: string} -type diagnostic = {range: range; message: string; severity: int} - -type optionalVersionedTextDocumentIdentifier = { - version: int option; - uri: string; -} - -type textDocumentEdit = { - textDocument: optionalVersionedTextDocumentIdentifier; - edits: textEdit list; -} - -type createFileOptions = {overwrite: bool option; ignoreIfExists: bool option} -type createFile = {uri: string; options: createFileOptions option} - -type documentChange = - | TextDocumentEdit of textDocumentEdit - | CreateFile of createFile - -type codeActionEdit = {documentChanges: documentChange list} -type codeActionKind = RefactorRewrite - -type codeAction = { - title: string; - codeActionKind: codeActionKind; - edit: codeActionEdit; -} - -type semanticTokens = {data: int array} - -let wrapInQuotes s = "\"" ^ Json.escape s ^ "\"" - -let null = "null" -let array l = "[" ^ String.concat ", " l ^ "]" - -let stringifyPosition p = - Printf.sprintf {|{"line": %i, "character": %i}|} p.line p.character - -let stringifyRange r = - Printf.sprintf {|{"start": %s, "end": %s}|} - (stringifyPosition r.start) - (stringifyPosition r.end_) - -let stringifyRangeWithPlaceholder (r : prepareRenameWithPlaceholder) = - Printf.sprintf - {|{ - "range": %s, - "placeholder": %s - }|} - (stringifyRange r.range) - (wrapInQuotes r.placeholder) - -let stringifyTextEdit (te : textEdit) = - Printf.sprintf - {|{ - "range": %s, - "newText": %s - }|} - (stringifyRange te.range) (wrapInQuotes te.newText) - -let stringifyMarkupContent (m : markupContent) = - Printf.sprintf {|{"kind": %s, "value": %s}|} (wrapInQuotes m.kind) - (wrapInQuotes m.value) - -(** None values are not emitted in the output. *) -let stringifyObject ?(startOnNewline = false) ?(indentation = 1) properties = - let indentationStr = String.make (indentation * 2) ' ' in - (if startOnNewline then "\n" ^ indentationStr else "") - ^ {|{ -|} - ^ (properties - |> List.filter_map (fun (key, value) -> - match value with - | None -> None - | Some v -> - Some (Printf.sprintf {|%s "%s": %s|} indentationStr key v)) - |> String.concat ",\n") - ^ "\n" ^ indentationStr ^ "}" - -let optWrapInQuotes s = - match s with - | None -> None - | Some s -> Some (wrapInQuotes s) - -let stringifyResult = function - | Ok r -> stringifyObject [("TAG", Some (wrapInQuotes "Ok")); ("_0", Some r)] - | Error e -> - stringifyObject [("TAG", Some (wrapInQuotes "Error")); ("_0", Some e)] - -let stringifyCompletionItem c = - stringifyObject - [ - ("label", Some (wrapInQuotes c.label)); - ("kind", Some (string_of_int c.kind)); - ("tags", Some (c.tags |> List.map string_of_int |> array)); - ("detail", Some (wrapInQuotes c.detail)); - ( "documentation", - Some - (match c.documentation with - | None -> null - | Some doc -> stringifyMarkupContent doc) ); - ("sortText", optWrapInQuotes c.sortText); - ("filterText", optWrapInQuotes c.filterText); - ("insertText", optWrapInQuotes c.insertText); - ( "insertTextFormat", - match c.insertTextFormat with - | None -> None - | Some insertTextFormat -> - Some (Printf.sprintf "%i" (insertTextFormatToInt insertTextFormat)) ); - ( "data", - match c.data with - | None -> None - | Some fields -> - Some - (fields - |> List.map (fun (key, value) -> (key, Some (wrapInQuotes value))) - |> stringifyObject ~indentation:2) ); - ( "additionalTextEdits", - match c.additionalTextEdits with - | Some additionalTextEdits -> - Some (additionalTextEdits |> List.map stringifyTextEdit |> array) - | None -> None ); - ] - -let stringifyHover value = - Printf.sprintf {|{"contents": %s}|} - (stringifyMarkupContent {kind = "markdown"; value}) - -let stringifyLocation (h : location) = - Printf.sprintf {|{"uri": %s, "range": %s}|} (wrapInQuotes h.uri) - (stringifyRange h.range) - -let stringifyDocumentSymbolItems items = - let buf = Buffer.create 10 in - let stringifyName name = Printf.sprintf "\"%s\"" (Json.escape name) in - let stringifyKind kind = string_of_int kind in - let emitStr = Buffer.add_string buf in - let emitSep () = emitStr ",\n" in - let rec emitItem ~indent item = - let openBrace = Printf.sprintf "%s{\n" indent in - let closeBrace = Printf.sprintf "\n%s}" indent in - let indent = indent ^ " " in - let emitField name s = - emitStr (Printf.sprintf "%s\"%s\": %s" indent name s) - in - emitStr openBrace; - emitField "name" (stringifyName item.name); - emitSep (); - emitField "kind" (stringifyKind item.kind); - emitSep (); - emitField "range" (stringifyRange item.range); - emitSep (); - emitField "selectionRange" (stringifyRange item.range); - if item.children <> [] then ( - emitSep (); - emitField "children" "[\n"; - emitBody ~indent (List.rev item.children); - emitStr "]"); - emitStr closeBrace - and emitBody ~indent items = - match items with - | [] -> () - | item :: rest -> - emitItem ~indent item; - if rest <> [] then emitSep (); - emitBody ~indent rest - in - let indent = "" in - emitStr "[\n"; - emitBody ~indent (List.rev items); - emitStr "\n]"; - Buffer.contents buf - -let stringifyRenameFile {oldUri; newUri} = - Printf.sprintf {|{ - "kind": "rename", - "oldUri": %s, - "newUri": %s -}|} - (wrapInQuotes oldUri) (wrapInQuotes newUri) - -let stringifyoptionalVersionedTextDocumentIdentifier td = - Printf.sprintf {|{ - "version": %s, - "uri": %s - }|} - (match td.version with - | None -> null - | Some v -> string_of_int v) - (wrapInQuotes td.uri) - -let stringifyTextDocumentEdit tde = - Printf.sprintf {|{ - "textDocument": %s, - "edits": %s - }|} - (stringifyoptionalVersionedTextDocumentIdentifier tde.textDocument) - (tde.edits |> List.map stringifyTextEdit |> array) - -let stringifyCreateFile cf = - stringifyObject - [ - ("kind", Some (wrapInQuotes "create")); - ("uri", Some (wrapInQuotes cf.uri)); - ( "options", - match cf.options with - | None -> None - | Some options -> - Some - (stringifyObject - [ - ( "overwrite", - match options.overwrite with - | None -> None - | Some ov -> Some (string_of_bool ov) ); - ( "ignoreIfExists", - match options.ignoreIfExists with - | None -> None - | Some i -> Some (string_of_bool i) ); - ]) ); - ] - -let stringifyDocumentChange dc = - match dc with - | TextDocumentEdit tde -> stringifyTextDocumentEdit tde - | CreateFile cf -> stringifyCreateFile cf - -let codeActionKindToString kind = - match kind with - | RefactorRewrite -> "refactor.rewrite" - -let stringifyCodeActionEdit cae = - Printf.sprintf {|{"documentChanges": %s}|} - (cae.documentChanges |> List.map stringifyDocumentChange |> array) - -let stringifyCodeAction ca = - Printf.sprintf {|{"title": %s, "kind": %s, "edit": %s}|} - (wrapInQuotes ca.title) - (wrapInQuotes (codeActionKindToString ca.codeActionKind)) - (ca.edit |> stringifyCodeActionEdit) - -let stringifyHint (hint : inlayHint) = - Printf.sprintf - {|{ - "position": %s, - "label": %s, - "kind": %i, - "paddingLeft": %b, - "paddingRight": %b -}|} - (stringifyPosition hint.position) - (wrapInQuotes hint.label) hint.kind hint.paddingLeft hint.paddingRight - -let stringifyCommand (command : command) = - Printf.sprintf {|{"title": %s, "command": %s}|} - (wrapInQuotes command.title) - (wrapInQuotes command.command) - -let stringifyCodeLens (codeLens : codeLens) = - Printf.sprintf - {|{ - "range": %s, - "command": %s - }|} - (stringifyRange codeLens.range) - (match codeLens.command with - | None -> "" - | Some command -> stringifyCommand command) - -let stringifyParameterInformation (parameterInformation : parameterInformation) - = - Printf.sprintf {|{"label": %s, "documentation": %s}|} - (let line, chr = parameterInformation.label in - "[" ^ string_of_int line ^ ", " ^ string_of_int chr ^ "]") - (stringifyMarkupContent parameterInformation.documentation) - -let stringifySignatureInformation (signatureInformation : signatureInformation) - = - Printf.sprintf - {|{ - "label": %s, - "parameters": %s%s - }|} - (wrapInQuotes signatureInformation.label) - (signatureInformation.parameters - |> List.map stringifyParameterInformation - |> array) - (match signatureInformation.documentation with - | None -> "" - | Some docs -> - Printf.sprintf ",\n \"documentation\": %s" - (stringifyMarkupContent docs)) - -let stringifySignatureHelp (signatureHelp : signatureHelp) = - Printf.sprintf - {|{ - "signatures": %s, - "activeSignature": %s, - "activeParameter": %s -}|} - (signatureHelp.signatures |> List.map stringifySignatureInformation |> array) - (match signatureHelp.activeSignature with - | None -> null - | Some activeSignature -> activeSignature |> string_of_int) - (match signatureHelp.activeParameter with - | None -> null - | Some activeParameter -> activeParameter |> string_of_int) - -(* https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#diagnostic *) -let stringifyDiagnostic d = - Printf.sprintf - {|{ - "range": %s, - "message": %s, - "severity": %d, - "source": "ReScript" -}|} - (stringifyRange d.range) (wrapInQuotes d.message) d.severity diff --git a/analysis/src/SemanticTokens.ml b/analysis/src/SemanticTokens.ml index 86feab8ef8d..1862ba612f4 100644 --- a/analysis/src/SemanticTokens.ml +++ b/analysis/src/SemanticTokens.ml @@ -492,4 +492,4 @@ let command ~debug ~emitter ~source ~kindFile = let semanticTokens ~source ~kindFile = let emitter = Token.createEmitter () in command ~emitter ~debug:false ~source ~kindFile; - Protocol.{data = Token.emit emitter} + Lsp.Types.SemanticTokens.create ~data:(Token.emit emitter) () diff --git a/analysis/src/SharedTypes.ml b/analysis/src/SharedTypes.ml index 49752aebf43..cce06e969e9 100644 --- a/analysis/src/SharedTypes.ml +++ b/analysis/src/SharedTypes.ml @@ -833,7 +833,7 @@ module Completion = struct sortText: string option; insertText: string option; filterText: string option; - insertTextFormat: Protocol.insertTextFormat option; + insertTextFormat: Lsp.Types.InsertTextFormat.t option; env: QueryEnv.t; deprecated: string option; docstring: string list; @@ -841,7 +841,7 @@ module Completion = struct detail: string option; typeArgContext: typeArgContext option; data: (string * string) list option; - additionalTextEdits: Protocol.textEdit list option; + additionalTextEdits: Lsp.Types.TextEdit.t list option; synthetic: bool; (** Whether this item is an made up, synthetic item or not. *) } @@ -858,7 +858,8 @@ module Completion = struct sortText; insertText; insertTextFormat = - (if includesSnippets then Some Protocol.Snippet else None); + (if includesSnippets then Some Lsp.Types.InsertTextFormat.Snippet + else None); filterText; detail; typeArgContext; @@ -869,17 +870,18 @@ module Completion = struct (* https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_completion *) (* https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#completionItemKind *) - let kindToInt kind = + let kindToLspCompletionItem kind = match kind with - | Module _ -> 9 - | FileModule _ -> 9 - | Constructor (_, _) | PolyvariantConstructor (_, _) -> 4 - | ObjLabel _ -> 4 - | Label _ -> 4 - | Field (_, _) -> 5 - | Type _ | ExtractedType (_, `Type) -> 22 - | Value _ | ExtractedType (_, `Value) -> 12 - | Snippet _ | FollowContextPath _ -> 15 + | Module _ -> Lsp.Types.CompletionItemKind.Module + | FileModule _ -> Lsp.Types.CompletionItemKind.Module + | Constructor (_, _) | PolyvariantConstructor (_, _) -> + Lsp.Types.CompletionItemKind.Constructor + | ObjLabel _ -> Lsp.Types.CompletionItemKind.Constructor + | Label _ -> Lsp.Types.CompletionItemKind.Constructor + | Field (_, _) -> Lsp.Types.CompletionItemKind.Field + | Type _ | ExtractedType (_, `Type) -> Lsp.Types.CompletionItemKind.Struct + | Value _ | ExtractedType (_, `Value) -> Lsp.Types.CompletionItemKind.Value + | Snippet _ | FollowContextPath _ -> Lsp.Types.CompletionItemKind.Snippet end let kindFromInnerType (t : innerType) = diff --git a/analysis/src/SignatureHelp.ml b/analysis/src/SignatureHelp.ml index 68cfc405906..27a53a0ccbb 100644 --- a/analysis/src/SignatureHelp.ml +++ b/analysis/src/SignatureHelp.ml @@ -463,63 +463,71 @@ let signatureHelp ~debug ~source ~kindFile ~pos ~allowForConstructorPayloads let activeParameter = findActiveParameter ~argAtCursor ~args in let paramUnlabelledArgCount = ref 0 in - Some - { - Protocol.signatures = - [ - { - label = fnTypeStr; - parameters = - parameters - |> List.map (fun (argLabel, start, end_) -> - let paramArgCount = !paramUnlabelledArgCount in - paramUnlabelledArgCount := paramArgCount + 1; - let unlabelledArgCount = ref 0 in - { - Protocol.label = (start, end_); - documentation = - (match - args - |> List.find_opt (fun (lbl, _) -> - let argCount = !unlabelledArgCount in - unlabelledArgCount := argCount + 1; - match (lbl, argLabel) with - | ( Asttypes.Optional {txt = l1}, - Asttypes.Optional {txt = l2} ) - when l1 = l2 -> - true - | ( Labelled {txt = l1}, - Labelled {txt = l2} ) - when l1 = l2 -> - true - | Nolabel, Nolabel - when paramArgCount = argCount -> - true - | _ -> false) - with - | None -> - {Protocol.kind = "markdown"; value = ""} - | Some (_, labelTypExpr) -> - { - Protocol.kind = "markdown"; - value = - docsForLabel ~supportsMarkdownLinks ~file - ~package labelTypExpr; - }); - }); - documentation = - (match List.nth_opt docstring 0 with - | None -> None - | Some docs -> - Some {Protocol.kind = "markdown"; value = docs}); - }; - ]; - activeSignature = Some 0; - activeParameter = + let parametersInformation = + parameters + |> List.map (fun (argLabel, start, end_) -> + let paramArgCount = !paramUnlabelledArgCount in + paramUnlabelledArgCount := paramArgCount + 1; + let unlabelledArgCount = ref 0 in + let documentation = + match + args + |> List.find_opt (fun (lbl, _) -> + let argCount = !unlabelledArgCount in + unlabelledArgCount := argCount + 1; + match (lbl, argLabel) with + | ( Asttypes.Optional {txt = l1}, + Asttypes.Optional {txt = l2} ) + when l1 = l2 -> + true + | Labelled {txt = l1}, Labelled {txt = l2} + when l1 = l2 -> + true + | Nolabel, Nolabel when paramArgCount = argCount + -> + true + | _ -> false) + with + | None -> + Lsp.Types.MarkupContent.create + ~kind:Lsp.Types.MarkupKind.Markdown ~value:"" + | Some (_, labelTypExpr) -> + Lsp.Types.MarkupContent.create + ~kind:Lsp.Types.MarkupKind.Markdown + ~value: + (docsForLabel ~supportsMarkdownLinks ~file ~package + labelTypExpr) + in + Lsp.Types.ParameterInformation.create + ~label:(`Offset (start, end_)) + ~documentation:(`MarkupContent documentation) ()) + in + let signatures = + Lsp.Types.SignatureInformation.create ~label:fnTypeStr + ~parameters:parametersInformation + ?documentation: + (match List.nth_opt docstring 0 with + | None -> None + | Some docs -> + Some + (`MarkupContent + (Lsp.Types.MarkupContent.create + ~kind:Lsp.Types.MarkupKind.Markdown ~value:docs))) + ~activeParameter: + (match activeParameter with + | None -> Some (-1) + | activeParameter -> activeParameter) + () + in + let signature = + Lsp.Types.SignatureHelp.create ~signatures:[signatures] + ~activeParameter: (match activeParameter with | None -> Some (-1) - | activeParameter -> activeParameter); - } + | activeParameter -> activeParameter) + ~activeSignature:0 () + in + Some signature | _ -> None) | Some (_, ((`ConstructorExpr (lid, _) | `ConstructorPat (lid, _)) as cs)) -> ( @@ -702,57 +710,68 @@ let signatureHelp ~debug ~source ~kindFile ~pos ~allowForConstructorPayloads | None -> [] | Some (`SingleArg (_, docstring)) -> [ - { - Protocol.label = - (constructorNameLength + 1, String.length label - 1); - documentation = - {Protocol.kind = "markdown"; value = docstring}; - }; + Lsp.Types.ParameterInformation.create + ~label: + (`Offset + (constructorNameLength + 1, String.length label - 1)) + ~documentation: + (`MarkupContent + (Lsp.Types.MarkupContent.create + ~kind:Lsp.Types.MarkupKind.Markdown ~value:docstring)) + (); ] | Some (`InlineRecord fields) -> - (* Account for leading '({' *) let baseOffset = constructorNameLength + 2 in - { - Protocol.label = (0, 0); - documentation = {Protocol.kind = "markdown"; value = ""}; - } + (* Account for leading '({' *) + Lsp.Types.ParameterInformation.create + ~label:(`Offset (0, 0)) + ~documentation: + (`MarkupContent + (Lsp.Types.MarkupContent.create + ~kind:Lsp.Types.MarkupKind.Markdown ~value:"")) + () :: (fields |> List.map (fun (_, (field : field), (start, end_)) -> - { - Protocol.label = - (baseOffset + start, baseOffset + end_); - documentation = - { - Protocol.kind = "markdown"; - value = field.docstring |> String.concat "\n"; - }; - })) + Lsp.Types.ParameterInformation.create + ~label: + (`Offset (baseOffset + start, baseOffset + end_)) + ~documentation: + (`MarkupContent + (Lsp.Types.MarkupContent.create + ~kind:Lsp.Types.MarkupKind.Markdown + ~value: + (field.docstring |> String.concat "\n"))) + ())) | Some (`TupleArg items) -> (* Account for leading '(' *) let baseOffset = constructorNameLength + 1 in items |> List.map (fun (_, docstring, (start, end_)) -> - { - Protocol.label = (baseOffset + start, baseOffset + end_); - documentation = - {Protocol.kind = "markdown"; value = docstring}; - }) + Lsp.Types.ParameterInformation.create + ~label: + (`Offset (baseOffset + start, baseOffset + end_)) + ~documentation: + (`MarkupContent + (Lsp.Types.MarkupContent.create + ~kind:Lsp.Types.MarkupKind.Markdown + ~value:docstring)) + ()) in - Some - { - Protocol.signatures = - [ - { - label; - parameters = params; - documentation = - (match List.nth_opt constructor.docstring 0 with - | None -> None - | Some docs -> - Some {Protocol.kind = "markdown"; value = docs}); - }; - ]; - activeSignature = Some 0; - activeParameter = Some activeParameter; - })) + let signatures = + Lsp.Types.SignatureInformation.create ~label ~parameters:params + ?documentation: + (match List.nth_opt constructor.docstring 0 with + | None -> None + | Some docs -> + Some + (`MarkupContent + (Lsp.Types.MarkupContent.create + ~kind:Lsp.Types.MarkupKind.Markdown ~value:docs))) + ~activeParameter:(Some activeParameter) () + in + let signature = + Lsp.Types.SignatureHelp.create ~signatures:[signatures] + ~activeParameter:(Some activeParameter) ~activeSignature:0 () + in + Some signature)) | _ -> None)) diff --git a/analysis/src/TypeUtils.ml b/analysis/src/TypeUtils.ml index 466d2f8bcfd..fa85e92e417 100644 --- a/analysis/src/TypeUtils.ml +++ b/analysis/src/TypeUtils.ml @@ -3,7 +3,7 @@ open SharedTypes let modulePathFromEnv env = let moduleName = env.QueryEnv.file.moduleName in let transformedModuleName = - (* Transform namespaced module names from internal format (Context-Kaplay) + (* Transform namespaced module names from internal format (Context-Kaplay) to user-facing format (Kaplay.Context) *) match String.rindex_opt moduleName '-' with | None -> moduleName @@ -1151,15 +1151,15 @@ let getFirstFnUnlabelledArgType ~env ~full t = | _ -> None let makeAdditionalTextEditsForRemovingDot posOfDot = + let start = + Lsp.Types.Position.create ~line:(fst posOfDot) ~character:(snd posOfDot - 1) + in + let end_ = + Lsp.Types.Position.create ~line:(fst posOfDot) ~character:(snd posOfDot) + in [ - { - Protocol.range = - { - start = {line = fst posOfDot; character = snd posOfDot - 1}; - end_ = {line = fst posOfDot; character = snd posOfDot}; - }; - newText = ""; - }; + Lsp.Types.TextEdit.create ~newText:"" + ~range:(Lsp.Types.Range.create ~start ~end_); ] (** Turns a completion into a pipe completion. *) @@ -1184,9 +1184,9 @@ let transformCompletionToPipeCompletion ?(synthetic = false) ~env ?posOfDot | Some posOfDot -> Some (makeAdditionalTextEditsForRemovingDot posOfDot)); } -(** This takes a type expr and the env that type expr was found in, and produces a globally unique +(** This takes a type expr and the env that type expr was found in, and produces a globally unique id for that specific type. The globally unique id is the full path to the type as seen from the root - of the project. Example: type x in module SomeModule in file SomeFile would get the globally + of the project. Example: type x in module SomeModule in file SomeFile would get the globally unique id `SomeFile.SomeModule.x`.*) let rec findRootTypeId ~full ~env (t : Types.type_expr) = let debug = false in diff --git a/analysis/src/Uri.ml b/analysis/src/Uri.ml index 4b1d67f5434..912acbecbf2 100644 --- a/analysis/src/Uri.ml +++ b/analysis/src/Uri.ml @@ -1,27 +1,29 @@ -type t = {path: string; uri: string} +type t = Lsp.Uri.t let stripPath = ref false (* for use in tests *) -let pathToUri path = - if Sys.os_type = "Unix" then "file://" ^ path - else - "file://" - ^ (Str.global_replace (Str.regexp_string "\\") "/" path - |> Str.substitute_first (Str.regexp "^\\([a-zA-Z]\\):") (fun text -> - let name = Str.matched_group 1 text in - "/" ^ String.lowercase_ascii name ^ "%3A")) +let fromPath path = Lsp.Uri.of_path path +let fromString str = Lsp.Uri.of_string str +let isInterface uri = uri |> Lsp.Uri.to_string |> Filename.check_suffix "i" +let toPath uri = + (* Lsp.Uri.to_path remove the schema file:// but keep the `/` on start of path. *) + let p = Lsp.Uri.to_path uri in + if !stripPath then String.sub p 1 (String.length p - 1) else p -let fromPath path = {path; uri = pathToUri path} -let isInterface {path} = Filename.check_suffix path "i" -let toPath {path} = path - -let toTopLevelLoc {path} = +let toTopLevelLoc (uri : Lsp.Uri.t) = let topPos = - {Lexing.pos_fname = path; pos_lnum = 1; pos_bol = 0; pos_cnum = 0} + { + Lexing.pos_fname = uri |> Lsp.Uri.to_path; + pos_lnum = 1; + pos_bol = 0; + pos_cnum = 0; + } in {Location.loc_start = topPos; Location.loc_end = topPos; loc_ghost = false} -let toString {uri} = if !stripPath then Filename.basename uri else uri +let toString t = + if !stripPath then Filename.basename (Lsp.Uri.to_path t) + else Lsp.Uri.to_string t (* Light weight, hopefully-enough-for-the-purpose fn to encode URI components. Built to handle the reserved characters listed in diff --git a/analysis/src/Uri.mli b/analysis/src/Uri.mli index b6e94692bda..9079b6323c8 100644 --- a/analysis/src/Uri.mli +++ b/analysis/src/Uri.mli @@ -1,6 +1,7 @@ -type t +type t = Lsp.Uri.t val fromPath : string -> t +val fromString : string -> t val isInterface : t -> bool val stripPath : bool ref val toPath : t -> string diff --git a/analysis/src/Utils.ml b/analysis/src/Utils.ml index abc286af599..a4bfc33bec2 100644 --- a/analysis/src/Utils.ml +++ b/analysis/src/Utils.ml @@ -19,10 +19,12 @@ let isFirstCharUppercase s = String.length s > 0 && Char.equal s.[0] (Char.uppercase_ascii s.[0]) let cmtPosToPosition {Lexing.pos_lnum; pos_cnum; pos_bol} = - Protocol.{line = pos_lnum - 1; character = pos_cnum - pos_bol} + Lsp.Types.Position.create ~line:(pos_lnum - 1) ~character:(pos_cnum - pos_bol) let cmtLocToRange {Location.loc_start; loc_end} = - Protocol.{start = cmtPosToPosition loc_start; end_ = cmtPosToPosition loc_end} + let start = cmtPosToPosition loc_start in + let end_ = cmtPosToPosition loc_end in + Lsp.Types.Range.create ~start ~end_ let endOfLocation loc length = let open Location in @@ -185,12 +187,12 @@ let indent n text = let mkPosition (pos : Pos.t) = let line, character = pos in - {Protocol.line; character} + Lsp.Types.Position.create ~line ~character let rangeOfLoc (loc : Location.t) = let start = loc |> Loc.start |> mkPosition in let end_ = loc |> Loc.end_ |> mkPosition in - {Protocol.start; end_} + Lsp.Types.Range.create ~start ~end_ let rec expandPath (path : Path.t) = match path with diff --git a/analysis/src/Xform.ml b/analysis/src/Xform.ml index 8d66d8c757d..a9ca37d8bc4 100644 --- a/analysis/src/Xform.ml +++ b/analysis/src/Xform.ml @@ -163,8 +163,40 @@ module ModuleToFile = struct in let moduleName = pmb_name.txt in let newFilePath = - Uri.fromPath - (Filename.concat (Filename.dirname path) moduleName ^ ".res") + Filename.concat (Filename.dirname path) moduleName ^ ".res" + in + let uri = Uri.fromString newFilePath in + let documentChanges = + [ + `CreateFile + (Lsp.Types.CreateFile.create ~uri + ~options: + (Lsp.Types.CreateFileOptions.create ~overwrite:false + ~ignoreIfExists:true ()) + ()); + `TextDocumentEdit + (Lsp.Types.TextDocumentEdit.create + ~edits: + [ + `TextEdit + (Lsp.Types.TextEdit.create ~range + ~newText:textForExtractedFile); + ] + ~textDocument: + (Lsp.Types.OptionalVersionedTextDocumentIdentifier.create + ~uri ())); + `TextDocumentEdit + (Lsp.Types.TextDocumentEdit.create + ~edits: + [ + `TextEdit + (Lsp.Types.TextEdit.create ~range + ~newText:newTextInCurrentFile); + ] + ~textDocument: + (Lsp.Types.OptionalVersionedTextDocumentIdentifier.create + ~uri:(Uri.fromString path) ())); + ] in changed := Some @@ -172,38 +204,7 @@ module ModuleToFile = struct ~title: (Printf.sprintf "Extract local module \"%s\" to file \"%s\"" moduleName (moduleName ^ ".res")) - ~kind:RefactorRewrite - ~documentChanges: - [ - Protocol.CreateFile - { - uri = newFilePath |> Uri.toString; - options = - Some - {overwrite = Some false; ignoreIfExists = Some true}; - }; - TextDocumentEdit - { - textDocument = - {uri = newFilePath |> Uri.toString; version = None}; - edits = - [ - { - newText = textForExtractedFile; - range = - { - start = {line = 0; character = 0}; - end_ = {line = 0; character = 0}; - }; - }; - ]; - }; - TextDocumentEdit - { - textDocument = {uri = path; version = None}; - edits = [{newText = newTextInCurrentFile; range}]; - }; - ]); + ~kind:RefactorRewrite ~documentChanges); () | _ -> ()); Ast_iterator.default_iterator.structure_item iterator structure_item @@ -852,14 +853,14 @@ let parseImplementation ~source = in comments |> List.filter filter in - let printExpr ~(range : Protocol.range) (expr : Parsetree.expression) = + let printExpr ~(range : Lsp.Types.Range.t) (expr : Parsetree.expression) = let structure = [Ast_helper.Str.eval ~loc:expr.pexp_loc expr] in structure |> Res_printer.print_implementation ~comments:(comments |> filterComments ~loc:expr.pexp_loc) |> Utils.indent range.start.character in - let printStructureItem ~(range : Protocol.range) + let printStructureItem ~(range : Lsp.Types.Range.t) (item : Parsetree.structure_item) = let structure = [item] in structure @@ -886,7 +887,7 @@ let parseInterface ~source = in comments |> List.filter filter in - let printSignatureItem ~(range : Protocol.range) + let printSignatureItem ~(range : Lsp.Types.Range.t) (item : Parsetree.signature_item) = let signature_item = [item] in signature_item diff --git a/analysis/src/YojsonHelpers.ml b/analysis/src/YojsonHelpers.ml new file mode 100644 index 00000000000..0cae226f44b --- /dev/null +++ b/analysis/src/YojsonHelpers.ml @@ -0,0 +1,9 @@ +let get key (t : Yojson.Safe.t) : Yojson.Safe.t option = + match t with + | `Assoc items -> List.assoc_opt key items + | _ -> None + +let to_list_opt json = try Some (Yojson.Safe.Util.to_list json) with _ -> None + +let from_string_opt text = + try Some (Yojson.Safe.from_string text) with _ -> None diff --git a/analysis/src/dune b/analysis/src/dune index 0b27f5aac8d..132e9e438da 100644 --- a/analysis/src/dune +++ b/analysis/src/dune @@ -4,4 +4,4 @@ (backend bisect_ppx)) (flags (-w "+6+26+27+32+33+39")) - (libraries unix str ext ml jsonlib syntax reanalyze)) + (libraries unix str ext ml yojson lsp syntax reanalyze)) diff --git a/analysis/vendor/.ocamlformat b/analysis/vendor/.ocamlformat deleted file mode 100644 index 593b6a1ffcd..00000000000 --- a/analysis/vendor/.ocamlformat +++ /dev/null @@ -1 +0,0 @@ -disable diff --git a/analysis/vendor/dune b/analysis/vendor/dune deleted file mode 100644 index 07b82861535..00000000000 --- a/analysis/vendor/dune +++ /dev/null @@ -1 +0,0 @@ -(dirs ext ml res_syntax json flow_parser) diff --git a/analysis/vendor/json/Json.ml b/analysis/vendor/json/Json.ml deleted file mode 100644 index bfa60adc618..00000000000 --- a/analysis/vendor/json/Json.ml +++ /dev/null @@ -1,536 +0,0 @@ -(** # Json parser - * - * ## Basics - * - * ``` - * open Json.Infix; /* for the nice infix operators */ - * let raw = {|{"hello": "folks"}|}; - * let who = Json.parse(raw) |> Json.get("hello") |?> Json.string; - * Js.log(who); - * ``` - * - * ## Parse & stringify - * - * @doc parse, stringify - * - * ## Accessing descendents - * - * @doc get, nth, getPath - * - * ## Coercing to types - * - * @doc string, number, array, obj, bool, null - * - * ## The JSON type - * - * @doc t - * - * ## Infix operators for easier working - * - * @doc Infix - *) - -type t = - | String of string - | Number of float - | Array of t list - | Object of (string * t) list - | True - | False - | Null - -let string_of_number f = - let s = string_of_float f in - if s.[String.length s - 1] = '.' then String.sub s 0 (String.length s - 1) - else s - -(** - * This module is provided for easier working with optional values. - *) -module Infix = struct - (** The "force unwrap" operator - * - * If you're sure there's a value, you can force it. - * ``` - * open Json.Infix; - * let x: int = Some(10) |! "Expected this to be present"; - * Js.log(x); - * ``` - * - * But you gotta be sure, otherwise it will throw. - * ```reason;raises - * open Json.Infix; - * let x: int = None |! "This will throw"; - * ``` - *) - let ( |! ) o d = - match o with - | None -> failwith d - | Some v -> v - - (** The "upwrap with default" operator - * ``` - * open Json.Infix; - * let x: int = Some(10) |? 4; - * let y: int = None |? 5; - * Js.log2(x, y); - * ``` - *) - let ( |? ) o d = - match o with - | None -> d - | Some v -> v - - (** The "transform contents into new optional" operator - * ``` - * open Json.Infix; - * let maybeInc = x => x > 5 ? Some(x + 1) : None; - * let x: option(int) = Some(14) |?> maybeInc; - * let y: option(int) = None |?> maybeInc; - * ``` - *) - let ( |?> ) o fn = - match o with - | None -> None - | Some v -> fn v - - (** The "transform contents into new value & then re-wrap" operator - * ``` - * open Json.Infix; - * let inc = x => x + 1; - * let x: option(int) = Some(7) |?>> inc; - * let y: option(int) = None |?>> inc; - * Js.log2(x, y); - * ``` - *) - let ( |?>> ) o fn = - match o with - | None -> None - | Some v -> Some (fn v) - - (** "handle the value if present, otherwise here's the default" - * - * It's called fold because that's what people call it :?. It's the same as "transform contents to new value" + "unwrap with default". - * - * ``` - * open Json.Infix; - * let inc = x => x + 1; - * let x: int = fold(Some(4), 10, inc); - * let y: int = fold(None, 2, inc); - * Js.log2(x, y); - * ``` - *) - let fold o d f = - match o with - | None -> d - | Some v -> f v -end - -let escape text = - let ln = String.length text in - let buf = Buffer.create ln in - let rec loop i = - if i < ln then ( - (match text.[i] with - | '\012' -> Buffer.add_string buf "\\f" - | '\\' -> Buffer.add_string buf "\\\\" - | '"' -> Buffer.add_string buf "\\\"" - | '\n' -> Buffer.add_string buf "\\n" - | '\b' -> Buffer.add_string buf "\\b" - | '\r' -> Buffer.add_string buf "\\r" - | '\t' -> Buffer.add_string buf "\\t" - | c -> - let code = Char.code c in - if code < 0x20 then Printf.bprintf buf "\\u%04x" code - else Buffer.add_char buf c); - loop (i + 1)) - in - loop 0; - Buffer.contents buf - -(** - * ``` - * let text = {|{"hello": "folks", "aa": [2, 3, "four"]}|}; - * let result = Json.stringify(Json.parse(text)); - * Js.log(result); - * assert(text == result); - * ``` - *) -let rec stringify t = - match t with - | String value -> "\"" ^ escape value ^ "\"" - | Number num -> string_of_number num - | Array items -> "[" ^ String.concat ", " (List.map stringify items) ^ "]" - | Object items -> - "{" - ^ String.concat ", " - (List.map - (fun (k, v) -> "\"" ^ String.escaped k ^ "\": " ^ stringify v) - items) - ^ "}" - | True -> "true" - | False -> "false" - | Null -> "null" - -let white n = - let buffer = Buffer.create n in - for i = 0 to n - 1 do - Buffer.add_char buffer ' ' - done; - Buffer.contents buffer - -let rec stringifyPretty ?(indent = 0) t = - match t with - | String value -> "\"" ^ escape value ^ "\"" - | Number num -> string_of_number num - | Array [] -> "[]" - | Array [(String _ as contents)] -> "[" ^ stringifyPretty contents ^ "]" - | Array items -> - "[\n" ^ white indent - ^ String.concat - (",\n" ^ white indent) - (List.map (stringifyPretty ~indent:(indent + 2)) items) - ^ "\n" - ^ white (indent - 2) - ^ "]" - | Object [] -> "{}" - | Object items -> - "{\n" ^ white indent - ^ String.concat - (",\n" ^ white indent) - (List.map - (fun (k, v) -> - "\"" ^ String.escaped k ^ "\": " - ^ stringifyPretty ~indent:(indent + 2) v) - items) - ^ "\n" - ^ white (indent - 2) - ^ "}" - | True -> "true" - | False -> "false" - | Null -> "null" - -let unwrap message t = - match t with - | Some v -> v - | None -> failwith message - -module Parser = struct - let split_by ?(keep_empty = false) is_delim str = - let len = String.length str in - let rec loop acc last_pos pos = - if pos = -1 then - if last_pos = 0 && not keep_empty then acc - else String.sub str 0 last_pos :: acc - else if is_delim str.[pos] then - let new_len = last_pos - pos - 1 in - if new_len <> 0 || keep_empty then - let v = String.sub str (pos + 1) new_len in - loop (v :: acc) pos (pos - 1) - else loop acc pos (pos - 1) - else loop acc last_pos (pos - 1) - in - loop [] len (len - 1) - - let fail text pos message = - let pre = String.sub text 0 pos in - let lines = split_by (fun c -> c = '\n') pre in - let count = List.length lines in - let last = - match count > 0 with - | true -> List.nth lines (count - 1) - | false -> "" - in - let col = String.length last + 1 in - let line = List.length lines in - let string = - Printf.sprintf "Error \"%s\" at %d:%d -> %s\n" message line col last - in - failwith string - - let rec skipToNewline text pos = - if pos >= String.length text then pos - else if text.[pos] = '\n' then pos + 1 - else skipToNewline text (pos + 1) - - let stringTail text = - let len = String.length text in - if len > 1 then String.sub text 1 (len - 1) else "" - - let rec skipToCloseMultilineComment text pos = - if pos + 1 >= String.length text then failwith "Unterminated comment" - else if text.[pos] = '*' && text.[pos + 1] = '/' then pos + 2 - else skipToCloseMultilineComment text (pos + 1) - - let rec skipWhite text pos = - if - pos < String.length text - && (text.[pos] = ' ' - || text.[pos] = '\t' - || text.[pos] = '\n' - || text.[pos] = '\r') - then skipWhite text (pos + 1) - else pos - - (* from https://stackoverflow.com/a/42431362 *) - let utf8encode s = - let prefs = [|0; 192; 224|] in - let s1 n = String.make 1 (Char.chr n) in - let rec ienc k sofar resid = - let bct = if k = 0 then 7 else 6 - k in - if resid < 1 lsl bct then s1 (prefs.(k) + resid) ^ sofar - else ienc (k + 1) (s1 (128 + (resid mod 64)) ^ sofar) (resid / 64) - in - ienc 0 "" (int_of_string ("0x" ^ s)) - - let parseString text pos = - (* let i = ref(pos); *) - let buffer = Buffer.create (String.length text) in - let ln = String.length text in - let rec loop i = - match i >= ln with - | true -> fail text i "Unterminated string" - | false -> ( - match text.[i] with - | '"' -> i + 1 - | '\\' -> ( - match i + 1 >= ln with - | true -> fail text i "Unterminated string" - | false -> ( - match text.[i + 1] with - | '/' -> - Buffer.add_char buffer '/'; - loop (i + 2) - | 'f' -> - Buffer.add_char buffer '\012'; - loop (i + 2) - | 'u' when i + 6 < ln -> - Buffer.add_string buffer (utf8encode (String.sub text (i + 2) 4)); - loop (i + 7) - | _ -> - Buffer.add_string buffer (Scanf.unescaped (String.sub text i 2)); - loop (i + 2))) - | c -> - Buffer.add_char buffer c; - loop (i + 1)) - in - let final = loop pos in - (Buffer.contents buffer, final) - - let parseDigits text pos = - let len = String.length text in - let rec loop i = - if i >= len then i - else - match text.[i] with - | '0' .. '9' -> loop (i + 1) - | _ -> i - in - loop (pos + 1) - - let parseWithDecimal text pos = - let pos = parseDigits text pos in - if pos < String.length text && text.[pos] = '.' then - let pos = parseDigits text (pos + 1) in - pos - else pos - - let parseNumber text pos = - let pos = parseWithDecimal text pos in - let ln = String.length text in - if pos < ln - 1 && (text.[pos] = 'E' || text.[pos] = 'e') then - let pos = - match text.[pos + 1] with - | '-' | '+' -> pos + 2 - | _ -> pos + 1 - in - parseDigits text pos - else pos - - let parseNegativeNumber text pos = - let final = - if text.[pos] = '-' then parseNumber text (pos + 1) - else parseNumber text pos - in - (Number (float_of_string (String.sub text pos (final - pos))), final) - - let expect char text pos message = - if text.[pos] <> char then fail text pos ("Expected: " ^ message) - else pos + 1 - - let parseComment : 'a. string -> int -> (string -> int -> 'a) -> 'a = - fun text pos next -> - if text.[pos] <> '/' then - if text.[pos] = '*' then - next text (skipToCloseMultilineComment text (pos + 1)) - else failwith "Invalid syntax" - else next text (skipToNewline text (pos + 1)) - - let maybeSkipComment text pos = - if pos < String.length text && text.[pos] = '/' then - if pos + 1 < String.length text && text.[pos + 1] = '/' then - skipToNewline text (pos + 1) - else if pos + 1 < String.length text && text.[pos + 1] = '*' then - skipToCloseMultilineComment text (pos + 1) - else fail text pos "Invalid synatx" - else pos - - let rec skip text pos = - if pos = String.length text then pos - else - let n = skipWhite text pos |> maybeSkipComment text in - if n > pos then skip text n else n - - let rec parse text pos = - if pos >= String.length text then - fail text pos "Reached end of file without being done parsing" - else - match text.[pos] with - | '/' -> parseComment text (pos + 1) parse - | '[' -> parseArray text (pos + 1) - | '{' -> parseObject text (pos + 1) - | 'n' -> - if String.sub text pos 4 = "null" then (Null, pos + 4) - else fail text pos "unexpected character" - | 't' -> - if String.sub text pos 4 = "true" then (True, pos + 4) - else fail text pos "unexpected character" - | 'f' -> - if String.sub text pos 5 = "false" then (False, pos + 5) - else fail text pos "unexpected character" - | '\n' | '\t' | ' ' | '\r' -> parse text (skipWhite text pos) - | '"' -> - let s, pos = parseString text (pos + 1) in - (String s, pos) - | '-' | '0' .. '9' -> parseNegativeNumber text pos - | _ -> fail text pos "unexpected character" - - and parseArrayValue text pos = - let pos = skip text pos in - let value, pos = parse text pos in - let pos = skip text pos in - match text.[pos] with - | ',' -> - let pos = skip text (pos + 1) in - if text.[pos] = ']' then ([value], pos + 1) - else - let rest, pos = parseArrayValue text pos in - (value :: rest, pos) - | ']' -> ([value], pos + 1) - | _ -> fail text pos "unexpected character" - - and parseArray text pos = - let pos = skip text pos in - match text.[pos] with - | ']' -> (Array [], pos + 1) - | _ -> - let items, pos = parseArrayValue text pos in - (Array items, pos) - - and parseObjectValue text pos = - let pos = skip text pos in - if text.[pos] <> '"' then fail text pos "Expected string" - else - let key, pos = parseString text (pos + 1) in - let pos = skip text pos in - let pos = expect ':' text pos "Colon" in - let value, pos = parse text pos in - let pos = skip text pos in - match text.[pos] with - | ',' -> - let pos = skip text (pos + 1) in - if text.[pos] = '}' then ([(key, value)], pos + 1) - else - let rest, pos = parseObjectValue text pos in - ((key, value) :: rest, pos) - | '}' -> ([(key, value)], pos + 1) - | _ -> - let rest, pos = parseObjectValue text pos in - ((key, value) :: rest, pos) - - and parseObject text pos = - let pos = skip text pos in - if text.[pos] = '}' then (Object [], pos + 1) - else - let pairs, pos = parseObjectValue text pos in - (Object pairs, pos) -end -[@@nodoc] - -(** Turns some text into a json object. throws on failure *) -let parse text = - try - let item, pos = Parser.parse text 0 in - let pos = Parser.skip text pos in - if pos < String.length text then - (* failwith - ("Extra data after parse finished: " - ^ String.sub text pos (String.length text - pos)) *) - None - else Some item - with Invalid_argument _ | Failure _ -> None - -(* Accessor helpers *) -let bind v fn = - match v with - | None -> None - | Some v -> fn v - -(** If `t` is an object, get the value associated with the given string key *) -let get key t = - match t with - | Object items -> ( try Some (List.assoc key items) with Not_found -> None) - | _ -> None - -(** If `t` is an array, get the value associated with the given index *) -let nth n t = - match t with - | Array items -> - if n < List.length items then Some (List.nth items n) else None - | _ -> None - -let string t = - match t with - | String s -> Some s - | _ -> None -let number t = - match t with - | Number s -> Some s - | _ -> None -let array t = - match t with - | Array s -> Some s - | _ -> None -let obj t = - match t with - | Object s -> Some s - | _ -> None -let bool t = - match t with - | True -> Some true - | False -> Some false - | _ -> None -let null t = - match t with - | Null -> Some () - | _ -> None - -let rec parsePath keyList t = - match keyList with - | [] -> Some t - | head :: rest -> ( - match get head t with - | None -> None - | Some value -> parsePath rest value) - -(** Get a deeply nested value from an object `t`. - * ``` - * open Json.Infix; - * let json = Json.parse({|{"a": {"b": {"c": 2}}}|}); - * let num = Json.getPath("a.b.c", json) |?> Json.number; - * assert(num == Some(2.)) - * ``` - *) -let getPath path t = - let keys = Parser.split_by (fun c -> c = '.') path in - parsePath keys t diff --git a/analysis/vendor/json/dune b/analysis/vendor/json/dune deleted file mode 100644 index 32dbef0de79..00000000000 --- a/analysis/vendor/json/dune +++ /dev/null @@ -1,5 +0,0 @@ -(library - (name jsonlib) - (wrapped false) - (flags -w "-9") - (libraries)) diff --git a/dune-project b/dune-project index 404204f7f95..7ea218fc1bd 100644 --- a/dune-project +++ b/dune-project @@ -55,7 +55,11 @@ (>= 5.0.0)) (cppo (= 1.8.0)) - (odoc :with-doc))) + (odoc :with-doc) + (lsp + (= 1.22.0)) + (yojson + (= 2.2.2)))) (package (name tools) @@ -68,4 +72,6 @@ (cppo (= 1.8.0)) analysis + (yojson + (= 2.2.2)) (odoc :with-doc))) diff --git a/packages/@rescript/runtime/RescriptTools_ExtractCodeBlocks.res b/packages/@rescript/runtime/RescriptTools_ExtractCodeBlocks.res index b77ae5e8f6c..8174dc2c14e 100644 --- a/packages/@rescript/runtime/RescriptTools_ExtractCodeBlocks.res +++ b/packages/@rescript/runtime/RescriptTools_ExtractCodeBlocks.res @@ -7,4 +7,4 @@ type codeBlock = { /** `decodeFromJson(json)` parse JSON generated from `rescript-tools extract-codeblocks` command */ -external decodeFromJson: Stdlib_JSON.t => result, string> = "%identity" +external decodeFromJson: Stdlib_JSON.t => array = "%identity" diff --git a/tests/analysis_tests/tests-generic-jsx-transform/src/expected/GenericJsxCompletion.res.txt b/tests/analysis_tests/tests-generic-jsx-transform/src/expected/GenericJsxCompletion.res.txt index eb40ec0ba92..28f713fb42b 100644 --- a/tests/analysis_tests/tests-generic-jsx-transform/src/expected/GenericJsxCompletion.res.txt +++ b/tests/analysis_tests/tests-generic-jsx-transform/src/expected/GenericJsxCompletion.res.txt @@ -5,25 +5,11 @@ Completable: Cjsx([div], "", []) Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib Path GenericJsx.Elements.props -[{ - "label": "testing", - "kind": 4, - "tags": [], - "detail": "bool", - "documentation": null - }, { - "label": "test2", - "kind": 4, - "tags": [], - "detail": "string", - "documentation": null - }, { - "label": "children", - "kind": 4, - "tags": [], - "detail": "element", - "documentation": null - }] +[ + { "detail": "bool", "kind": 4, "label": "testing", "tags": [] }, + { "detail": "string", "kind": 4, "label": "test2", "tags": [] }, + { "detail": "element", "kind": 4, "label": "children", "tags": [] } +] Complete src/GenericJsxCompletion.res 3:17 posCursor:[3:17] posNoWhite:[3:16] Found expr:[3:3->3:18] @@ -33,19 +19,10 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath CJsxPropValue [div] testing Path GenericJsx.Elements.props -[{ - "label": "true", - "kind": 4, - "tags": [], - "detail": "bool", - "documentation": null - }, { - "label": "false", - "kind": 4, - "tags": [], - "detail": "bool", - "documentation": null - }] +[ + { "detail": "bool", "kind": 4, "label": "true", "tags": [] }, + { "detail": "bool", "kind": 4, "label": "false", "tags": [] } +] Complete src/GenericJsxCompletion.res 14:21 posCursor:[14:21] posNoWhite:[14:20] Found expr:[8:13->23:3] @@ -64,27 +41,40 @@ ContextPath Value[someString] Path someString Path Stdlib.String.st Path st -[{ - "label": "GenericJsx.string", - "kind": 12, - "tags": [], +[ + { "detail": "string", - "documentation": {"kind": "markdown", "value": "Turns `string` into a JSX element so it can be used inside of JSX."}, - "sortText": "A", - "insertTextFormat": 2 - }, { - "label": "String.startsWith", + "documentation": { + "kind": "markdown", + "value": "Turns `string` into a JSX element so it can be used inside of JSX." + }, + "insertTextFormat": 2, "kind": 12, - "tags": [], + "label": "GenericJsx.string", + "sortText": "A", + "tags": [] + }, + { "detail": "(string, string) => bool", - "documentation": {"kind": "markdown", "value": "\n`startsWith(str, substr)` returns `true` if the `str` starts with `substr`,\n`false` otherwise.\nSee [`String.startsWith`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/startsWith) on MDN.\n\n## Examples\n\n```rescript\nString.startsWith(\"BuckleScript\", \"Buckle\") == true\nString.startsWith(\"BuckleScript\", \"\") == true\nString.startsWith(\"JavaScript\", \"Buckle\") == false\n```\n"} - }, { - "label": "String.startsWithFrom", + "documentation": { + "kind": "markdown", + "value": "\n`startsWith(str, substr)` returns `true` if the `str` starts with `substr`,\n`false` otherwise.\nSee [`String.startsWith`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/startsWith) on MDN.\n\n## Examples\n\n```rescript\nString.startsWith(\"BuckleScript\", \"Buckle\") == true\nString.startsWith(\"BuckleScript\", \"\") == true\nString.startsWith(\"JavaScript\", \"Buckle\") == false\n```\n" + }, "kind": 12, - "tags": [], + "label": "String.startsWith", + "tags": [] + }, + { "detail": "(string, string, int) => bool", - "documentation": {"kind": "markdown", "value": "\n`startsWithFrom(str, substr, n)` returns `true` if the `str` starts\nwith `substr` starting at position `n`, `false` otherwise. If `n` is negative,\nthe search starts at the beginning of `str`.\nSee [`String.startsWith`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/startsWith) on MDN.\n\n## Examples\n\n```rescript\nString.startsWithFrom(\"BuckleScript\", \"kle\", 3) == true\nString.startsWithFrom(\"BuckleScript\", \"\", 3) == true\nString.startsWithFrom(\"JavaScript\", \"Buckle\", 2) == false\n```\n"} - }] + "documentation": { + "kind": "markdown", + "value": "\n`startsWithFrom(str, substr, n)` returns `true` if the `str` starts\nwith `substr` starting at position `n`, `false` otherwise. If `n` is negative,\nthe search starts at the beginning of `str`.\nSee [`String.startsWith`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/startsWith) on MDN.\n\n## Examples\n\n```rescript\nString.startsWithFrom(\"BuckleScript\", \"kle\", 3) == true\nString.startsWithFrom(\"BuckleScript\", \"\", 3) == true\nString.startsWithFrom(\"JavaScript\", \"Buckle\", 2) == false\n```\n" + }, + "kind": 12, + "label": "String.startsWithFrom", + "tags": [] + } +] Complete src/GenericJsxCompletion.res 20:24 posCursor:[20:24] posNoWhite:[20:23] Found expr:[8:13->23:3] @@ -106,25 +96,38 @@ ContextPath Value[someString] Path someString Path Stdlib.String.st Path st -[{ - "label": "string", - "kind": 12, - "tags": [], +[ + { "detail": "string", - "documentation": {"kind": "markdown", "value": "Turns `string` into a JSX element so it can be used inside of JSX."}, - "sortText": "A", - "insertTextFormat": 2 - }, { - "label": "String.startsWith", + "documentation": { + "kind": "markdown", + "value": "Turns `string` into a JSX element so it can be used inside of JSX." + }, + "insertTextFormat": 2, "kind": 12, - "tags": [], + "label": "string", + "sortText": "A", + "tags": [] + }, + { "detail": "(string, string) => bool", - "documentation": {"kind": "markdown", "value": "\n`startsWith(str, substr)` returns `true` if the `str` starts with `substr`,\n`false` otherwise.\nSee [`String.startsWith`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/startsWith) on MDN.\n\n## Examples\n\n```rescript\nString.startsWith(\"BuckleScript\", \"Buckle\") == true\nString.startsWith(\"BuckleScript\", \"\") == true\nString.startsWith(\"JavaScript\", \"Buckle\") == false\n```\n"} - }, { - "label": "String.startsWithFrom", + "documentation": { + "kind": "markdown", + "value": "\n`startsWith(str, substr)` returns `true` if the `str` starts with `substr`,\n`false` otherwise.\nSee [`String.startsWith`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/startsWith) on MDN.\n\n## Examples\n\n```rescript\nString.startsWith(\"BuckleScript\", \"Buckle\") == true\nString.startsWith(\"BuckleScript\", \"\") == true\nString.startsWith(\"JavaScript\", \"Buckle\") == false\n```\n" + }, "kind": 12, - "tags": [], + "label": "String.startsWith", + "tags": [] + }, + { "detail": "(string, string, int) => bool", - "documentation": {"kind": "markdown", "value": "\n`startsWithFrom(str, substr, n)` returns `true` if the `str` starts\nwith `substr` starting at position `n`, `false` otherwise. If `n` is negative,\nthe search starts at the beginning of `str`.\nSee [`String.startsWith`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/startsWith) on MDN.\n\n## Examples\n\n```rescript\nString.startsWithFrom(\"BuckleScript\", \"kle\", 3) == true\nString.startsWithFrom(\"BuckleScript\", \"\", 3) == true\nString.startsWithFrom(\"JavaScript\", \"Buckle\", 2) == false\n```\n"} - }] + "documentation": { + "kind": "markdown", + "value": "\n`startsWithFrom(str, substr, n)` returns `true` if the `str` starts\nwith `substr` starting at position `n`, `false` otherwise. If `n` is negative,\nthe search starts at the beginning of `str`.\nSee [`String.startsWith`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/startsWith) on MDN.\n\n## Examples\n\n```rescript\nString.startsWithFrom(\"BuckleScript\", \"kle\", 3) == true\nString.startsWithFrom(\"BuckleScript\", \"\", 3) == true\nString.startsWithFrom(\"JavaScript\", \"Buckle\", 2) == false\n```\n" + }, + "kind": 12, + "label": "String.startsWithFrom", + "tags": [] + } +] diff --git a/tests/analysis_tests/tests-incremental-typechecking/src/expected/ConstructorCompletion__Json.res.txt b/tests/analysis_tests/tests-incremental-typechecking/src/expected/ConstructorCompletion__Json.res.txt index bab658f9b98..a5c176baecd 100644 --- a/tests/analysis_tests/tests-incremental-typechecking/src/expected/ConstructorCompletion__Json.res.txt +++ b/tests/analysis_tests/tests-incremental-typechecking/src/expected/ConstructorCompletion__Json.res.txt @@ -7,14 +7,19 @@ Completable: Cexpression CTypeAtPos()->variantPayload::Array($0) Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath CTypeAtPos() -[{ - "label": "[]", - "kind": 12, - "tags": [], +[ + { "detail": "t", - "documentation": {"kind": "markdown", "value": " \nA type representing a JSON object.\n\n\n```rescript\n@unboxed\ntype t =\n | Boolean(bool)\n | @as(null) Null\n | String(string)\n | Number(float)\n | Object(dict)\n | Array(array)\n```"}, - "sortText": "A", + "documentation": { + "kind": "markdown", + "value": " \nA type representing a JSON object.\n\n\n```rescript\n@unboxed\ntype t =\n | Boolean(bool)\n | @as(null) Null\n | String(string)\n | Number(float)\n | Object(dict)\n | Array(array)\n```" + }, "insertText": "[$0]", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 12, + "label": "[]", + "sortText": "A", + "tags": [] + } +] diff --git a/tests/analysis_tests/tests-incremental-typechecking/src/expected/ConstructorCompletion__Own.res.txt b/tests/analysis_tests/tests-incremental-typechecking/src/expected/ConstructorCompletion__Own.res.txt index 6ea8bab362e..318cc3d18bd 100644 --- a/tests/analysis_tests/tests-incremental-typechecking/src/expected/ConstructorCompletion__Own.res.txt +++ b/tests/analysis_tests/tests-incremental-typechecking/src/expected/ConstructorCompletion__Own.res.txt @@ -6,14 +6,19 @@ Completable: Cexpression CTypeAtPos()->variantPayload::One($0) Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath CTypeAtPos() -[{ - "label": "{}", - "kind": 12, - "tags": [], +[ + { "detail": "{miss: bool}", - "documentation": {"kind": "markdown", "value": "```rescript\n{miss: bool}\n```"}, - "sortText": "A", + "documentation": { + "kind": "markdown", + "value": "```rescript\n{miss: bool}\n```" + }, "insertText": "{$0}", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 12, + "label": "{}", + "sortText": "A", + "tags": [] + } +] diff --git a/tests/analysis_tests/tests-sourcedirs-dependency/src/expected/Main.res.txt b/tests/analysis_tests/tests-sourcedirs-dependency/src/expected/Main.res.txt index 4f24b0022f0..f63801d1bf7 100644 --- a/tests/analysis_tests/tests-sourcedirs-dependency/src/expected/Main.res.txt +++ b/tests/analysis_tests/tests-sourcedirs-dependency/src/expected/Main.res.txt @@ -6,11 +6,7 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Value[WorkspaceDep, value] Path WorkspaceDep.value -[{ - "label": "valueFromDependency", - "kind": 12, - "tags": [], - "detail": "int", - "documentation": null - }] +[ + { "detail": "int", "kind": 12, "label": "valueFromDependency", "tags": [] } +] diff --git a/tests/analysis_tests/tests/not_compiled/expected/Diagnostics.res.txt b/tests/analysis_tests/tests/not_compiled/expected/Diagnostics.res.txt index a5df33b7107..d4c5ca2ae15 100644 --- a/tests/analysis_tests/tests/not_compiled/expected/Diagnostics.res.txt +++ b/tests/analysis_tests/tests/not_compiled/expected/Diagnostics.res.txt @@ -1,17 +1,27 @@ -[{ - "range": {"start": {"line": 2, "character": 4}, "end": {"line": 2, "character": 6}}, - "message": "consecutive statements on a line must be separated by ';' or a newline", - "severity": 1, - "source": "ReScript" -}, { - "range": {"start": {"line": 1, "character": 9}, "end": {"line": 1, "character": 11}}, - "message": "This let-binding misses an expression", - "severity": 1, - "source": "ReScript" -}, { - "range": {"start": {"line": 0, "character": 4}, "end": {"line": 0, "character": 5}}, - "message": "I was expecting a name for this let-binding. Example: `let message = \"hello\"`", - "severity": 1, - "source": "ReScript" -}] +[ + { + "message": "consecutive statements on a line must be separated by ';' or a newline", + "range": { + "end": { "character": 6, "line": 2 }, + "start": { "character": 4, "line": 2 } + }, + "severity": 1 + }, + { + "message": "This let-binding misses an expression", + "range": { + "end": { "character": 11, "line": 1 }, + "start": { "character": 9, "line": 1 } + }, + "severity": 1 + }, + { + "message": "I was expecting a name for this let-binding. Example: `let message = \"hello\"`", + "range": { + "end": { "character": 5, "line": 0 }, + "start": { "character": 4, "line": 0 } + }, + "severity": 1 + } +] diff --git a/tests/analysis_tests/tests/not_compiled/expected/DocTemplate.res.txt b/tests/analysis_tests/tests/not_compiled/expected/DocTemplate.res.txt index f94561bdc53..2e222e81d67 100644 --- a/tests/analysis_tests/tests/not_compiled/expected/DocTemplate.res.txt +++ b/tests/analysis_tests/tests/not_compiled/expected/DocTemplate.res.txt @@ -3,7 +3,10 @@ can't find module DocTemplate Hit: Add Documentation template TextDocumentEdit: DocTemplate.res -{"start": {"line": 3, "character": 0}, "end": {"line": 5, "character": 9}} +{ + "end": { "character": 9, "line": 5 }, + "start": { "character": 0, "line": 3 } +} newText: <--here /** @@ -18,7 +21,10 @@ can't find module DocTemplate Hit: Add Documentation template TextDocumentEdit: DocTemplate.res -{"start": {"line": 6, "character": 0}, "end": {"line": 6, "character": 33}} +{ + "end": { "character": 33, "line": 6 }, + "start": { "character": 0, "line": 6 } +} newText: <--here /** @@ -31,7 +37,10 @@ can't find module DocTemplate Hit: Add Documentation template TextDocumentEdit: DocTemplate.res -{"start": {"line": 8, "character": 0}, "end": {"line": 8, "character": 9}} +{ + "end": { "character": 9, "line": 8 }, + "start": { "character": 0, "line": 8 } +} newText: <--here /** @@ -44,7 +53,10 @@ can't find module DocTemplate Hit: Add Documentation template TextDocumentEdit: DocTemplate.res -{"start": {"line": 10, "character": 0}, "end": {"line": 10, "character": 20}} +{ + "end": { "character": 20, "line": 10 }, + "start": { "character": 0, "line": 10 } +} newText: <--here /** @@ -57,7 +69,10 @@ can't find module DocTemplate Hit: Add Documentation template TextDocumentEdit: DocTemplate.res -{"start": {"line": 12, "character": 0}, "end": {"line": 16, "character": 1}} +{ + "end": { "character": 1, "line": 16 }, + "start": { "character": 0, "line": 12 } +} newText: <--here /** @@ -73,7 +88,10 @@ Hit: Extract local module "T" to file "T.res" CreateFile: T.res TextDocumentEdit: T.res -{"start": {"line": 0, "character": 0}, "end": {"line": 0, "character": 0}} +{ + "end": { "character": 1, "line": 16 }, + "start": { "character": 0, "line": 12 } +} newText: <--here // ^xfm @@ -81,8 +99,11 @@ let b = 1 // ^xfm -TextDocumentEdit: not_compiled/DocTemplate.res -{"start": {"line": 12, "character": 0}, "end": {"line": 16, "character": 1}} +TextDocumentEdit: DocTemplate.res +{ + "end": { "character": 1, "line": 16 }, + "start": { "character": 0, "line": 12 } +} newText: <--here @@ -92,7 +113,10 @@ can't find module DocTemplate Hit: Add Documentation template TextDocumentEdit: DocTemplate.res -{"start": {"line": 14, "character": 2}, "end": {"line": 14, "character": 11}} +{ + "end": { "character": 11, "line": 14 }, + "start": { "character": 2, "line": 14 } +} newText: <--here /** @@ -104,7 +128,10 @@ Hit: Extract local module "T" to file "T.res" CreateFile: T.res TextDocumentEdit: T.res -{"start": {"line": 0, "character": 0}, "end": {"line": 0, "character": 0}} +{ + "end": { "character": 1, "line": 16 }, + "start": { "character": 0, "line": 12 } +} newText: <--here // ^xfm @@ -112,8 +139,11 @@ let b = 1 // ^xfm -TextDocumentEdit: not_compiled/DocTemplate.res -{"start": {"line": 12, "character": 0}, "end": {"line": 16, "character": 1}} +TextDocumentEdit: DocTemplate.res +{ + "end": { "character": 1, "line": 16 }, + "start": { "character": 0, "line": 12 } +} newText: <--here @@ -123,7 +153,10 @@ can't find module DocTemplate Hit: Add Documentation template TextDocumentEdit: DocTemplate.res -{"start": {"line": 17, "character": 0}, "end": {"line": 18, "character": 46}} +{ + "end": { "character": 46, "line": 18 }, + "start": { "character": 0, "line": 17 } +} newText: <--here /** diff --git a/tests/analysis_tests/tests/not_compiled/expected/DocTemplate.resi.txt b/tests/analysis_tests/tests/not_compiled/expected/DocTemplate.resi.txt index aa8c9675901..3937e7937d5 100644 --- a/tests/analysis_tests/tests/not_compiled/expected/DocTemplate.resi.txt +++ b/tests/analysis_tests/tests/not_compiled/expected/DocTemplate.resi.txt @@ -2,7 +2,10 @@ Xform not_compiled/DocTemplate.resi 3:3 Hit: Add Documentation template TextDocumentEdit: DocTemplate.resi -{"start": {"line": 3, "character": 0}, "end": {"line": 5, "character": 9}} +{ + "end": { "character": 9, "line": 5 }, + "start": { "character": 0, "line": 3 } +} newText: <--here /** @@ -16,7 +19,10 @@ Xform not_compiled/DocTemplate.resi 6:15 Hit: Add Documentation template TextDocumentEdit: DocTemplate.resi -{"start": {"line": 6, "character": 0}, "end": {"line": 6, "character": 33}} +{ + "end": { "character": 33, "line": 6 }, + "start": { "character": 0, "line": 6 } +} newText: <--here /** @@ -28,7 +34,10 @@ Xform not_compiled/DocTemplate.resi 8:4 Hit: Add Documentation template TextDocumentEdit: DocTemplate.resi -{"start": {"line": 8, "character": 0}, "end": {"line": 8, "character": 10}} +{ + "end": { "character": 10, "line": 8 }, + "start": { "character": 0, "line": 8 } +} newText: <--here /** @@ -40,7 +49,10 @@ Xform not_compiled/DocTemplate.resi 10:4 Hit: Add Documentation template TextDocumentEdit: DocTemplate.resi -{"start": {"line": 10, "character": 0}, "end": {"line": 10, "character": 19}} +{ + "end": { "character": 19, "line": 10 }, + "start": { "character": 0, "line": 10 } +} newText: <--here /** @@ -52,7 +64,10 @@ Xform not_compiled/DocTemplate.resi 12:7 Hit: Add Documentation template TextDocumentEdit: DocTemplate.resi -{"start": {"line": 12, "character": 0}, "end": {"line": 16, "character": 1}} +{ + "end": { "character": 1, "line": 16 }, + "start": { "character": 0, "line": 12 } +} newText: <--here /** @@ -68,7 +83,10 @@ Xform not_compiled/DocTemplate.resi 14:6 Hit: Add Documentation template TextDocumentEdit: DocTemplate.resi -{"start": {"line": 14, "character": 2}, "end": {"line": 14, "character": 12}} +{ + "end": { "character": 12, "line": 14 }, + "start": { "character": 2, "line": 14 } +} newText: <--here /** @@ -80,7 +98,10 @@ Xform not_compiled/DocTemplate.resi 18:2 Hit: Add Documentation template TextDocumentEdit: DocTemplate.resi -{"start": {"line": 17, "character": 0}, "end": {"line": 18, "character": 46}} +{ + "end": { "character": 46, "line": 18 }, + "start": { "character": 0, "line": 17 } +} newText: <--here /** diff --git a/tests/analysis_tests/tests/not_compiled/expected/SemanticTokens.res.txt b/tests/analysis_tests/tests/not_compiled/expected/SemanticTokens.res.txt index b21f43d7adb..dfd046f5352 100644 --- a/tests/analysis_tests/tests/not_compiled/expected/SemanticTokens.res.txt +++ b/tests/analysis_tests/tests/not_compiled/expected/SemanticTokens.res.txt @@ -1 +1,2 @@ -{"data":[0,4,4,1,0,1,2,1,3,0,0,1,4,7,0]} +{ "data": [ 0, 4, 4, 1, 0, 1, 2, 1, 3, 0, 0, 1, 4, 7, 0 ] } + diff --git a/tests/analysis_tests/tests/not_compiled/expected/SemanticTokensArray.res.txt b/tests/analysis_tests/tests/not_compiled/expected/SemanticTokensArray.res.txt index 92a36a99618..a2772d05e58 100644 --- a/tests/analysis_tests/tests/not_compiled/expected/SemanticTokensArray.res.txt +++ b/tests/analysis_tests/tests/not_compiled/expected/SemanticTokensArray.res.txt @@ -1 +1,2 @@ -{"data":[0,4,2,1,0,1,4,2,1,0,0,9,2,1,0]} +{ "data": [ 0, 4, 2, 1, 0, 1, 4, 2, 1, 0, 0, 9, 2, 1, 0 ] } + diff --git a/tests/analysis_tests/tests/not_compiled/expected/SemanticTokensArrayAccess.res.txt b/tests/analysis_tests/tests/not_compiled/expected/SemanticTokensArrayAccess.res.txt index 858e9ef372e..efa97a6d8a4 100644 --- a/tests/analysis_tests/tests/not_compiled/expected/SemanticTokensArrayAccess.res.txt +++ b/tests/analysis_tests/tests/not_compiled/expected/SemanticTokensArrayAccess.res.txt @@ -1 +1,6 @@ -{"data":[0,4,1,1,0,0,4,2,1,0,1,4,1,1,0,0,4,2,1,0,0,3,5,1,0]} +{ + "data": [ + 0, 4, 1, 1, 0, 0, 4, 2, 1, 0, 1, 4, 1, 1, 0, 0, 4, 2, 1, 0, 0, 3, 5, 1, 0 + ] +} + diff --git a/tests/analysis_tests/tests/not_compiled/expected/SemanticTokensArrayMutation.res.txt b/tests/analysis_tests/tests/not_compiled/expected/SemanticTokensArrayMutation.res.txt index 4d3810f43b4..7808688aac3 100644 --- a/tests/analysis_tests/tests/not_compiled/expected/SemanticTokensArrayMutation.res.txt +++ b/tests/analysis_tests/tests/not_compiled/expected/SemanticTokensArrayMutation.res.txt @@ -1 +1,2 @@ -{"data":[0,0,2,1,0]} +{ "data": [ 0, 0, 2, 1, 0 ] } + diff --git a/tests/analysis_tests/tests/not_compiled/expected/SemanticTokensDict.res.txt b/tests/analysis_tests/tests/not_compiled/expected/SemanticTokensDict.res.txt index 747a90d8b35..8159fc2ad5c 100644 --- a/tests/analysis_tests/tests/not_compiled/expected/SemanticTokensDict.res.txt +++ b/tests/analysis_tests/tests/not_compiled/expected/SemanticTokensDict.res.txt @@ -1 +1,2 @@ -{"data":[0,4,1,1,0,0,16,3,1,0]} +{ "data": [ 0, 4, 1, 1, 0, 0, 16, 3, 1, 0 ] } + diff --git a/tests/analysis_tests/tests/src/expected/Auto.res.txt b/tests/analysis_tests/tests/src/expected/Auto.res.txt index ae30d752338..bbb79db1a57 100644 --- a/tests/analysis_tests/tests/src/expected/Auto.res.txt +++ b/tests/analysis_tests/tests/src/expected/Auto.res.txt @@ -1,3 +1,8 @@ Hover src/Auto.res 2:13 -{"contents": {"kind": "markdown", "value": "```rescript\n('a => 'b, list<'a>) => list<'b>\n```"}} +{ + "contents": { + "kind": "markdown", + "value": "```rescript\n('a => 'b, list<'a>) => list<'b>\n```" + } +} diff --git a/tests/analysis_tests/tests/src/expected/CodeLens.res.txt b/tests/analysis_tests/tests/src/expected/CodeLens.res.txt index e75a2865164..7b34a422b72 100644 --- a/tests/analysis_tests/tests/src/expected/CodeLens.res.txt +++ b/tests/analysis_tests/tests/src/expected/CodeLens.res.txt @@ -1,12 +1,31 @@ Code Lens src/CodeLens.res -[{ - "range": {"start": {"line": 4, "character": 4}, "end": {"line": 4, "character": 6}}, - "command": {"title": "(~opt1: int=?, ~a: int, ~b: int, unit, ~opt2: int=?, unit, ~c: int) => int", "command": ""} - }, { - "range": {"start": {"line": 2, "character": 4}, "end": {"line": 2, "character": 7}}, - "command": {"title": "(~age: int, ~name: string) => string", "command": ""} - }, { - "range": {"start": {"line": 0, "character": 4}, "end": {"line": 0, "character": 7}}, - "command": {"title": "(int, int) => int", "command": ""} - }] +[ + { + "command": { + "command": "", + "title": "(~opt1: int=?, ~a: int, ~b: int, unit, ~opt2: int=?, unit, ~c: int) => int" + }, + "range": { + "end": { "character": 6, "line": 4 }, + "start": { "character": 4, "line": 4 } + } + }, + { + "command": { + "command": "", + "title": "(~age: int, ~name: string) => string" + }, + "range": { + "end": { "character": 7, "line": 2 }, + "start": { "character": 4, "line": 2 } + } + }, + { + "command": { "command": "", "title": "(int, int) => int" }, + "range": { + "end": { "character": 7, "line": 0 }, + "start": { "character": 4, "line": 0 } + } + } +] diff --git a/tests/analysis_tests/tests/src/expected/CompletePrioritize1.res.txt b/tests/analysis_tests/tests/src/expected/CompletePrioritize1.res.txt index 76eb966f013..ab1184c1d8d 100644 --- a/tests/analysis_tests/tests/src/expected/CompletePrioritize1.res.txt +++ b/tests/analysis_tests/tests/src/expected/CompletePrioritize1.res.txt @@ -9,11 +9,5 @@ Path a CPPipe pathFromEnv:Test found:true Path Test. Path -[{ - "label": "Test.name", - "kind": 12, - "tags": [], - "detail": "t => int", - "documentation": null - }] +[ { "detail": "t => int", "kind": 12, "label": "Test.name", "tags": [] } ] diff --git a/tests/analysis_tests/tests/src/expected/CompletePrioritize2.res.txt b/tests/analysis_tests/tests/src/expected/CompletePrioritize2.res.txt index 8c196abdd5d..bd6893d5c10 100644 --- a/tests/analysis_tests/tests/src/expected/CompletePrioritize2.res.txt +++ b/tests/analysis_tests/tests/src/expected/CompletePrioritize2.res.txt @@ -9,13 +9,7 @@ Path ax CPPipe pathFromEnv:Test found:true Path Test. Path -[{ - "label": "Test.add", - "kind": 12, - "tags": [], - "detail": "t => int", - "documentation": null - }] +[ { "detail": "t => int", "kind": 12, "label": "Test.add", "tags": [] } ] Complete src/CompletePrioritize2.res 12:5 posCursor:[12:5] posNoWhite:[12:4] Found expr:[12:3->12:5] @@ -25,11 +19,16 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Value[ax] Path ax -[{ - "label": "ax", - "kind": 12, - "tags": [], +[ + { "detail": "Test.t", - "documentation": {"kind": "markdown", "value": "```rescript\ntype t = {name: int}\n```"} - }] + "documentation": { + "kind": "markdown", + "value": "```rescript\ntype t = {name: int}\n```" + }, + "kind": 12, + "label": "ax", + "tags": [] + } +] diff --git a/tests/analysis_tests/tests/src/expected/Completion.res.txt b/tests/analysis_tests/tests/src/expected/Completion.res.txt index 33a37cf95bf..761f583a6e1 100644 --- a/tests/analysis_tests/tests/src/expected/Completion.res.txt +++ b/tests/analysis_tests/tests/src/expected/Completion.res.txt @@ -6,37 +6,58 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Value[MyList, m] Path MyList.m -[{ - "label": "mapReverse", - "kind": 12, - "tags": [], +[ + { "detail": "(list<'a>, 'a => 'b) => list<'b>", - "documentation": {"kind": "markdown", "value": "\n`mapReverse(list, f)` is equivalent to `map` function.\n\n## Examples\n\n```rescript\nlet f = x => x * x\nlet l = list{3, 4, 5}\n\nlet withMap = List.map(l, f)->List.reverse\nlet withMapReverse = l->List.mapReverse(f)\n\nConsole.log(withMap == withMapReverse) // true\n```\n"} - }, { - "label": "mapReverse2", + "documentation": { + "kind": "markdown", + "value": "\n`mapReverse(list, f)` is equivalent to `map` function.\n\n## Examples\n\n```rescript\nlet f = x => x * x\nlet l = list{3, 4, 5}\n\nlet withMap = List.map(l, f)->List.reverse\nlet withMapReverse = l->List.mapReverse(f)\n\nConsole.log(withMap == withMapReverse) // true\n```\n" + }, "kind": 12, - "tags": [], + "label": "mapReverse", + "tags": [] + }, + { "detail": "(list<'a>, list<'b>, ('a, 'b) => 'c) => list<'c>", - "documentation": {"kind": "markdown", "value": "\n`mapReverse2(list1, list2, f)` is equivalent to `List.zipBy(list1, list2, f)->List.reverse`.\n\n## Examples\n\n```rescript\nList.mapReverse2(list{1, 2, 3}, list{1, 2}, (a, b) => a + b) == list{4, 2}\n```\n"} - }, { - "label": "make", + "documentation": { + "kind": "markdown", + "value": "\n`mapReverse2(list1, list2, f)` is equivalent to `List.zipBy(list1, list2, f)->List.reverse`.\n\n## Examples\n\n```rescript\nList.mapReverse2(list{1, 2, 3}, list{1, 2}, (a, b) => a + b) == list{4, 2}\n```\n" + }, "kind": 12, - "tags": [], + "label": "mapReverse2", + "tags": [] + }, + { "detail": "(~length: int, 'a) => list<'a>", - "documentation": {"kind": "markdown", "value": "\n`make(length, value)` returns a list of length `length` with each element filled\nwith `value`. Returns an empty list if `value` is negative.\n\n## Examples\n\n```rescript\nList.make(~length=3, 1) == list{1, 1, 1}\n```\n"} - }, { - "label": "mapWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`make(length, value)` returns a list of length `length` with each element filled\nwith `value`. Returns an empty list if `value` is negative.\n\n## Examples\n\n```rescript\nList.make(~length=3, 1) == list{1, 1, 1}\n```\n" + }, "kind": 12, - "tags": [], + "label": "make", + "tags": [] + }, + { "detail": "(list<'a>, ('a, int) => 'b) => list<'b>", - "documentation": {"kind": "markdown", "value": "\n`mapWithIndex(list, f)` applies `f` to each element of `list`. Function `f`\ntakes two arguments: the index starting from 0 and the element from `list`, in\nthat order.\n\n## Examples\n\n```rescript\nlist{1, 2, 3}->List.mapWithIndex((x, index) => index + x) == list{1, 3, 5}\n```\n"} - }, { - "label": "map", + "documentation": { + "kind": "markdown", + "value": "\n`mapWithIndex(list, f)` applies `f` to each element of `list`. Function `f`\ntakes two arguments: the index starting from 0 and the element from `list`, in\nthat order.\n\n## Examples\n\n```rescript\nlist{1, 2, 3}->List.mapWithIndex((x, index) => index + x) == list{1, 3, 5}\n```\n" + }, "kind": 12, - "tags": [], + "label": "mapWithIndex", + "tags": [] + }, + { "detail": "(list<'a>, 'a => 'b) => list<'b>", - "documentation": {"kind": "markdown", "value": "\n`map(list, f)` returns a new list with `f` applied to each element of `list`.\n\n## Examples\n\n```rescript\nlist{1, 2}->List.map(x => x + 1) == list{2, 3}\n```\n"} - }] + "documentation": { + "kind": "markdown", + "value": "\n`map(list, f)` returns a new list with `f` applied to each element of `list`.\n\n## Examples\n\n```rescript\nlist{1, 2}->List.map(x => x + 1) == list{2, 3}\n```\n" + }, + "kind": 12, + "label": "map", + "tags": [] + } +] Complete src/Completion.res 3:9 posCursor:[3:9] posNoWhite:[3:8] Found expr:[3:3->3:9] @@ -46,613 +67,1024 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Value[Array, ""] Path Array. -[{ - "label": "splice", - "kind": 12, - "tags": [], +[ + { "detail": "(\n array<'a>,\n ~start: int,\n ~remove: int,\n ~insert: array<'a>,\n) => unit", - "documentation": {"kind": "markdown", "value": "\n`splice(array, ~start, ~remove, ~insert)` removes `remove` items starting at `start` and inserts the values from `insert`.\n\nBeware this will *mutate* the array.\n\nSee [`Array.splice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/splice) on MDN.\n\n## Examples\n\n```rescript\nlet items = [\"a\", \"b\", \"c\"]\nitems->Array.splice(~start=1, ~remove=1, ~insert=[\"x\"])\nitems == [\"a\", \"x\", \"c\"]\n```\n"} - }, { - "label": "concat", + "documentation": { + "kind": "markdown", + "value": "\n`splice(array, ~start, ~remove, ~insert)` removes `remove` items starting at `start` and inserts the values from `insert`.\n\nBeware this will *mutate* the array.\n\nSee [`Array.splice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/splice) on MDN.\n\n## Examples\n\n```rescript\nlet items = [\"a\", \"b\", \"c\"]\nitems->Array.splice(~start=1, ~remove=1, ~insert=[\"x\"])\nitems == [\"a\", \"x\", \"c\"]\n```\n" + }, "kind": 12, - "tags": [], + "label": "splice", + "tags": [] + }, + { "detail": "(array<'a>, array<'a>) => array<'a>", - "documentation": {"kind": "markdown", "value": "\n`concat(array1, array2)` concatenates the two arrays, creating a new array.\n\nSee [`Array.concat`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/concat) on MDN.\n\n## Examples\n\n```rescript\nlet array1 = [\"hi\", \"hello\"]\nlet array2 = [\"yay\", \"wehoo\"]\n\nlet someArray = array1->Array.concat(array2)\n\nsomeArray == [\"hi\", \"hello\", \"yay\", \"wehoo\"]\n```\n"} - }, { - "label": "filterMap", + "documentation": { + "kind": "markdown", + "value": "\n`concat(array1, array2)` concatenates the two arrays, creating a new array.\n\nSee [`Array.concat`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/concat) on MDN.\n\n## Examples\n\n```rescript\nlet array1 = [\"hi\", \"hello\"]\nlet array2 = [\"yay\", \"wehoo\"]\n\nlet someArray = array1->Array.concat(array2)\n\nsomeArray == [\"hi\", \"hello\", \"yay\", \"wehoo\"]\n```\n" + }, "kind": 12, - "tags": [], + "label": "concat", + "tags": [] + }, + { "detail": "(array<'a>, 'a => option<'b>) => array<'b>", - "documentation": {"kind": "markdown", "value": "\n`filterMap(array, fn)`\n\nCalls `fn` for each element and returns a new array containing results of the `fn` calls which are not `None`.\n\n## Examples\n\n```rescript\n[\"Hello\", \"Hi\", \"Good bye\"]->Array.filterMap(item =>\n switch item {\n | \"Hello\" => Some(item->String.length)\n | _ => None\n }\n) == [5]\n\n[1, 2, 3, 4, 5, 6]->Array.filterMap(n => mod(n, 2) == 0 ? Some(n * n) : None) == [4, 16, 36]\n\nArray.filterMap([1, 2, 3, 4, 5, 6], _ => None) == []\n\nArray.filterMap([], n => mod(n, 2) == 0 ? Some(n * n) : None) == []\n```\n"} - }, { - "label": "findLastWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`filterMap(array, fn)`\n\nCalls `fn` for each element and returns a new array containing results of the `fn` calls which are not `None`.\n\n## Examples\n\n```rescript\n[\"Hello\", \"Hi\", \"Good bye\"]->Array.filterMap(item =>\n switch item {\n | \"Hello\" => Some(item->String.length)\n | _ => None\n }\n) == [5]\n\n[1, 2, 3, 4, 5, 6]->Array.filterMap(n => mod(n, 2) == 0 ? Some(n * n) : None) == [4, 16, 36]\n\nArray.filterMap([1, 2, 3, 4, 5, 6], _ => None) == []\n\nArray.filterMap([], n => mod(n, 2) == 0 ? Some(n * n) : None) == []\n```\n" + }, "kind": 12, - "tags": [], + "label": "filterMap", + "tags": [] + }, + { "detail": "(array<'a>, ('a, int) => bool) => option<'a>", - "documentation": {"kind": "markdown", "value": "\n`findLastWithIndex(array, checker)` returns the last element of `array` where the provided `checker` function returns true.\n\nSee [`Array.findLast`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/findLast) on MDN.\n\n## Examples\n\n```rescript\nlet array = [1, 2, 3]\n\narray->Array.findLastWithIndex((item, index) => index < 2 && item > 0) == Some(2)\n```\n"} - }, { - "label": "findLast", + "documentation": { + "kind": "markdown", + "value": "\n`findLastWithIndex(array, checker)` returns the last element of `array` where the provided `checker` function returns true.\n\nSee [`Array.findLast`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/findLast) on MDN.\n\n## Examples\n\n```rescript\nlet array = [1, 2, 3]\n\narray->Array.findLastWithIndex((item, index) => index < 2 && item > 0) == Some(2)\n```\n" + }, "kind": 12, - "tags": [], + "label": "findLastWithIndex", + "tags": [] + }, + { "detail": "(array<'a>, 'a => bool) => option<'a>", - "documentation": {"kind": "markdown", "value": "\n`findLast(array, checker)` returns the last element of `array` where the provided `checker` function returns true.\n\nSee [`Array.findLast`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/findLast) on MDN.\n\n## Examples\n\n```rescript\nlet array = [1, 2, 3]\n\narray->Array.findLast(item => item > 0) == Some(3)\n```\n"} - }, { - "label": "shift", + "documentation": { + "kind": "markdown", + "value": "\n`findLast(array, checker)` returns the last element of `array` where the provided `checker` function returns true.\n\nSee [`Array.findLast`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/findLast) on MDN.\n\n## Examples\n\n```rescript\nlet array = [1, 2, 3]\n\narray->Array.findLast(item => item > 0) == Some(3)\n```\n" + }, "kind": 12, - "tags": [], + "label": "findLast", + "tags": [] + }, + { "detail": "array<'a> => option<'a>", - "documentation": {"kind": "markdown", "value": "\n`shift(array)` removes the first item in the array, and returns it.\n\nBeware this will *mutate* the array.\n\nSee [`Array.shift`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/shift) on MDN.\n\n## Examples\n\n```rescript\nlet someArray = [\"hi\", \"hello\"]\n\nsomeArray->Array.shift == Some(\"hi\")\n\nsomeArray == [\"hello\"] // Notice first item is gone.\n```\n"} - }, { - "label": "findMap", + "documentation": { + "kind": "markdown", + "value": "\n`shift(array)` removes the first item in the array, and returns it.\n\nBeware this will *mutate* the array.\n\nSee [`Array.shift`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/shift) on MDN.\n\n## Examples\n\n```rescript\nlet someArray = [\"hi\", \"hello\"]\n\nsomeArray->Array.shift == Some(\"hi\")\n\nsomeArray == [\"hello\"] // Notice first item is gone.\n```\n" + }, "kind": 12, - "tags": [], + "label": "shift", + "tags": [] + }, + { "detail": "(array<'a>, 'a => option<'b>) => option<'b>", - "documentation": {"kind": "markdown", "value": "\n`findMap(arr, fn)`\n\nCalls `fn` for each element and returns the first value from `fn` that is `Some(_)`.\nOtherwise returns `None`\n\n## Examples\n\n```rescript\nArray.findMap([1, 2, 3], n => mod(n, 2) == 0 ? Some(n - 2) : None) == Some(0)\n\nArray.findMap([1, 2, 3, 4, 5, 6], n => mod(n, 2) == 0 ? Some(n - 8) : None) == Some(-6)\n\nArray.findMap([1, 2, 3, 4, 5, 6], _ => None) == None\n\nArray.findMap([], n => mod(n, 2) == 0 ? Some(n * n) : None) == None\n```\n"} - }, { - "label": "concatMany", + "documentation": { + "kind": "markdown", + "value": "\n`findMap(arr, fn)`\n\nCalls `fn` for each element and returns the first value from `fn` that is `Some(_)`.\nOtherwise returns `None`\n\n## Examples\n\n```rescript\nArray.findMap([1, 2, 3], n => mod(n, 2) == 0 ? Some(n - 2) : None) == Some(0)\n\nArray.findMap([1, 2, 3, 4, 5, 6], n => mod(n, 2) == 0 ? Some(n - 8) : None) == Some(-6)\n\nArray.findMap([1, 2, 3, 4, 5, 6], _ => None) == None\n\nArray.findMap([], n => mod(n, 2) == 0 ? Some(n * n) : None) == None\n```\n" + }, "kind": 12, - "tags": [], + "label": "findMap", + "tags": [] + }, + { "detail": "(array<'a>, array>) => array<'a>", - "documentation": {"kind": "markdown", "value": "\n`concatMany(array1, arrays)` concatenates array1 with several other arrays, creating a new array.\n\nSee [`Array.concat`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/concat) on MDN.\n\n## Examples\n```rescript\nlet array1 = [\"hi\", \"hello\"]\nlet array2 = [\"yay\"]\nlet array3 = [\"wehoo\"]\n\nlet someArray = array1->Array.concatMany([array2, array3])\n\nConsole.log(someArray) // [\"hi\", \"hello\", \"yay\", \"wehoo\"]\n```\n"} - }, { - "label": "joinWith", + "documentation": { + "kind": "markdown", + "value": "\n`concatMany(array1, arrays)` concatenates array1 with several other arrays, creating a new array.\n\nSee [`Array.concat`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/concat) on MDN.\n\n## Examples\n```rescript\nlet array1 = [\"hi\", \"hello\"]\nlet array2 = [\"yay\"]\nlet array3 = [\"wehoo\"]\n\nlet someArray = array1->Array.concatMany([array2, array3])\n\nConsole.log(someArray) // [\"hi\", \"hello\", \"yay\", \"wehoo\"]\n```\n" + }, "kind": 12, - "tags": [1], + "label": "concatMany", + "tags": [] + }, + { + "deprecated": true, "detail": "(array, string) => string", - "documentation": {"kind": "markdown", "value": "Deprecated: Use `join` instead\n\n\n`joinWith(array, separator)` produces a string where all items of `array` are printed, separated by `separator`. Array items must be strings, to join number or other arrays, use `joinWithUnsafe`. Under the hood this will run JavaScript's `toString` on all the array items.\n\n## Examples\n\n```rescript\n[\"One\", \"Two\", \"Three\"]->Array.joinWith(\" -- \") == \"One -- Two -- Three\"\n```\n"} - }, { - "label": "joinWithUnsafe", + "documentation": { + "kind": "markdown", + "value": "Deprecated: Use `join` instead\n\n\n`joinWith(array, separator)` produces a string where all items of `array` are printed, separated by `separator`. Array items must be strings, to join number or other arrays, use `joinWithUnsafe`. Under the hood this will run JavaScript's `toString` on all the array items.\n\n## Examples\n\n```rescript\n[\"One\", \"Two\", \"Three\"]->Array.joinWith(\" -- \") == \"One -- Two -- Three\"\n```\n" + }, "kind": 12, - "tags": [1], + "label": "joinWith", + "tags": [ 1 ] + }, + { + "deprecated": true, "detail": "(array<'a>, string) => string", - "documentation": {"kind": "markdown", "value": "Deprecated: Use `joinUnsafe` instead\n\n\n`joinWithUnsafe(array, separator)` produces a string where all items of `array` are printed, separated by `separator`. Under the hood this will run JavaScript's `toString` on all the array items.\n\n## Examples\n\n```rescript\n[1, 2, 3]->Array.joinWithUnsafe(\" -- \") == \"1 -- 2 -- 3\"\n```\n"} - }, { - "label": "reduceRight", + "documentation": { + "kind": "markdown", + "value": "Deprecated: Use `joinUnsafe` instead\n\n\n`joinWithUnsafe(array, separator)` produces a string where all items of `array` are printed, separated by `separator`. Under the hood this will run JavaScript's `toString` on all the array items.\n\n## Examples\n\n```rescript\n[1, 2, 3]->Array.joinWithUnsafe(\" -- \") == \"1 -- 2 -- 3\"\n```\n" + }, "kind": 12, - "tags": [], + "label": "joinWithUnsafe", + "tags": [ 1 ] + }, + { "detail": "(array<'a>, 'b, ('b, 'a) => 'b) => 'b", - "documentation": {"kind": "markdown", "value": "\n`reduceRight(xs, init, fn)`\n\nWorks like `Array.reduce`; except that function `fn` is applied to each item of `xs` from the last back to the first.\n\n## Examples\n\n```rescript\nArray.reduceRight([\"a\", \"b\", \"c\", \"d\"], \"\", (a, b) => a ++ b) == \"dcba\"\n\nArray.reduceRight([1, 2, 3], list{}, List.add) == list{1, 2, 3}\n\nArray.reduceRight([], list{}, List.add) == list{}\n```\n"} - }, { - "label": "reduceRightWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`reduceRight(xs, init, fn)`\n\nWorks like `Array.reduce`; except that function `fn` is applied to each item of `xs` from the last back to the first.\n\n## Examples\n\n```rescript\nArray.reduceRight([\"a\", \"b\", \"c\", \"d\"], \"\", (a, b) => a ++ b) == \"dcba\"\n\nArray.reduceRight([1, 2, 3], list{}, List.add) == list{1, 2, 3}\n\nArray.reduceRight([], list{}, List.add) == list{}\n```\n" + }, "kind": 12, - "tags": [], + "label": "reduceRight", + "tags": [] + }, + { "detail": "(array<'a>, 'b, ('b, 'a, int) => 'b) => 'b", - "documentation": {"kind": "markdown", "value": "\n`reduceRightWithIndex(xs, init, fn)`\n\nLike `reduceRight`, but with an additional index argument on the callback function.\n\n## Examples\n\n```rescript\nArray.reduceRightWithIndex([1, 2, 3, 4], 0, (acc, x, i) => acc + x + i) == 16\n\nArray.reduceRightWithIndex([], list{}, (acc, v, i) => list{v + i, ...acc}) == list{}\n```\n"} - }, { - "label": "toShuffled", + "documentation": { + "kind": "markdown", + "value": "\n`reduceRightWithIndex(xs, init, fn)`\n\nLike `reduceRight`, but with an additional index argument on the callback function.\n\n## Examples\n\n```rescript\nArray.reduceRightWithIndex([1, 2, 3, 4], 0, (acc, x, i) => acc + x + i) == 16\n\nArray.reduceRightWithIndex([], list{}, (acc, v, i) => list{v + i, ...acc}) == list{}\n```\n" + }, "kind": 12, - "tags": [], + "label": "reduceRightWithIndex", + "tags": [] + }, + { "detail": "array<'a> => array<'a>", - "documentation": {"kind": "markdown", "value": "\n`toShuffled(array)` returns a new array with all items in `array` in a random order.\n\n## Examples\n\n```rescript\nlet array = [\"Hello\", \"Hi\", \"Good bye\"]\nlet shuffledArray = array->Array.toShuffled\nConsole.log(shuffledArray)\n\nArray.toShuffled([1, 2, 3])->Array.length == 3\n```\n"} - }, { - "label": "getSymbol", + "documentation": { + "kind": "markdown", + "value": "\n`toShuffled(array)` returns a new array with all items in `array` in a random order.\n\n## Examples\n\n```rescript\nlet array = [\"Hello\", \"Hi\", \"Good bye\"]\nlet shuffledArray = array->Array.toShuffled\nConsole.log(shuffledArray)\n\nArray.toShuffled([1, 2, 3])->Array.length == 3\n```\n" + }, "kind": 12, - "tags": [], + "label": "toShuffled", + "tags": [] + }, + { "detail": "(array<'a>, Symbol.t) => option<'b>", - "documentation": {"kind": "markdown", "value": "\n`getSymbol(array, key)` retrieves the value stored under the symbol `key`, if present.\n\nSee [`Symbol`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol) on MDN for more details about symbol keys.\n\n## Examples\n\n```rescript\nlet key = Symbol.make(\"meta\")\nlet items = []\nitems->Array.setSymbol(key, \"hello\")\nArray.getSymbol(items, key) == Some(\"hello\")\n```\n"} - }, { - "label": "getSymbolUnsafe", + "documentation": { + "kind": "markdown", + "value": "\n`getSymbol(array, key)` retrieves the value stored under the symbol `key`, if present.\n\nSee [`Symbol`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol) on MDN for more details about symbol keys.\n\n## Examples\n\n```rescript\nlet key = Symbol.make(\"meta\")\nlet items = []\nitems->Array.setSymbol(key, \"hello\")\nArray.getSymbol(items, key) == Some(\"hello\")\n```\n" + }, "kind": 12, - "tags": [], + "label": "getSymbol", + "tags": [] + }, + { "detail": "(array<'a>, Symbol.t) => 'b", - "documentation": {"kind": "markdown", "value": "\n`getSymbolUnsafe(array, key)` retrieves the value stored under the symbol `key` without any safety checks.\n\nSee [`Symbol`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol) on MDN.\n\n## Examples\n\n```rescript\nlet key = Symbol.make(\"meta\")\nlet items = []\nitems->Array.setSymbol(key, \"hello\")\nArray.getSymbolUnsafe(items, key) == \"hello\"\n```\n"} - }, { - "label": "findIndexOpt", + "documentation": { + "kind": "markdown", + "value": "\n`getSymbolUnsafe(array, key)` retrieves the value stored under the symbol `key` without any safety checks.\n\nSee [`Symbol`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol) on MDN.\n\n## Examples\n\n```rescript\nlet key = Symbol.make(\"meta\")\nlet items = []\nitems->Array.setSymbol(key, \"hello\")\nArray.getSymbolUnsafe(items, key) == \"hello\"\n```\n" + }, "kind": 12, - "tags": [], + "label": "getSymbolUnsafe", + "tags": [] + }, + { "detail": "(array<'a>, 'a => bool) => option", - "documentation": {"kind": "markdown", "value": "\n`findIndexOpt(array, checker)` returns the index of the first element of `array` where the provided `checker` function returns true.\n\nReturns `None` if no item matches.\n\nSee [`Array.findIndex`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/findIndex) on MDN.\n\n## Examples\n\n```rescript\ntype languages = ReScript | TypeScript | JavaScript\n\nlet array = [ReScript, TypeScript, JavaScript]\n\narray->Array.findIndexOpt(item => item == ReScript) == Some(0)\n```\n"} - }, { - "label": "shuffle", + "documentation": { + "kind": "markdown", + "value": "\n`findIndexOpt(array, checker)` returns the index of the first element of `array` where the provided `checker` function returns true.\n\nReturns `None` if no item matches.\n\nSee [`Array.findIndex`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/findIndex) on MDN.\n\n## Examples\n\n```rescript\ntype languages = ReScript | TypeScript | JavaScript\n\nlet array = [ReScript, TypeScript, JavaScript]\n\narray->Array.findIndexOpt(item => item == ReScript) == Some(0)\n```\n" + }, "kind": 12, - "tags": [], + "label": "findIndexOpt", + "tags": [] + }, + { "detail": "array<'a> => unit", - "documentation": {"kind": "markdown", "value": "\n`shuffle(array)` randomizes the position of all items in `array`.\n\nBeware this will *mutate* the array.\n\n## Examples\n\n```rescript\nlet array = [\"Hello\", \"Hi\", \"Good bye\"]\narray->Array.shuffle\nConsole.log(array)\n\nlet array2 = [1, 2, 3]\narray2->Array.shuffle\n\narray2->Array.length == 3\n```\n"} - }, { - "label": "copy", + "documentation": { + "kind": "markdown", + "value": "\n`shuffle(array)` randomizes the position of all items in `array`.\n\nBeware this will *mutate* the array.\n\n## Examples\n\n```rescript\nlet array = [\"Hello\", \"Hi\", \"Good bye\"]\narray->Array.shuffle\nConsole.log(array)\n\nlet array2 = [1, 2, 3]\narray2->Array.shuffle\n\narray2->Array.length == 3\n```\n" + }, "kind": 12, - "tags": [], + "label": "shuffle", + "tags": [] + }, + { "detail": "array<'a> => array<'a>", - "documentation": {"kind": "markdown", "value": "\n`copy(array)` makes a copy of the array with the items in it, but does not make copies of the items themselves.\n\n## Examples\n\n```rescript\nlet myArray = [1, 2, 3]\nlet copyOfMyArray = myArray->Array.copy\n\ncopyOfMyArray == [1, 2, 3]\n(myArray === copyOfMyArray) == false\n```\n"} - }, { - "label": "setUnsafe", + "documentation": { + "kind": "markdown", + "value": "\n`copy(array)` makes a copy of the array with the items in it, but does not make copies of the items themselves.\n\n## Examples\n\n```rescript\nlet myArray = [1, 2, 3]\nlet copyOfMyArray = myArray->Array.copy\n\ncopyOfMyArray == [1, 2, 3]\n(myArray === copyOfMyArray) == false\n```\n" + }, "kind": 12, - "tags": [], + "label": "copy", + "tags": [] + }, + { "detail": "(array<'a>, int, 'a) => unit", - "documentation": {"kind": "markdown", "value": "\n`setUnsafe(array, index, item)` sets the provided `item` at `index` of `array`.\n\nBeware this will *mutate* the array, and is *unsafe*.\n\n## Examples\n\n```rescript\nlet array = [\"Hello\", \"Hi\", \"Good bye\"]\narray->Array.setUnsafe(1, \"Hello\")\n\narray[1] == Some(\"Hello\")\n```\n"} - }, { - "label": "findIndexWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`setUnsafe(array, index, item)` sets the provided `item` at `index` of `array`.\n\nBeware this will *mutate* the array, and is *unsafe*.\n\n## Examples\n\n```rescript\nlet array = [\"Hello\", \"Hi\", \"Good bye\"]\narray->Array.setUnsafe(1, \"Hello\")\n\narray[1] == Some(\"Hello\")\n```\n" + }, "kind": 12, - "tags": [], + "label": "setUnsafe", + "tags": [] + }, + { "detail": "(array<'a>, ('a, int) => bool) => int", - "documentation": {"kind": "markdown", "value": "\n`findIndexWithIndex(array, checker)` returns the index of the first element of `array` where the provided `checker` function returns true.\n\nReturns `-1` if the item does not exist. Consider using `Array.findIndexOpt` if you want an option instead (where `-1` would be `None`).\n\nSee [`Array.findIndex`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/findIndex) on MDN.\n\n## Examples\n\n```rescript\ntype languages = ReScript | TypeScript | JavaScript\n\nlet array = [ReScript, JavaScript]\n\nlet isReScriptFirst =\n array->Array.findIndexWithIndex((item, index) => index === 0 && item == ReScript)\nlet isTypeScriptFirst =\n array->Array.findIndexWithIndex((item, index) => index === 0 && item == TypeScript)\n\nisReScriptFirst == 0\nisTypeScriptFirst == -1\n```\n"} - }, { - "label": "someWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`findIndexWithIndex(array, checker)` returns the index of the first element of `array` where the provided `checker` function returns true.\n\nReturns `-1` if the item does not exist. Consider using `Array.findIndexOpt` if you want an option instead (where `-1` would be `None`).\n\nSee [`Array.findIndex`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/findIndex) on MDN.\n\n## Examples\n\n```rescript\ntype languages = ReScript | TypeScript | JavaScript\n\nlet array = [ReScript, JavaScript]\n\nlet isReScriptFirst =\n array->Array.findIndexWithIndex((item, index) => index === 0 && item == ReScript)\nlet isTypeScriptFirst =\n array->Array.findIndexWithIndex((item, index) => index === 0 && item == TypeScript)\n\nisReScriptFirst == 0\nisTypeScriptFirst == -1\n```\n" + }, "kind": 12, - "tags": [], + "label": "findIndexWithIndex", + "tags": [] + }, + { "detail": "(array<'a>, ('a, int) => bool) => bool", - "documentation": {"kind": "markdown", "value": "\n`someWithIndex(array, checker)` returns true if running the provided `checker` function on any element in `array` returns true.\n\nSee [`Array.some`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/some) on MDN.\n\n## Examples\n\n```rescript\nlet array = [\"Hello\", \"Hi\", \"Good bye\"]\n\narray->Array.someWithIndex((greeting, index) => greeting === \"Hello\" && index === 0) == true\n```\n"} - }, { - "label": "slice", + "documentation": { + "kind": "markdown", + "value": "\n`someWithIndex(array, checker)` returns true if running the provided `checker` function on any element in `array` returns true.\n\nSee [`Array.some`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/some) on MDN.\n\n## Examples\n\n```rescript\nlet array = [\"Hello\", \"Hi\", \"Good bye\"]\n\narray->Array.someWithIndex((greeting, index) => greeting === \"Hello\" && index === 0) == true\n```\n" + }, "kind": 12, - "tags": [], + "label": "someWithIndex", + "tags": [] + }, + { "detail": "(array<'a>, ~start: int=?, ~end: int=?) => array<'a>", - "documentation": {"kind": "markdown", "value": "\n`slice(array, ~start, ~end)` creates a new array of items copied from `array` from `start` until (but not including) `end`.\n\nSee [`Array.slice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/slice) on MDN.\n\n## Examples\n\n```rescript\n[1, 2, 3, 4]->Array.slice(~start=1, ~end=3) == [2, 3]\n[1, 2, 3, 4]->Array.slice(~start=1) == [2, 3, 4]\n[1, 2, 3, 4]->Array.slice == [1, 2, 3, 4]\n```\n"} - }, { - "label": "zip", + "documentation": { + "kind": "markdown", + "value": "\n`slice(array, ~start, ~end)` creates a new array of items copied from `array` from `start` until (but not including) `end`.\n\nSee [`Array.slice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/slice) on MDN.\n\n## Examples\n\n```rescript\n[1, 2, 3, 4]->Array.slice(~start=1, ~end=3) == [2, 3]\n[1, 2, 3, 4]->Array.slice(~start=1) == [2, 3, 4]\n[1, 2, 3, 4]->Array.slice == [1, 2, 3, 4]\n```\n" + }, "kind": 12, - "tags": [], + "label": "slice", + "tags": [] + }, + { "detail": "(t<'a>, array<'b>) => array<('a, 'b)>", - "documentation": {"kind": "markdown", "value": "\n`zip(a, b)` create an array of pairs from corresponding elements of a and b.\nStop with the shorter array.\n\n## Examples\n\n```rescript\nArray.zip([1, 2], [3, 4, 5]) == [(1, 3), (2, 4)]\n```\n"} - }, { - "label": "fillToEnd", + "documentation": { + "kind": "markdown", + "value": "\n`zip(a, b)` create an array of pairs from corresponding elements of a and b.\nStop with the shorter array.\n\n## Examples\n\n```rescript\nArray.zip([1, 2], [3, 4, 5]) == [(1, 3), (2, 4)]\n```\n" + }, "kind": 12, - "tags": [1], + "label": "zip", + "tags": [] + }, + { + "deprecated": true, "detail": "(array<'a>, 'a, ~start: int) => unit", - "documentation": {"kind": "markdown", "value": "Deprecated: Use `fill` instead\n\n\n`fillToEnd(array, value, ~start)` fills `array` with `value` from the `start` index.\n\nBeware this will *mutate* the array.\n\nSee [`Array.fill`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/fill) on MDN.\n\n## Examples\n\n```rescript\nlet myArray = [1, 2, 3, 4]\nmyArray->Array.fillToEnd(9, ~start=1)\nmyArray == [1, 9, 9, 9]\n```\n"} - }, { - "label": "includes", + "documentation": { + "kind": "markdown", + "value": "Deprecated: Use `fill` instead\n\n\n`fillToEnd(array, value, ~start)` fills `array` with `value` from the `start` index.\n\nBeware this will *mutate* the array.\n\nSee [`Array.fill`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/fill) on MDN.\n\n## Examples\n\n```rescript\nlet myArray = [1, 2, 3, 4]\nmyArray->Array.fillToEnd(9, ~start=1)\nmyArray == [1, 9, 9, 9]\n```\n" + }, "kind": 12, - "tags": [], + "label": "fillToEnd", + "tags": [ 1 ] + }, + { "detail": "(array<'a>, 'a) => bool", - "documentation": {"kind": "markdown", "value": "\n`includes(array, item)` checks whether `array` includes `item`, by doing a [strict check for equality](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Strict_equality).\n\nSee [`Array.includes`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/includes) on MDN.\n\n## Examples\n\n```rescript\n[1, 2]->Array.includes(1) == true\n[1, 2]->Array.includes(3) == false\n\n[{\"language\": \"ReScript\"}]->Array.includes({\"language\": \"ReScript\"}) == false // false, because of strict equality\n```\n"} - }, { - "label": "findLastIndex", + "documentation": { + "kind": "markdown", + "value": "\n`includes(array, item)` checks whether `array` includes `item`, by doing a [strict check for equality](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Strict_equality).\n\nSee [`Array.includes`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/includes) on MDN.\n\n## Examples\n\n```rescript\n[1, 2]->Array.includes(1) == true\n[1, 2]->Array.includes(3) == false\n\n[{\"language\": \"ReScript\"}]->Array.includes({\"language\": \"ReScript\"}) == false // false, because of strict equality\n```\n" + }, "kind": 12, - "tags": [], + "label": "includes", + "tags": [] + }, + { "detail": "(array<'a>, 'a => bool) => int", - "documentation": {"kind": "markdown", "value": "\n`findLastIndex(array, checker)` returns the index of the last element of `array` where the provided `checker` function returns true.\n\nReturns `-1` if the item does not exist. Consider using `Array.findLastIndexOpt` if you want an option instead (where `-1` would be `None`).\n\nSee [`Array.findLastIndex`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/findLastIndex) on MDN.\n\n## Examples\n\n```rescript\ntype languages = ReScript | TypeScript | JavaScript\n\nlet array = [ReScript, JavaScript, ReScript]\n\narray->Array.findLastIndex(item => item == ReScript) == 2\n\narray->Array.findLastIndex(item => item == TypeScript) == -1\n```\n"} - }, { - "label": "fromInitializer", + "documentation": { + "kind": "markdown", + "value": "\n`findLastIndex(array, checker)` returns the index of the last element of `array` where the provided `checker` function returns true.\n\nReturns `-1` if the item does not exist. Consider using `Array.findLastIndexOpt` if you want an option instead (where `-1` would be `None`).\n\nSee [`Array.findLastIndex`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/findLastIndex) on MDN.\n\n## Examples\n\n```rescript\ntype languages = ReScript | TypeScript | JavaScript\n\nlet array = [ReScript, JavaScript, ReScript]\n\narray->Array.findLastIndex(item => item == ReScript) == 2\n\narray->Array.findLastIndex(item => item == TypeScript) == -1\n```\n" + }, "kind": 12, - "tags": [], + "label": "findLastIndex", + "tags": [] + }, + { "detail": "(~length: int, int => 'a) => array<'a>", - "documentation": {"kind": "markdown", "value": "\n`fromInitializer(~length, f)`\n\nCreates an array of length `length` initialized with the value returned from `f ` for each index.\n\n## Examples\n\n```rescript\nArray.fromInitializer(~length=3, i => i + 3) == [3, 4, 5]\n\nArray.fromInitializer(~length=7, i => i + 3) == [3, 4, 5, 6, 7, 8, 9]\n```\n"} - }, { - "label": "find", + "documentation": { + "kind": "markdown", + "value": "\n`fromInitializer(~length, f)`\n\nCreates an array of length `length` initialized with the value returned from `f ` for each index.\n\n## Examples\n\n```rescript\nArray.fromInitializer(~length=3, i => i + 3) == [3, 4, 5]\n\nArray.fromInitializer(~length=7, i => i + 3) == [3, 4, 5, 6, 7, 8, 9]\n```\n" + }, "kind": 12, - "tags": [], + "label": "fromInitializer", + "tags": [] + }, + { "detail": "(array<'a>, 'a => bool) => option<'a>", - "documentation": {"kind": "markdown", "value": "\n`find(array, checker)` returns the first element of `array` where the provided `checker` function returns true.\n\nSee [`Array.find`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/find) on MDN.\n\n## Examples\n\n```rescript\ntype languages = ReScript | TypeScript | JavaScript\n\nlet array = [ReScript, TypeScript, JavaScript]\n\narray->Array.find(item => item == ReScript) == Some(ReScript)\n```\n"} - }, { - "label": "make", + "documentation": { + "kind": "markdown", + "value": "\n`find(array, checker)` returns the first element of `array` where the provided `checker` function returns true.\n\nSee [`Array.find`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/find) on MDN.\n\n## Examples\n\n```rescript\ntype languages = ReScript | TypeScript | JavaScript\n\nlet array = [ReScript, TypeScript, JavaScript]\n\narray->Array.find(item => item == ReScript) == Some(ReScript)\n```\n" + }, "kind": 12, - "tags": [], + "label": "find", + "tags": [] + }, + { "detail": "(~length: int, 'a) => array<'a>", - "documentation": {"kind": "markdown", "value": "\n`make(~length, init)` creates an array of length `length` initialized with the value of `init`.\n\n## Examples\n\n```rescript\nArray.make(~length=3, #apple) == [#apple, #apple, #apple]\nArray.make(~length=6, 7) == [7, 7, 7, 7, 7, 7]\n```\n"} - }, { - "label": "lastIndexOfFrom", + "documentation": { + "kind": "markdown", + "value": "\n`make(~length, init)` creates an array of length `length` initialized with the value of `init`.\n\n## Examples\n\n```rescript\nArray.make(~length=3, #apple) == [#apple, #apple, #apple]\nArray.make(~length=6, 7) == [7, 7, 7, 7, 7, 7]\n```\n" + }, "kind": 12, - "tags": [1], + "label": "make", + "tags": [] + }, + { + "deprecated": true, "detail": "(array<'a>, 'a, int) => int", - "documentation": {"kind": "markdown", "value": "Deprecated: Use `lastIndexOf` instead\n\n"} - }, { - "label": "toLocaleString", + "documentation": { + "kind": "markdown", + "value": "Deprecated: Use `lastIndexOf` instead\n\n" + }, "kind": 12, - "tags": [], + "label": "lastIndexOfFrom", + "tags": [ 1 ] + }, + { "detail": "array<'a> => string", - "documentation": {"kind": "markdown", "value": "\n`toLocaleString(array)` converts each element to a locale-aware string and joins them with commas.\n\nSee [`Array.toLocaleString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/toLocaleString) on MDN.\n\n## Examples\n\n```rescript\n[\"apple\", \"banana\"]->Array.toLocaleString == \"apple,banana\"\n```\n"} - }, { - "label": "toSpliced", + "documentation": { + "kind": "markdown", + "value": "\n`toLocaleString(array)` converts each element to a locale-aware string and joins them with commas.\n\nSee [`Array.toLocaleString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/toLocaleString) on MDN.\n\n## Examples\n\n```rescript\n[\"apple\", \"banana\"]->Array.toLocaleString == \"apple,banana\"\n```\n" + }, "kind": 12, - "tags": [], + "label": "toLocaleString", + "tags": [] + }, + { "detail": "(\n array<'a>,\n ~start: int,\n ~remove: int,\n ~insert: array<'a>,\n) => array<'a>", - "documentation": {"kind": "markdown", "value": "\n`toSpliced(array, ~start, ~remove, ~insert)` returns a new array with the same edits that `splice` would perform, leaving the original unchanged.\n\nSee [`Array.toSpliced`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/toSpliced) on MDN.\n\n## Examples\n\n```rescript\nlet original = [1, 2, 3]\nlet updated = original->Array.toSpliced(~start=1, ~remove=1, ~insert=[10])\nupdated == [1, 10, 3]\noriginal == [1, 2, 3]\n```\n"} - }, { - "label": "sort", + "documentation": { + "kind": "markdown", + "value": "\n`toSpliced(array, ~start, ~remove, ~insert)` returns a new array with the same edits that `splice` would perform, leaving the original unchanged.\n\nSee [`Array.toSpliced`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/toSpliced) on MDN.\n\n## Examples\n\n```rescript\nlet original = [1, 2, 3]\nlet updated = original->Array.toSpliced(~start=1, ~remove=1, ~insert=[10])\nupdated == [1, 10, 3]\noriginal == [1, 2, 3]\n```\n" + }, "kind": 12, - "tags": [], + "label": "toSpliced", + "tags": [] + }, + { "detail": "(array<'a>, ('a, 'a) => Ordering.t) => unit", - "documentation": {"kind": "markdown", "value": "\n`sort(array, comparator)` sorts `array` in-place using the `comparator` function.\n\nBeware this will *mutate* the array.\n\nSee [`Array.sort`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort) on MDN.\n\n## Examples\n\n```rescript\nlet array = [3, 2, 1]\narray->Array.sort((a, b) => float(a - b))\narray == [1, 2, 3]\n```\n"} - }, { - "label": "filterMapWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`sort(array, comparator)` sorts `array` in-place using the `comparator` function.\n\nBeware this will *mutate* the array.\n\nSee [`Array.sort`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort) on MDN.\n\n## Examples\n\n```rescript\nlet array = [3, 2, 1]\narray->Array.sort((a, b) => float(a - b))\narray == [1, 2, 3]\n```\n" + }, "kind": 12, - "tags": [], + "label": "sort", + "tags": [] + }, + { "detail": "(array<'a>, ('a, int) => option<'b>) => array<'b>", - "documentation": {"kind": "markdown", "value": "\n`filterMapWithIndex(array, fn)`\n\nCalls `fn` for each element and returns a new array containing results of the `fn` calls which are not `None`.\n\n## Examples\n\n```rescript\n[\"Hello\", \"Hi\", \"Good bye\"]->Array.filterMapWithIndex((item, index) =>\n switch item {\n | \"Hello\" => Some(index)\n | _ => None\n }\n) == [0]\n```\n"} - }, { - "label": "length", + "documentation": { + "kind": "markdown", + "value": "\n`filterMapWithIndex(array, fn)`\n\nCalls `fn` for each element and returns a new array containing results of the `fn` calls which are not `None`.\n\n## Examples\n\n```rescript\n[\"Hello\", \"Hi\", \"Good bye\"]->Array.filterMapWithIndex((item, index) =>\n switch item {\n | \"Hello\" => Some(index)\n | _ => None\n }\n) == [0]\n```\n" + }, "kind": 12, - "tags": [], + "label": "filterMapWithIndex", + "tags": [] + }, + { "detail": "array<'a> => int", - "documentation": {"kind": "markdown", "value": "\n`length(array)` returns the length of (i.e. number of items in) the array.\n\nSee [`Array.length`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/length) on MDN.\n\n## Examples\n\n```rescript\nlet someArray = [\"hi\", \"hello\"]\n\nsomeArray->Array.length == 2\n```\n"} - }, { - "label": "every", + "documentation": { + "kind": "markdown", + "value": "\n`length(array)` returns the length of (i.e. number of items in) the array.\n\nSee [`Array.length`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/length) on MDN.\n\n## Examples\n\n```rescript\nlet someArray = [\"hi\", \"hello\"]\n\nsomeArray->Array.length == 2\n```\n" + }, "kind": 12, - "tags": [], + "label": "length", + "tags": [] + }, + { "detail": "(array<'a>, 'a => bool) => bool", - "documentation": {"kind": "markdown", "value": "\n`every(array, predicate)` returns true if `predicate` returns true for all items in `array`.\n\nSee [`Array.every`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/every) on MDN.\n\n## Examples\n\n```rescript\nlet array = [1, 2, 3, 4]\n\narray->Array.every(num => num <= 4) == true\n\narray->Array.every(num => num === 1) == false\n```\n"} - }, { - "label": "flat", + "documentation": { + "kind": "markdown", + "value": "\n`every(array, predicate)` returns true if `predicate` returns true for all items in `array`.\n\nSee [`Array.every`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/every) on MDN.\n\n## Examples\n\n```rescript\nlet array = [1, 2, 3, 4]\n\narray->Array.every(num => num <= 4) == true\n\narray->Array.every(num => num === 1) == false\n```\n" + }, "kind": 12, - "tags": [], + "label": "every", + "tags": [] + }, + { "detail": "array> => array<'a>", - "documentation": {"kind": "markdown", "value": "\n`flat(arrays)` concatenates an array of arrays into a single array.\n\nSee [`Array.flat`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/flat) on MDN.\n\n## Examples\n\n```rescript\n[[1], [2], [3, 4]]->Array.flat == [1, 2, 3, 4]\n```\n"} - }, { - "label": "map", + "documentation": { + "kind": "markdown", + "value": "\n`flat(arrays)` concatenates an array of arrays into a single array.\n\nSee [`Array.flat`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/flat) on MDN.\n\n## Examples\n\n```rescript\n[[1], [2], [3, 4]]->Array.flat == [1, 2, 3, 4]\n```\n" + }, "kind": 12, - "tags": [], + "label": "flat", + "tags": [] + }, + { "detail": "(array<'a>, 'a => 'b) => array<'b>", - "documentation": {"kind": "markdown", "value": "\n`map(array, fn)` returns a new array with all elements from `array`, each element transformed using the provided `fn`.\n\nSee [`Array.map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map) on MDN.\n\n## Examples\n\n```rescript\nlet array = [\"Hello\", \"Hi\", \"Good bye\"]\nlet mappedArray = array->Array.map(greeting => greeting ++ \" to you\")\n\nmappedArray == [\"Hello to you\", \"Hi to you\", \"Good bye to you\"]\n```\n"} - }, { - "label": "zipBy", + "documentation": { + "kind": "markdown", + "value": "\n`map(array, fn)` returns a new array with all elements from `array`, each element transformed using the provided `fn`.\n\nSee [`Array.map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map) on MDN.\n\n## Examples\n\n```rescript\nlet array = [\"Hello\", \"Hi\", \"Good bye\"]\nlet mappedArray = array->Array.map(greeting => greeting ++ \" to you\")\n\nmappedArray == [\"Hello to you\", \"Hi to you\", \"Good bye to you\"]\n```\n" + }, "kind": 12, - "tags": [], + "label": "map", + "tags": [] + }, + { "detail": "(t<'a>, array<'b>, ('a, 'b) => 'c) => array<'c>", - "documentation": {"kind": "markdown", "value": "\n`zipBy(xs, ys, f)` create an array by applying `f` to corresponding elements of\n`xs` and `ys`. Stops with shorter array.\n\nEquivalent to `map(zip(xs, ys), ((a, b)) => f(a, b))`\n\n## Examples\n\n```rescript\nArray.zipBy([1, 2, 3], [4, 5], (a, b) => 2 * a + b) == [6, 9]\n```\n"} - }, { - "label": "with", + "documentation": { + "kind": "markdown", + "value": "\n`zipBy(xs, ys, f)` create an array by applying `f` to corresponding elements of\n`xs` and `ys`. Stops with shorter array.\n\nEquivalent to `map(zip(xs, ys), ((a, b)) => f(a, b))`\n\n## Examples\n\n```rescript\nArray.zipBy([1, 2, 3], [4, 5], (a, b) => 2 * a + b) == [6, 9]\n```\n" + }, "kind": 12, - "tags": [], + "label": "zipBy", + "tags": [] + }, + { "detail": "(array<'a>, int, 'a) => array<'a>", - "documentation": {"kind": "markdown", "value": "\n`with(array, index, value)` returns a copy of `array` where the element at `index` is replaced with `value`.\n\nSee [`Array.with`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/with) on MDN.\n\n## Examples\n\n```rescript\nlet original = [\"a\", \"b\", \"c\"]\nlet replaced = original->Array.with(1, \"x\")\nreplaced == [\"a\", \"x\", \"c\"]\noriginal == [\"a\", \"b\", \"c\"]\n```\n"} - }, { - "label": "lastIndexOfOpt", + "documentation": { + "kind": "markdown", + "value": "\n`with(array, index, value)` returns a copy of `array` where the element at `index` is replaced with `value`.\n\nSee [`Array.with`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/with) on MDN.\n\n## Examples\n\n```rescript\nlet original = [\"a\", \"b\", \"c\"]\nlet replaced = original->Array.with(1, \"x\")\nreplaced == [\"a\", \"x\", \"c\"]\noriginal == [\"a\", \"b\", \"c\"]\n```\n" + }, "kind": 12, - "tags": [], + "label": "with", + "tags": [] + }, + { "detail": "(array<'a>, 'a) => option", - "documentation": null - }, { - "label": "toReversed", "kind": 12, - "tags": [], + "label": "lastIndexOfOpt", + "tags": [] + }, + { "detail": "array<'a> => array<'a>", - "documentation": {"kind": "markdown", "value": "\n`toReversed(array)` creates a new array with all items from `array` in reversed order.\n\nSee [`Array.toReversed`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/toReversed) on MDN.\n\n## Examples\n\n```rescript\nlet someArray = [\"hi\", \"hello\"]\nlet reversed = someArray->Array.toReversed\n\nreversed == [\"hello\", \"hi\"]\nsomeArray == [\"hi\", \"hello\"] // Original unchanged\n```\n"} - }, { - "label": "copyWithin", + "documentation": { + "kind": "markdown", + "value": "\n`toReversed(array)` creates a new array with all items from `array` in reversed order.\n\nSee [`Array.toReversed`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/toReversed) on MDN.\n\n## Examples\n\n```rescript\nlet someArray = [\"hi\", \"hello\"]\nlet reversed = someArray->Array.toReversed\n\nreversed == [\"hello\", \"hi\"]\nsomeArray == [\"hi\", \"hello\"] // Original unchanged\n```\n" + }, "kind": 12, - "tags": [], + "label": "toReversed", + "tags": [] + }, + { "detail": "(\n array<'a>,\n ~target: int,\n ~start: int,\n ~end: int=?,\n) => array<'a>", - "documentation": {"kind": "markdown", "value": "\n`copyWithin(array, ~target, ~start, ~end)` copies starting at element `start` in the given array up to but not including `end` to the designated `target` position, returning the resulting array.\n\nBeware this will *mutate* the array.\n\nSee [`Array.copyWithin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/copyWithin) on MDN.\n\n## Examples\n\n```rescript\nlet arr = [100, 101, 102, 103, 104, 105]\narr->Array.copyWithin(~target=1, ~start=2, ~end=5) == [100, 102, 103, 104, 104, 105]\narr == [100, 102, 103, 104, 104, 105]\n```\n"} - }, { - "label": "toString", + "documentation": { + "kind": "markdown", + "value": "\n`copyWithin(array, ~target, ~start, ~end)` copies starting at element `start` in the given array up to but not including `end` to the designated `target` position, returning the resulting array.\n\nBeware this will *mutate* the array.\n\nSee [`Array.copyWithin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/copyWithin) on MDN.\n\n## Examples\n\n```rescript\nlet arr = [100, 101, 102, 103, 104, 105]\narr->Array.copyWithin(~target=1, ~start=2, ~end=5) == [100, 102, 103, 104, 104, 105]\narr == [100, 102, 103, 104, 104, 105]\n```\n" + }, "kind": 12, - "tags": [], + "label": "copyWithin", + "tags": [] + }, + { "detail": "array<'a> => string", - "documentation": {"kind": "markdown", "value": "\n`toString(array)` stringifies `array` by running `toString` on all of the array elements and joining them with \",\".\n\nSee [`Array.toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/toString) on MDN.\n\n## Examples\n\n```rescript\n[1, 2, 3, 4]->Array.toString == \"1,2,3,4\"\n```\n"} - }, { - "label": "everyWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`toString(array)` stringifies `array` by running `toString` on all of the array elements and joining them with \",\".\n\nSee [`Array.toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/toString) on MDN.\n\n## Examples\n\n```rescript\n[1, 2, 3, 4]->Array.toString == \"1,2,3,4\"\n```\n" + }, "kind": 12, - "tags": [], + "label": "toString", + "tags": [] + }, + { "detail": "(array<'a>, ('a, int) => bool) => bool", - "documentation": {"kind": "markdown", "value": "\n`everyWithIndex(array, checker)` returns true if all items in `array` returns true when running the provided `checker` function.\n\nSee [`Array.every`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/every) on MDN.\n\n## Examples\n\n```rescript\nlet array = [1, 2, 3, 4]\n\narray->Array.everyWithIndex((num, index) => index < 5 && num <= 4) == true\n\narray->Array.everyWithIndex((num, index) => index < 2 && num >= 2) == false\n```\n"} - }, { - "label": "fill", + "documentation": { + "kind": "markdown", + "value": "\n`everyWithIndex(array, checker)` returns true if all items in `array` returns true when running the provided `checker` function.\n\nSee [`Array.every`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/every) on MDN.\n\n## Examples\n\n```rescript\nlet array = [1, 2, 3, 4]\n\narray->Array.everyWithIndex((num, index) => index < 5 && num <= 4) == true\n\narray->Array.everyWithIndex((num, index) => index < 2 && num >= 2) == false\n```\n" + }, "kind": 12, - "tags": [], + "label": "everyWithIndex", + "tags": [] + }, + { "detail": "(array<'a>, 'a, ~start: int=?, ~end: int=?) => unit", - "documentation": {"kind": "markdown", "value": "\n`fill(array, value, ~start, ~end)` fills `array` with `value` from `start` to `end`.\n\nBeware this will *mutate* the array.\n\nSee [`Array.fill`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/fill) on MDN.\n\n## Examples\n\n```rescript\nlet myArray = [1, 2, 3, 4]\n\nmyArray->Array.fill(9)\nmyArray == [9, 9, 9, 9]\n\nmyArray->Array.fill(0, ~start=1)\nmyArray == [9, 0, 0, 0]\n\nmyArray->Array.fill(5, ~start=1, ~end=3)\nmyArray == [9, 5, 5, 0]\n```\n"} - }, { - "label": "findWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`fill(array, value, ~start, ~end)` fills `array` with `value` from `start` to `end`.\n\nBeware this will *mutate* the array.\n\nSee [`Array.fill`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/fill) on MDN.\n\n## Examples\n\n```rescript\nlet myArray = [1, 2, 3, 4]\n\nmyArray->Array.fill(9)\nmyArray == [9, 9, 9, 9]\n\nmyArray->Array.fill(0, ~start=1)\nmyArray == [9, 0, 0, 0]\n\nmyArray->Array.fill(5, ~start=1, ~end=3)\nmyArray == [9, 5, 5, 0]\n```\n" + }, "kind": 12, - "tags": [], + "label": "fill", + "tags": [] + }, + { "detail": "(array<'a>, ('a, int) => bool) => option<'a>", - "documentation": {"kind": "markdown", "value": "\n`findWithIndex(array, checker)` returns the first element of `array` where the provided `checker` function returns true.\n\nSee [`Array.find`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/find) on MDN.\n\n## Examples\n\n```rescript\ntype languages = ReScript | TypeScript | JavaScript\n\nlet array = [TypeScript, JavaScript, ReScript]\n\narray->Array.findWithIndex((item, index) => index > 1 && item == ReScript) == Some(ReScript)\n```\n"} - }, { - "label": "reverse", + "documentation": { + "kind": "markdown", + "value": "\n`findWithIndex(array, checker)` returns the first element of `array` where the provided `checker` function returns true.\n\nSee [`Array.find`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/find) on MDN.\n\n## Examples\n\n```rescript\ntype languages = ReScript | TypeScript | JavaScript\n\nlet array = [TypeScript, JavaScript, ReScript]\n\narray->Array.findWithIndex((item, index) => index > 1 && item == ReScript) == Some(ReScript)\n```\n" + }, "kind": 12, - "tags": [], + "label": "findWithIndex", + "tags": [] + }, + { "detail": "array<'a> => unit", - "documentation": {"kind": "markdown", "value": "\n`reverse(array)` reverses the order of the items in `array`.\n\nBeware this will *mutate* the array.\n\nSee [`Array.reverse`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reverse) on MDN.\n\n## Examples\n\n```rescript\nlet someArray = [\"hi\", \"hello\"]\nsomeArray->Array.reverse\n\nsomeArray == [\"hello\", \"hi\"]\n```\n"} - }, { - "label": "fromString", + "documentation": { + "kind": "markdown", + "value": "\n`reverse(array)` reverses the order of the items in `array`.\n\nBeware this will *mutate* the array.\n\nSee [`Array.reverse`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reverse) on MDN.\n\n## Examples\n\n```rescript\nlet someArray = [\"hi\", \"hello\"]\nsomeArray->Array.reverse\n\nsomeArray == [\"hello\", \"hi\"]\n```\n" + }, "kind": 12, - "tags": [], + "label": "reverse", + "tags": [] + }, + { "detail": "string => array", - "documentation": {"kind": "markdown", "value": "\n`fromString(str)` creates an array of each character as a separate string from the provided `str`.\n\n## Examples\n\n```rescript\nArray.fromString(\"abcde\") == [\"a\", \"b\", \"c\", \"d\", \"e\"]\n```\n"} - }, { - "label": "findLastIndexWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`fromString(str)` creates an array of each character as a separate string from the provided `str`.\n\n## Examples\n\n```rescript\nArray.fromString(\"abcde\") == [\"a\", \"b\", \"c\", \"d\", \"e\"]\n```\n" + }, "kind": 12, - "tags": [], + "label": "fromString", + "tags": [] + }, + { "detail": "(array<'a>, ('a, int) => bool) => int", - "documentation": {"kind": "markdown", "value": "\n`findLastIndexWithIndex(array, checker)` returns the index of the last element of `array` where the provided `checker` function returns true.\n\nReturns `-1` if the item does not exist. Consider using `Array.findLastIndexOpt` if you want an option instead (where `-1` would be `None`).\n\nSee [`Array.findLastIndex`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/findLastIndex) on MDN.\n\n## Examples\n\n```rescript\ntype languages = ReScript | TypeScript | JavaScript\n\nlet array = [ReScript, JavaScript, JavaScript, ReScript]\n\nlet isReScriptLast =\n array->Array.findLastIndexWithIndex((item, index) => index === 3 && item == ReScript)\nlet isTypeScriptLast =\n array->Array.findLastIndexWithIndex((item, index) => index === 3 && item == TypeScript)\n\nisReScriptLast == 3\nisTypeScriptLast == -1\n```\n"} - }, { - "label": "getUnsafe", + "documentation": { + "kind": "markdown", + "value": "\n`findLastIndexWithIndex(array, checker)` returns the index of the last element of `array` where the provided `checker` function returns true.\n\nReturns `-1` if the item does not exist. Consider using `Array.findLastIndexOpt` if you want an option instead (where `-1` would be `None`).\n\nSee [`Array.findLastIndex`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/findLastIndex) on MDN.\n\n## Examples\n\n```rescript\ntype languages = ReScript | TypeScript | JavaScript\n\nlet array = [ReScript, JavaScript, JavaScript, ReScript]\n\nlet isReScriptLast =\n array->Array.findLastIndexWithIndex((item, index) => index === 3 && item == ReScript)\nlet isTypeScriptLast =\n array->Array.findLastIndexWithIndex((item, index) => index === 3 && item == TypeScript)\n\nisReScriptLast == 3\nisTypeScriptLast == -1\n```\n" + }, "kind": 12, - "tags": [], + "label": "findLastIndexWithIndex", + "tags": [] + }, + { "detail": "(array<'a>, int) => 'a", - "documentation": {"kind": "markdown", "value": "\n`getUnsafe(array, index)` returns the element at `index` of `array`.\n\nThis is _unsafe_, meaning it will return `undefined` value if `index` does not exist in `array`.\n\nUse `Array.getUnsafe` only when you are sure the `index` exists (i.e. when using for-loop).\n\n## Examples\n```rescript\nlet array = [1, 2, 3]\nfor index in 0 to array->Array.length - 1 {\n let value = array->Array.getUnsafe(index)\n Console.log(value)\n}\n```\n"} - }, { - "label": "entries", + "documentation": { + "kind": "markdown", + "value": "\n`getUnsafe(array, index)` returns the element at `index` of `array`.\n\nThis is _unsafe_, meaning it will return `undefined` value if `index` does not exist in `array`.\n\nUse `Array.getUnsafe` only when you are sure the `index` exists (i.e. when using for-loop).\n\n## Examples\n```rescript\nlet array = [1, 2, 3]\nfor index in 0 to array->Array.length - 1 {\n let value = array->Array.getUnsafe(index)\n Console.log(value)\n}\n```\n" + }, "kind": 12, - "tags": [], + "label": "getUnsafe", + "tags": [] + }, + { "detail": "array<'a> => IteratorObject.t<(int, 'a), unit, unknown>", - "documentation": {"kind": "markdown", "value": "\n`entries(array)` returns a new array iterator object that contains the key/value pairs for each index in the array.\n\nSee [Array.prototype.entries](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/entries) on MDN.\n\n## Examples\n\n```rescript\nlet array = [5, 6, 7]\nlet iterator: IteratorObject.t<(int, int), unit, unknown> = array->Array.entries\niterator->IteratorObject.toArray == [(0, 5), (1, 6), (2, 7)]\n```\n"} - }, { - "label": "unshiftMany", + "documentation": { + "kind": "markdown", + "value": "\n`entries(array)` returns a new array iterator object that contains the key/value pairs for each index in the array.\n\nSee [Array.prototype.entries](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/entries) on MDN.\n\n## Examples\n\n```rescript\nlet array = [5, 6, 7]\nlet iterator: IteratorObject.t<(int, int), unit, unknown> = array->Array.entries\niterator->IteratorObject.toArray == [(0, 5), (1, 6), (2, 7)]\n```\n" + }, "kind": 12, - "tags": [], + "label": "entries", + "tags": [] + }, + { "detail": "(array<'a>, array<'a>) => unit", - "documentation": {"kind": "markdown", "value": "\n`unshiftMany(array, itemsArray)` inserts many new items to the start of the array.\n\nBeware this will *mutate* the array.\n\nSee [`Array.push`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/unshift) on MDN.\n\n## Examples\n\n```rescript\nlet someArray = [\"hi\", \"hello\"]\nsomeArray->Array.unshiftMany([\"yay\", \"wehoo\"])\nsomeArray == [\"yay\", \"wehoo\", \"hi\", \"hello\"]\n```\n"} - }, { - "label": "lastIndexOf", + "documentation": { + "kind": "markdown", + "value": "\n`unshiftMany(array, itemsArray)` inserts many new items to the start of the array.\n\nBeware this will *mutate* the array.\n\nSee [`Array.push`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/unshift) on MDN.\n\n## Examples\n\n```rescript\nlet someArray = [\"hi\", \"hello\"]\nsomeArray->Array.unshiftMany([\"yay\", \"wehoo\"])\nsomeArray == [\"yay\", \"wehoo\", \"hi\", \"hello\"]\n```\n" + }, "kind": 12, - "tags": [], + "label": "unshiftMany", + "tags": [] + }, + { "detail": "(array<'a>, 'a, ~from: int=?) => int", - "documentation": {"kind": "markdown", "value": "\n`lastIndexOf(array, item, ~from)` returns the last index of the provided `item` in `array`, searching backwards from `from`. Uses [strict check for equality](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Strict_equality) when comparing items.\n\nReturns `-1` if the item isn't found. Check out `Array.lastIndexOfOpt` for a version that returns `None` instead of `-1` if the item does not exist.\n\nSee [`Array.lastIndexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/lastIndexOf) on MDN.\n\n## Examples\n\n```rescript\n[1, 2, 1, 2]->Array.lastIndexOf(2) == 3\n[1, 2]->Array.lastIndexOf(3) == -1\n[1, 2, 1, 2]->Array.lastIndexOf(2, ~from=2) == 1\n\n[{\"language\": \"ReScript\"}]->Array.lastIndexOf({\"language\": \"ReScript\"}) == -1 // -1, because of strict equality\n```\n"} - }, { - "label": "fromIterable", + "documentation": { + "kind": "markdown", + "value": "\n`lastIndexOf(array, item, ~from)` returns the last index of the provided `item` in `array`, searching backwards from `from`. Uses [strict check for equality](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Strict_equality) when comparing items.\n\nReturns `-1` if the item isn't found. Check out `Array.lastIndexOfOpt` for a version that returns `None` instead of `-1` if the item does not exist.\n\nSee [`Array.lastIndexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/lastIndexOf) on MDN.\n\n## Examples\n\n```rescript\n[1, 2, 1, 2]->Array.lastIndexOf(2) == 3\n[1, 2]->Array.lastIndexOf(3) == -1\n[1, 2, 1, 2]->Array.lastIndexOf(2, ~from=2) == 1\n\n[{\"language\": \"ReScript\"}]->Array.lastIndexOf({\"language\": \"ReScript\"}) == -1 // -1, because of strict equality\n```\n" + }, "kind": 12, - "tags": [], + "label": "lastIndexOf", + "tags": [] + }, + { "detail": "Iterable.t<'a> => array<'a>", - "documentation": {"kind": "markdown", "value": "\n`fromIterable(iterable)` creates an array from the provided `iterable`\n\n## Examples\n\n```rescript\nMap.fromArray([(\"foo\", 1), (\"bar\", 2)])\n->Map.values\n->IteratorObject.asIterable\n->Array.fromIterable == [1, 2]\n```\n"} - }, { - "label": "filter", + "documentation": { + "kind": "markdown", + "value": "\n`fromIterable(iterable)` creates an array from the provided `iterable`\n\n## Examples\n\n```rescript\nMap.fromArray([(\"foo\", 1), (\"bar\", 2)])\n->Map.values\n->IteratorObject.asIterable\n->Array.fromIterable == [1, 2]\n```\n" + }, "kind": 12, - "tags": [], + "label": "fromIterable", + "tags": [] + }, + { "detail": "(array<'a>, 'a => bool) => array<'a>", - "documentation": {"kind": "markdown", "value": "\n`filter(array, checker)` returns a new array containing all elements from `array` for which the provided `checker` function returns true.\n\nSee [`Array.filter`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/filter) on MDN.\n\n## Examples\n\n```rescript\n[1, 2, 3, 4]->Array.filter(num => num > 2) == [3, 4]\n```\n"} - }, { - "label": "compare", + "documentation": { + "kind": "markdown", + "value": "\n`filter(array, checker)` returns a new array containing all elements from `array` for which the provided `checker` function returns true.\n\nSee [`Array.filter`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/filter) on MDN.\n\n## Examples\n\n```rescript\n[1, 2, 3, 4]->Array.filter(num => num > 2) == [3, 4]\n```\n" + }, "kind": 12, - "tags": [], + "label": "filter", + "tags": [] + }, + { "detail": "(array<'a>, array<'a>, ('a, 'a) => Ordering.t) => Ordering.t", - "documentation": {"kind": "markdown", "value": "\n`compare(left, right, comparator)` compares two arrays element by element using `comparator` and returns an `Ordering`.\n\n## Examples\n\n```rescript\nArray.compare([1, 3], [1, 2], Int.compare) == Ordering.greater\nArray.compare([1, 2], [1, 2], Int.compare) == Ordering.equal\n```\n"} - }, { - "label": "join", + "documentation": { + "kind": "markdown", + "value": "\n`compare(left, right, comparator)` compares two arrays element by element using `comparator` and returns an `Ordering`.\n\n## Examples\n\n```rescript\nArray.compare([1, 3], [1, 2], Int.compare) == Ordering.greater\nArray.compare([1, 2], [1, 2], Int.compare) == Ordering.equal\n```\n" + }, "kind": 12, - "tags": [], + "label": "compare", + "tags": [] + }, + { "detail": "(array, string) => string", - "documentation": {"kind": "markdown", "value": "\n`join(array, separator)` produces a string where all items of `array` are printed, separated by `separator`. Array items must be strings, to join number or other arrays, use `joinUnsafe`. Under the hood this will run JavaScript's `toString` on all the array items.\n\nSee [Array.join](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/join)\n\n## Examples\n\n```rescript\n[\"One\", \"Two\", \"Three\"]->Array.join(\" -- \") == \"One -- Two -- Three\"\n```\n"} - }, { - "label": "last", + "documentation": { + "kind": "markdown", + "value": "\n`join(array, separator)` produces a string where all items of `array` are printed, separated by `separator`. Array items must be strings, to join number or other arrays, use `joinUnsafe`. Under the hood this will run JavaScript's `toString` on all the array items.\n\nSee [Array.join](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/join)\n\n## Examples\n\n```rescript\n[\"One\", \"Two\", \"Three\"]->Array.join(\" -- \") == \"One -- Two -- Three\"\n```\n" + }, "kind": 12, - "tags": [], + "label": "join", + "tags": [] + }, + { "detail": "array<'a> => option<'a>", - "documentation": {"kind": "markdown", "value": "\n`last(array)` returns the last element of `array`.\n\nReturns `None` if the array is empty.\n\n## Examples\n\n```rescript\n[\"Hello\", \"Hi\", \"Good bye\"]->Array.last == Some(\"Good bye\")\n\n[]->Array.last == None\n```\n"} - }, { - "label": "ignore", + "documentation": { + "kind": "markdown", + "value": "\n`last(array)` returns the last element of `array`.\n\nReturns `None` if the array is empty.\n\n## Examples\n\n```rescript\n[\"Hello\", \"Hi\", \"Good bye\"]->Array.last == Some(\"Good bye\")\n\n[]->Array.last == None\n```\n" + }, "kind": 12, - "tags": [], + "label": "last", + "tags": [] + }, + { "detail": "array<'a> => unit", - "documentation": {"kind": "markdown", "value": "\n `ignore(array)` ignores the provided array and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further.\n"} - }, { - "label": "isArray", + "documentation": { + "kind": "markdown", + "value": "\n `ignore(array)` ignores the provided array and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further.\n" + }, "kind": 12, - "tags": [], + "label": "ignore", + "tags": [] + }, + { "detail": "'a => bool", - "documentation": {"kind": "markdown", "value": "\n`isArray(value)` returns `true` when `value` is a JavaScript array and `false` otherwise.\n\nSee [`Array.isArray`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/isArray) on MDN.\n\n## Examples\n\n```rescript\nArray.isArray([1, 2, 3]) == true\nArray.isArray(\"not an array\") == false\n```\n"} - }, { - "label": "values", + "documentation": { + "kind": "markdown", + "value": "\n`isArray(value)` returns `true` when `value` is a JavaScript array and `false` otherwise.\n\nSee [`Array.isArray`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/isArray) on MDN.\n\n## Examples\n\n```rescript\nArray.isArray([1, 2, 3]) == true\nArray.isArray(\"not an array\") == false\n```\n" + }, "kind": 12, - "tags": [], + "label": "isArray", + "tags": [] + }, + { "detail": "array<'a> => IteratorObject.t<'a, unit, unknown>", - "documentation": {"kind": "markdown", "value": "\n`values(array)` returns a new array iterator object that contains the values for each index in the array.\n\nSee [Array.prototype.values](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/values) on MDN.\n\n## Examples\n\n```rescript\nlet array = [5, 6, 7]\nlet iterator: IteratorObject.t = array->Array.values\niterator->IteratorObject.toArray == [5, 6, 7]\n```\n "} - }, { - "label": "indexOfOpt", + "documentation": { + "kind": "markdown", + "value": "\n`values(array)` returns a new array iterator object that contains the values for each index in the array.\n\nSee [Array.prototype.values](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/values) on MDN.\n\n## Examples\n\n```rescript\nlet array = [5, 6, 7]\nlet iterator: IteratorObject.t = array->Array.values\niterator->IteratorObject.toArray == [5, 6, 7]\n```\n " + }, "kind": 12, - "tags": [], + "label": "values", + "tags": [] + }, + { "detail": "(array<'a>, 'a) => option", - "documentation": {"kind": "markdown", "value": "\n`indexOfOpt(array, item)` returns an option of the index of the provided `item` in `array`. Uses [strict check for equality](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Strict_equality) when comparing items.\n\nSee [`Array.indexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/indexOf) on MDN.\n\n## Examples\n\n```rescript\n[1, 2]->Array.indexOfOpt(2) == Some(1)\n[1, 2]->Array.indexOfOpt(3) == None\n[{\"language\": \"ReScript\"}]->Array.indexOfOpt({\"language\": \"ReScript\"}) == None // None, because of strict equality\n```\n"} - }, { - "label": "forEachWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`indexOfOpt(array, item)` returns an option of the index of the provided `item` in `array`. Uses [strict check for equality](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Strict_equality) when comparing items.\n\nSee [`Array.indexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/indexOf) on MDN.\n\n## Examples\n\n```rescript\n[1, 2]->Array.indexOfOpt(2) == Some(1)\n[1, 2]->Array.indexOfOpt(3) == None\n[{\"language\": \"ReScript\"}]->Array.indexOfOpt({\"language\": \"ReScript\"}) == None // None, because of strict equality\n```\n" + }, "kind": 12, - "tags": [], + "label": "indexOfOpt", + "tags": [] + }, + { "detail": "(array<'a>, ('a, int) => unit) => unit", - "documentation": {"kind": "markdown", "value": "\n`forEachWithIndex(array, fn)` runs the provided `fn` on every element of `array`.\n\nSee [`Array.forEach`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/forEach) on MDN.\n\n## Examples\n\n```rescript\nlet array = [\"Hello\", \"Hi\", \"Good bye\"]\n\narray->Array.forEachWithIndex((item, index) => {\n Console.log(\"At item \" ++ Int.toString(index) ++ \": \" ++ item)\n})\n```\n"} - }, { - "label": "reduce", + "documentation": { + "kind": "markdown", + "value": "\n`forEachWithIndex(array, fn)` runs the provided `fn` on every element of `array`.\n\nSee [`Array.forEach`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/forEach) on MDN.\n\n## Examples\n\n```rescript\nlet array = [\"Hello\", \"Hi\", \"Good bye\"]\n\narray->Array.forEachWithIndex((item, index) => {\n Console.log(\"At item \" ++ Int.toString(index) ++ \": \" ++ item)\n})\n```\n" + }, "kind": 12, - "tags": [], + "label": "forEachWithIndex", + "tags": [] + }, + { "detail": "(array<'a>, 'b, ('b, 'a) => 'b) => 'b", - "documentation": {"kind": "markdown", "value": "\n`reduce(xs, init, fn)`\n\nApplies `fn` to each element of `xs` from beginning to end. Function `fn` has two parameters: the item from the list and an \"accumulator\"; which starts with a value of `init`. `reduce` returns the final value of the accumulator.\n\n## Examples\n\n```rescript\nArray.reduce([2, 3, 4], 1, (a, b) => a + b) == 10\n\nArray.reduce([\"a\", \"b\", \"c\", \"d\"], \"\", (a, b) => a ++ b) == \"abcd\"\n\n[1, 2, 3]->Array.reduce(list{}, List.add) == list{3, 2, 1}\n\nArray.reduce([], list{}, List.add) == list{}\n```\n"} - }, { - "label": "sliceToEnd", + "documentation": { + "kind": "markdown", + "value": "\n`reduce(xs, init, fn)`\n\nApplies `fn` to each element of `xs` from beginning to end. Function `fn` has two parameters: the item from the list and an \"accumulator\"; which starts with a value of `init`. `reduce` returns the final value of the accumulator.\n\n## Examples\n\n```rescript\nArray.reduce([2, 3, 4], 1, (a, b) => a + b) == 10\n\nArray.reduce([\"a\", \"b\", \"c\", \"d\"], \"\", (a, b) => a ++ b) == \"abcd\"\n\n[1, 2, 3]->Array.reduce(list{}, List.add) == list{3, 2, 1}\n\nArray.reduce([], list{}, List.add) == list{}\n```\n" + }, "kind": 12, - "tags": [1], + "label": "reduce", + "tags": [] + }, + { + "deprecated": true, "detail": "(array<'a>, ~start: int) => array<'a>", - "documentation": {"kind": "markdown", "value": "Deprecated: Use `slice` instead\n\n\n`sliceToEnd(array, start)` creates a new array from `array`, with all items from `array` starting from `start`.\n\nSee [`Array.slice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/slice) on MDN.\n\n## Examples\n\n```rescript\n[1, 2, 3, 4]->Array.sliceToEnd(~start=1) == [2, 3, 4]\n```\n"} - }, { - "label": "fromArrayLikeWithMap", + "documentation": { + "kind": "markdown", + "value": "Deprecated: Use `slice` instead\n\n\n`sliceToEnd(array, start)` creates a new array from `array`, with all items from `array` starting from `start`.\n\nSee [`Array.slice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/slice) on MDN.\n\n## Examples\n\n```rescript\n[1, 2, 3, 4]->Array.sliceToEnd(~start=1) == [2, 3, 4]\n```\n" + }, "kind": 12, - "tags": [], + "label": "sliceToEnd", + "tags": [ 1 ] + }, + { "detail": "(arrayLike<'a>, 'a => 'b) => array<'b>", - "documentation": {"kind": "markdown", "value": "\n`fromArrayLikeWithMap(source, map)` converts an array-like value into an array and applies `map` to every element.\n\nSee [`Array.from`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/from) on MDN.\n\n## Examples\n\n```rescript\nlet source: Array.arrayLike = %raw(`{0: 1, 1: 2, length: 2}`)\nArray.fromArrayLikeWithMap(source, x => x * 10) == [10, 20]\n```\n"} - }, { - "label": "fillAll", + "documentation": { + "kind": "markdown", + "value": "\n`fromArrayLikeWithMap(source, map)` converts an array-like value into an array and applies `map` to every element.\n\nSee [`Array.from`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/from) on MDN.\n\n## Examples\n\n```rescript\nlet source: Array.arrayLike = %raw(`{0: 1, 1: 2, length: 2}`)\nArray.fromArrayLikeWithMap(source, x => x * 10) == [10, 20]\n```\n" + }, "kind": 12, - "tags": [1], + "label": "fromArrayLikeWithMap", + "tags": [] + }, + { + "deprecated": true, "detail": "(array<'a>, 'a) => unit", - "documentation": {"kind": "markdown", "value": "Deprecated: Use `fill` instead\n\n\n`fillAll(array, value)` fills the entire `array` with `value`.\n\nBeware this will *mutate* the array.\n\nSee [`Array.fill`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/fill) on MDN.\n\n## Examples\n\n```rescript\nlet myArray = [1, 2, 3, 4]\nmyArray->Array.fillAll(9)\nmyArray == [9, 9, 9, 9]\n```\n"} - }, { - "label": "set", + "documentation": { + "kind": "markdown", + "value": "Deprecated: Use `fill` instead\n\n\n`fillAll(array, value)` fills the entire `array` with `value`.\n\nBeware this will *mutate* the array.\n\nSee [`Array.fill`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/fill) on MDN.\n\n## Examples\n\n```rescript\nlet myArray = [1, 2, 3, 4]\nmyArray->Array.fillAll(9)\nmyArray == [9, 9, 9, 9]\n```\n" + }, "kind": 12, - "tags": [], + "label": "fillAll", + "tags": [ 1 ] + }, + { "detail": "(array<'a>, int, 'a) => unit", - "documentation": {"kind": "markdown", "value": "\n`set(array, index, item)` sets the provided `item` at `index` of `array`.\n\nBeware this will *mutate* the array.\n\n## Examples\n\n```rescript\nlet array = [\"Hello\", \"Hi\", \"Good bye\"]\narray->Array.set(1, \"Hello\")\n\narray[1] == Some(\"Hello\")\n```\n"} - }, { - "label": "isEmpty", + "documentation": { + "kind": "markdown", + "value": "\n`set(array, index, item)` sets the provided `item` at `index` of `array`.\n\nBeware this will *mutate* the array.\n\n## Examples\n\n```rescript\nlet array = [\"Hello\", \"Hi\", \"Good bye\"]\narray->Array.set(1, \"Hello\")\n\narray[1] == Some(\"Hello\")\n```\n" + }, "kind": 12, - "tags": [], + "label": "set", + "tags": [] + }, + { "detail": "array<'a> => bool", - "documentation": {"kind": "markdown", "value": "\n`isEmpty(array)` returns `true` if the array is empty (has length 0), `false` otherwise.\n\n## Examples\n\n```rescript\n[]->Array.isEmpty->assertEqual(true)\n[1, 2, 3]->Array.isEmpty->assertEqual(false)\n\nlet emptyArray = []\nemptyArray->Array.isEmpty->assertEqual(true)\n\nlet nonEmptyArray = [\"hello\"]\nnonEmptyArray->Array.isEmpty->assertEqual(false)\n```\n"} - }, { - "label": "filterWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`isEmpty(array)` returns `true` if the array is empty (has length 0), `false` otherwise.\n\n## Examples\n\n```rescript\n[]->Array.isEmpty->assertEqual(true)\n[1, 2, 3]->Array.isEmpty->assertEqual(false)\n\nlet emptyArray = []\nemptyArray->Array.isEmpty->assertEqual(true)\n\nlet nonEmptyArray = [\"hello\"]\nnonEmptyArray->Array.isEmpty->assertEqual(false)\n```\n" + }, "kind": 12, - "tags": [], + "label": "isEmpty", + "tags": [] + }, + { "detail": "(array<'a>, ('a, int) => bool) => array<'a>", - "documentation": {"kind": "markdown", "value": "\n`filterWithIndex(array, checker)` returns a new array containing all elements from `array` for which the provided `checker` function returns true.\n\nSee [`Array.filter`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/filter) on MDN.\n\n## Examples\n\n```rescript\n[1, 2, 3, 4]->Array.filterWithIndex((num, index) => index === 0 || num === 2) == [1, 2]\n```\n"} - }, { - "label": "findIndex", + "documentation": { + "kind": "markdown", + "value": "\n`filterWithIndex(array, checker)` returns a new array containing all elements from `array` for which the provided `checker` function returns true.\n\nSee [`Array.filter`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/filter) on MDN.\n\n## Examples\n\n```rescript\n[1, 2, 3, 4]->Array.filterWithIndex((num, index) => index === 0 || num === 2) == [1, 2]\n```\n" + }, "kind": 12, - "tags": [], + "label": "filterWithIndex", + "tags": [] + }, + { "detail": "(array<'a>, 'a => bool) => int", - "documentation": {"kind": "markdown", "value": "\n`findIndex(array, checker)` returns the index of the first element of `array` where the provided `checker` function returns true.\n\nReturns `-1` if the item does not exist. Consider using `Array.findIndexOpt` if you want an option instead (where `-1` would be `None`).\n\nSee [`Array.findIndex`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/findIndex) on MDN.\n\n## Examples\n\n```rescript\ntype languages = ReScript | TypeScript | JavaScript\n\nlet array = [ReScript, JavaScript]\n\narray->Array.findIndex(item => item == ReScript) == 0\n\narray->Array.findIndex(item => item == TypeScript) == -1\n```\n"} - }, { - "label": "setSymbol", + "documentation": { + "kind": "markdown", + "value": "\n`findIndex(array, checker)` returns the index of the first element of `array` where the provided `checker` function returns true.\n\nReturns `-1` if the item does not exist. Consider using `Array.findIndexOpt` if you want an option instead (where `-1` would be `None`).\n\nSee [`Array.findIndex`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/findIndex) on MDN.\n\n## Examples\n\n```rescript\ntype languages = ReScript | TypeScript | JavaScript\n\nlet array = [ReScript, JavaScript]\n\narray->Array.findIndex(item => item == ReScript) == 0\n\narray->Array.findIndex(item => item == TypeScript) == -1\n```\n" + }, "kind": 12, - "tags": [], + "label": "findIndex", + "tags": [] + }, + { "detail": "(array<'a>, Symbol.t, 'b) => unit", - "documentation": {"kind": "markdown", "value": "\n`setSymbol(array, key, value)` stores `value` under the symbol `key` on `array`.\n\nBeware this will *mutate* the array.\n\nSee [`Symbol`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol) on MDN.\n\n## Examples\n\n```rescript\nlet key = Symbol.make(\"count\")\nlet items = []\nitems->Array.setSymbol(key, 5)\nArray.getSymbol(items, key) == Some(5)\n```\n"} - }, { - "label": "equal", + "documentation": { + "kind": "markdown", + "value": "\n`setSymbol(array, key, value)` stores `value` under the symbol `key` on `array`.\n\nBeware this will *mutate* the array.\n\nSee [`Symbol`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol) on MDN.\n\n## Examples\n\n```rescript\nlet key = Symbol.make(\"count\")\nlet items = []\nitems->Array.setSymbol(key, 5)\nArray.getSymbol(items, key) == Some(5)\n```\n" + }, "kind": 12, - "tags": [], + "label": "setSymbol", + "tags": [] + }, + { "detail": "(array<'a>, array<'a>, ('a, 'a) => bool) => bool", - "documentation": {"kind": "markdown", "value": "\n`equal(left, right, predicate)` checks if the two arrays contain the same elements according to the equality `predicate`.\n\n## Examples\n\n```rescript\nArray.equal([1, 2, 3], [1, 2, 3], Int.equal) == true\nArray.equal([1, 2, 3], [1, 3, 2], Int.equal) == false\n```\n"} - }, { - "label": "concatAll", + "documentation": { + "kind": "markdown", + "value": "\n`equal(left, right, predicate)` checks if the two arrays contain the same elements according to the equality `predicate`.\n\n## Examples\n\n```rescript\nArray.equal([1, 2, 3], [1, 2, 3], Int.equal) == true\nArray.equal([1, 2, 3], [1, 3, 2], Int.equal) == false\n```\n" + }, "kind": 12, - "tags": [], + "label": "equal", + "tags": [] + }, + { "detail": "array> => array<'a>", - "documentation": {"kind": "markdown", "value": "\n`concatAll(arrays)` concatenates all arrays in `arrays`, creating a new array.\n\nSee [`Array.concat`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/concat) on MDN.\n\n## Examples\n```rescript\nlet arrays = [[\"hi\", \"hello\"], [\"yay\"], [\"wehoo\"]]\n\nlet result = Array.concatAll(arrays)\n\narrays == [[\"hi\", \"hello\"], [\"yay\"], [\"wehoo\"]]\nresult == [\"hi\", \"hello\", \"yay\", \"wehoo\"]\n```\n"} - }, { - "label": "joinUnsafe", + "documentation": { + "kind": "markdown", + "value": "\n`concatAll(arrays)` concatenates all arrays in `arrays`, creating a new array.\n\nSee [`Array.concat`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/concat) on MDN.\n\n## Examples\n```rescript\nlet arrays = [[\"hi\", \"hello\"], [\"yay\"], [\"wehoo\"]]\n\nlet result = Array.concatAll(arrays)\n\narrays == [[\"hi\", \"hello\"], [\"yay\"], [\"wehoo\"]]\nresult == [\"hi\", \"hello\", \"yay\", \"wehoo\"]\n```\n" + }, "kind": 12, - "tags": [], + "label": "concatAll", + "tags": [] + }, + { "detail": "(array<'a>, string) => string", - "documentation": {"kind": "markdown", "value": "\n`joinUnsafe(array, separator)` produces a string where all items of `array` are printed, separated by `separator`. Under the hood this will run JavaScript's `toString` on all the array items.\n\nSee [Array.join](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/join)\n\n## Examples\n\n```rescript\n[1, 2, 3]->Array.joinUnsafe(\" -- \") == \"1 -- 2 -- 3\"\n```\n"} - }, { - "label": "mapWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`joinUnsafe(array, separator)` produces a string where all items of `array` are printed, separated by `separator`. Under the hood this will run JavaScript's `toString` on all the array items.\n\nSee [Array.join](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/join)\n\n## Examples\n\n```rescript\n[1, 2, 3]->Array.joinUnsafe(\" -- \") == \"1 -- 2 -- 3\"\n```\n" + }, "kind": 12, - "tags": [], + "label": "joinUnsafe", + "tags": [] + }, + { "detail": "(array<'a>, ('a, int) => 'b) => array<'b>", - "documentation": {"kind": "markdown", "value": "\n`mapWithIndex(array, fn)` returns a new array with all elements from `array`, each element transformed using the provided `fn`.\n\nSee [`Array.map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map) on MDN.\n\n## Examples\n\n```rescript\nlet array = [\"Hello\", \"Hi\", \"Good bye\"]\nlet mappedArray =\n array->Array.mapWithIndex((greeting, index) => greeting ++ \" at position \" ++ Int.toString(index))\n\nmappedArray == [\"Hello at position 0\", \"Hi at position 1\", \"Good bye at position 2\"]\n```\n"} - }, { - "label": "flatMapWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`mapWithIndex(array, fn)` returns a new array with all elements from `array`, each element transformed using the provided `fn`.\n\nSee [`Array.map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map) on MDN.\n\n## Examples\n\n```rescript\nlet array = [\"Hello\", \"Hi\", \"Good bye\"]\nlet mappedArray =\n array->Array.mapWithIndex((greeting, index) => greeting ++ \" at position \" ++ Int.toString(index))\n\nmappedArray == [\"Hello at position 0\", \"Hi at position 1\", \"Good bye at position 2\"]\n```\n" + }, "kind": 12, - "tags": [], + "label": "mapWithIndex", + "tags": [] + }, + { "detail": "(array<'a>, ('a, int) => array<'b>) => array<'b>", - "documentation": {"kind": "markdown", "value": "\n`flatMapWithIndex(array, mapper)` returns a new array concatenating the arrays returned from running `mapper` on all items in `array`.\n\n## Examples\n\n```rescript\ntype language = ReScript | TypeScript | JavaScript\n\nlet array = [ReScript, TypeScript, JavaScript]\n\narray->Array.flatMapWithIndex((item, index) =>\n switch item {\n | ReScript => [index]\n | TypeScript => [index, index + 1]\n | JavaScript => [index, index + 1, index + 2]\n }\n) == [0, 1, 2, 2, 3, 4]\n```\n"} - }, { - "label": "copyWithinToEnd", + "documentation": { + "kind": "markdown", + "value": "\n`flatMapWithIndex(array, mapper)` returns a new array concatenating the arrays returned from running `mapper` on all items in `array`.\n\n## Examples\n\n```rescript\ntype language = ReScript | TypeScript | JavaScript\n\nlet array = [ReScript, TypeScript, JavaScript]\n\narray->Array.flatMapWithIndex((item, index) =>\n switch item {\n | ReScript => [index]\n | TypeScript => [index, index + 1]\n | JavaScript => [index, index + 1, index + 2]\n }\n) == [0, 1, 2, 2, 3, 4]\n```\n" + }, "kind": 12, - "tags": [1], + "label": "flatMapWithIndex", + "tags": [] + }, + { + "deprecated": true, "detail": "(array<'a>, ~target: int, ~start: int) => array<'a>", - "documentation": {"kind": "markdown", "value": "Deprecated: Use `copyWithin` instead\n\n\n`copyWithinToEnd(array, ~target, ~start)` copies starting at element `start` in the given array to the designated `target` position, returning the resulting array.\n\nBeware this will *mutate* the array.\n\nSee [`Array.copyWithin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/copyWithin) on MDN.\n\n## Examples\n\n```rescript\nlet arr = [100, 101, 102, 103, 104]\narr->Array.copyWithinToEnd(~target=0, ~start=2) == [102, 103, 104, 103, 104]\narr == [102, 103, 104, 103, 104]\n```\n"} - }, { - "label": "unshift", + "documentation": { + "kind": "markdown", + "value": "Deprecated: Use `copyWithin` instead\n\n\n`copyWithinToEnd(array, ~target, ~start)` copies starting at element `start` in the given array to the designated `target` position, returning the resulting array.\n\nBeware this will *mutate* the array.\n\nSee [`Array.copyWithin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/copyWithin) on MDN.\n\n## Examples\n\n```rescript\nlet arr = [100, 101, 102, 103, 104]\narr->Array.copyWithinToEnd(~target=0, ~start=2) == [102, 103, 104, 103, 104]\narr == [102, 103, 104, 103, 104]\n```\n" + }, "kind": 12, - "tags": [], + "label": "copyWithinToEnd", + "tags": [ 1 ] + }, + { "detail": "(array<'a>, 'a) => unit", - "documentation": {"kind": "markdown", "value": "\n`unshift(array, item)` inserts a new item at the start of the array.\n\nBeware this will *mutate* the array.\n\nSee [`Array.unshift`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/unshift) on MDN.\n\n## Examples\n\n```rescript\nlet someArray = [\"hi\", \"hello\"]\nsomeArray->Array.unshift(\"yay\")\nsomeArray == [\"yay\", \"hi\", \"hello\"]\n```\n"} - }, { - "label": "indexOf", + "documentation": { + "kind": "markdown", + "value": "\n`unshift(array, item)` inserts a new item at the start of the array.\n\nBeware this will *mutate* the array.\n\nSee [`Array.unshift`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/unshift) on MDN.\n\n## Examples\n\n```rescript\nlet someArray = [\"hi\", \"hello\"]\nsomeArray->Array.unshift(\"yay\")\nsomeArray == [\"yay\", \"hi\", \"hello\"]\n```\n" + }, "kind": 12, - "tags": [], + "label": "unshift", + "tags": [] + }, + { "detail": "(array<'a>, 'a, ~from: int=?) => int", - "documentation": {"kind": "markdown", "value": "\n`indexOf(array, item, ~from)` returns the index of the provided `item` in `array`, starting the search at `from`. Uses [strict check for equality](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Strict_equality) when comparing items.\n\nReturns `-1` if the item isn't found. Check out `Array.indexOfOpt` for a version that returns `None` instead of `-1` if the item does not exist.\n\nSee [`Array.indexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/indexOf) on MDN.\n\n## Examples\n\n```rescript\n[1, 2]->Array.indexOf(2) == 1\n[1, 2]->Array.indexOf(3) == -1\n[1, 2, 1, 2]->Array.indexOf(2, ~from=2) == 3\n\n[{\"language\": \"ReScript\"}]->Array.indexOf({\"language\": \"ReScript\"}) == -1 // -1, because of strict equality\n```\n"} - }, { - "label": "push", + "documentation": { + "kind": "markdown", + "value": "\n`indexOf(array, item, ~from)` returns the index of the provided `item` in `array`, starting the search at `from`. Uses [strict check for equality](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Strict_equality) when comparing items.\n\nReturns `-1` if the item isn't found. Check out `Array.indexOfOpt` for a version that returns `None` instead of `-1` if the item does not exist.\n\nSee [`Array.indexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/indexOf) on MDN.\n\n## Examples\n\n```rescript\n[1, 2]->Array.indexOf(2) == 1\n[1, 2]->Array.indexOf(3) == -1\n[1, 2, 1, 2]->Array.indexOf(2, ~from=2) == 3\n\n[{\"language\": \"ReScript\"}]->Array.indexOf({\"language\": \"ReScript\"}) == -1 // -1, because of strict equality\n```\n" + }, "kind": 12, - "tags": [], + "label": "indexOf", + "tags": [] + }, + { "detail": "(array<'a>, 'a) => unit", - "documentation": {"kind": "markdown", "value": "\n`push(array, item)` appends `item` to the end of `array`.\n\nBeware this will *mutate* the array.\n\nSee [`Array.push`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/push) on MDN.\n\n## Examples\n\n```rescript\nlet someArray = [\"hi\", \"hello\"]\n\nsomeArray->Array.push(\"yay\")\n\nsomeArray == [\"hi\", \"hello\", \"yay\"]\n```\n"} - }, { - "label": "toSorted", + "documentation": { + "kind": "markdown", + "value": "\n`push(array, item)` appends `item` to the end of `array`.\n\nBeware this will *mutate* the array.\n\nSee [`Array.push`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/push) on MDN.\n\n## Examples\n\n```rescript\nlet someArray = [\"hi\", \"hello\"]\n\nsomeArray->Array.push(\"yay\")\n\nsomeArray == [\"hi\", \"hello\", \"yay\"]\n```\n" + }, "kind": 12, - "tags": [], + "label": "push", + "tags": [] + }, + { "detail": "(array<'a>, ('a, 'a) => Ordering.t) => array<'a>", - "documentation": {"kind": "markdown", "value": "\n`toSorted(array, comparator)` returns a new, sorted array from `array`, using the `comparator` function.\n\nSee [`Array.toSorted`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/toSorted) on MDN.\n\n## Examples\n\n```rescript\nlet someArray = [3, 2, 1]\n\nsomeArray->Array.toSorted(Int.compare) == [1, 2, 3]\n\nsomeArray == [3, 2, 1] // Original unchanged\n```\n"} - }, { - "label": "reduceWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`toSorted(array, comparator)` returns a new, sorted array from `array`, using the `comparator` function.\n\nSee [`Array.toSorted`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/toSorted) on MDN.\n\n## Examples\n\n```rescript\nlet someArray = [3, 2, 1]\n\nsomeArray->Array.toSorted(Int.compare) == [1, 2, 3]\n\nsomeArray == [3, 2, 1] // Original unchanged\n```\n" + }, "kind": 12, - "tags": [], + "label": "toSorted", + "tags": [] + }, + { "detail": "(array<'a>, 'b, ('b, 'a, int) => 'b) => 'b", - "documentation": {"kind": "markdown", "value": "\n`reduceWithIndex(x, init, fn)`\n\nApplies `fn` to each element of `xs` from beginning to end. Function `fn` has three parameters: the item from the array and an \"accumulator\", which starts with a value of `init` and the index of each element. `reduceWithIndex` returns the final value of the accumulator.\n\n## Examples\n\n```rescript\nArray.reduceWithIndex([1, 2, 3, 4], 0, (acc, x, i) => acc + x + i) == 16\n\nArray.reduceWithIndex([1, 2, 3], list{}, (acc, v, i) => list{v + i, ...acc}) == list{5, 3, 1}\n\nArray.reduceWithIndex([], list{}, (acc, v, i) => list{v + i, ...acc}) == list{}\n```\n"} - }, { - "label": "some", + "documentation": { + "kind": "markdown", + "value": "\n`reduceWithIndex(x, init, fn)`\n\nApplies `fn` to each element of `xs` from beginning to end. Function `fn` has three parameters: the item from the array and an \"accumulator\", which starts with a value of `init` and the index of each element. `reduceWithIndex` returns the final value of the accumulator.\n\n## Examples\n\n```rescript\nArray.reduceWithIndex([1, 2, 3, 4], 0, (acc, x, i) => acc + x + i) == 16\n\nArray.reduceWithIndex([1, 2, 3], list{}, (acc, v, i) => list{v + i, ...acc}) == list{5, 3, 1}\n\nArray.reduceWithIndex([], list{}, (acc, v, i) => list{v + i, ...acc}) == list{}\n```\n" + }, "kind": 12, - "tags": [], + "label": "reduceWithIndex", + "tags": [] + }, + { "detail": "(array<'a>, 'a => bool) => bool", - "documentation": {"kind": "markdown", "value": "\n`some(array, predicate)` returns true if `predicate` returns true for any element in `array`.\n\nSee [`Array.some`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/some) on MDN.\n\n## Examples\n\n```rescript\nlet array = [\"Hello\", \"Hi\", \"Good bye\"]\n\narray->Array.some(greeting => greeting === \"Hello\") == true\n```\n"} - }, { - "label": "unsafe_get", + "documentation": { + "kind": "markdown", + "value": "\n`some(array, predicate)` returns true if `predicate` returns true for any element in `array`.\n\nSee [`Array.some`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/some) on MDN.\n\n## Examples\n\n```rescript\nlet array = [\"Hello\", \"Hi\", \"Good bye\"]\n\narray->Array.some(greeting => greeting === \"Hello\") == true\n```\n" + }, "kind": 12, - "tags": [1], + "label": "some", + "tags": [] + }, + { + "deprecated": true, "detail": "(array<'a>, int) => 'a", - "documentation": {"kind": "markdown", "value": "Deprecated: Use getUnsafe instead. This will be removed in v13\n\n\n`unsafe_get(array, index)` returns the element at `index` of `array`.\n\nThis is _unsafe_, meaning it will return `undefined` value if `index` does not exist in `array`.\n\nUse `Array.unsafe_get` only when you are sure the `index` exists (i.e. when using for-loop).\n\n## Examples\n\n```rescript\nlet array = [1, 2, 3]\nfor index in 0 to array->Array.length - 1 {\n let value = array->Array.unsafe_get(index)\n Console.log(value)\n}\n```\n"} - }, { - "label": "partition", + "documentation": { + "kind": "markdown", + "value": "Deprecated: Use getUnsafe instead. This will be removed in v13\n\n\n`unsafe_get(array, index)` returns the element at `index` of `array`.\n\nThis is _unsafe_, meaning it will return `undefined` value if `index` does not exist in `array`.\n\nUse `Array.unsafe_get` only when you are sure the `index` exists (i.e. when using for-loop).\n\n## Examples\n\n```rescript\nlet array = [1, 2, 3]\nfor index in 0 to array->Array.length - 1 {\n let value = array->Array.unsafe_get(index)\n Console.log(value)\n}\n```\n" + }, "kind": 12, - "tags": [], + "label": "unsafe_get", + "tags": [ 1 ] + }, + { "detail": "(t<'a>, 'a => bool) => (t<'a>, t<'a>)", - "documentation": {"kind": "markdown", "value": "\n`partition(f, a)` split array into tuple of two arrays based on predicate `f`;\nfirst of tuple where predicate cause true, second where predicate cause false\n\n## Examples\n\n```rescript\nArray.partition([1, 2, 3, 4, 5], x => mod(x, 2) == 0) == ([2, 4], [1, 3, 5])\n\nArray.partition([1, 2, 3, 4, 5], x => mod(x, 2) != 0) == ([1, 3, 5], [2, 4])\n```\n"} - }, { - "label": "copyAllWithin", + "documentation": { + "kind": "markdown", + "value": "\n`partition(f, a)` split array into tuple of two arrays based on predicate `f`;\nfirst of tuple where predicate cause true, second where predicate cause false\n\n## Examples\n\n```rescript\nArray.partition([1, 2, 3, 4, 5], x => mod(x, 2) == 0) == ([2, 4], [1, 3, 5])\n\nArray.partition([1, 2, 3, 4, 5], x => mod(x, 2) != 0) == ([1, 3, 5], [2, 4])\n```\n" + }, "kind": 12, - "tags": [1], + "label": "partition", + "tags": [] + }, + { + "deprecated": true, "detail": "(array<'a>, ~target: int) => array<'a>", - "documentation": {"kind": "markdown", "value": "Deprecated: Use `copyWithin` instead\n\n\n`isEmpty(array)` returns `true` if the array is empty (has length 0), `false` otherwise.\n\n## Examples\n\n```rescript\nlet arr = [100, 101, 102, 103, 104]\narr->Array.copyAllWithin(~target=2) == [100, 101, 100, 101, 102]\narr == [100, 101, 100, 101, 102]\n```\n"} - }, { - "label": "keepSome", + "documentation": { + "kind": "markdown", + "value": "Deprecated: Use `copyWithin` instead\n\n\n`isEmpty(array)` returns `true` if the array is empty (has length 0), `false` otherwise.\n\n## Examples\n\n```rescript\nlet arr = [100, 101, 102, 103, 104]\narr->Array.copyAllWithin(~target=2) == [100, 101, 100, 101, 102]\narr == [100, 101, 100, 101, 102]\n```\n" + }, "kind": 12, - "tags": [], + "label": "copyAllWithin", + "tags": [ 1 ] + }, + { "detail": "array> => array<'a>", - "documentation": {"kind": "markdown", "value": "\n`keepSome(arr)`\n\nReturns a new array containing `value` for all elements that are `Some(value)`\nand ignoring every value that is `None`\n\n## Examples\n\n```rescript\nArray.keepSome([Some(1), None, Some(3)]) == [1, 3]\n\nArray.keepSome([Some(1), Some(2), Some(3)]) == [1, 2, 3]\n\nArray.keepSome([None, None, None]) == []\n\nArray.keepSome([]) == []\n```\n"} - }, { - "label": "at", + "documentation": { + "kind": "markdown", + "value": "\n`keepSome(arr)`\n\nReturns a new array containing `value` for all elements that are `Some(value)`\nand ignoring every value that is `None`\n\n## Examples\n\n```rescript\nArray.keepSome([Some(1), None, Some(3)]) == [1, 3]\n\nArray.keepSome([Some(1), Some(2), Some(3)]) == [1, 2, 3]\n\nArray.keepSome([None, None, None]) == []\n\nArray.keepSome([]) == []\n```\n" + }, "kind": 12, - "tags": [], + "label": "keepSome", + "tags": [] + }, + { "detail": "(array<'a>, int) => option<'a>", - "documentation": {"kind": "markdown", "value": "\n`at(array, index)`\n\nGet an element by its index. Negative indices count backwards from the last item.\n\n## Examples\n\n```rescript\n[\"a\", \"b\", \"c\"]->Array.at(0) == Some(\"a\")\n[\"a\", \"b\", \"c\"]->Array.at(2) == Some(\"c\")\n[\"a\", \"b\", \"c\"]->Array.at(3) == None\n[\"a\", \"b\", \"c\"]->Array.at(-1) == Some(\"c\")\n[\"a\", \"b\", \"c\"]->Array.at(-3) == Some(\"a\")\n[\"a\", \"b\", \"c\"]->Array.at(-4) == None\n```\n"} - }, { - "label": "pop", + "documentation": { + "kind": "markdown", + "value": "\n`at(array, index)`\n\nGet an element by its index. Negative indices count backwards from the last item.\n\n## Examples\n\n```rescript\n[\"a\", \"b\", \"c\"]->Array.at(0) == Some(\"a\")\n[\"a\", \"b\", \"c\"]->Array.at(2) == Some(\"c\")\n[\"a\", \"b\", \"c\"]->Array.at(3) == None\n[\"a\", \"b\", \"c\"]->Array.at(-1) == Some(\"c\")\n[\"a\", \"b\", \"c\"]->Array.at(-3) == Some(\"a\")\n[\"a\", \"b\", \"c\"]->Array.at(-4) == None\n```\n" + }, "kind": 12, - "tags": [], + "label": "at", + "tags": [] + }, + { "detail": "array<'a> => option<'a>", - "documentation": {"kind": "markdown", "value": "\n`pop(array)` removes the last item from `array` and returns it.\n\nBeware this will *mutate* the array.\n\nSee [`Array.pop`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/pop) on MDN.\n\n## Examples\n\n```rescript\nlet someArray = [\"hi\", \"hello\"]\n\nsomeArray->Array.pop == Some(\"hello\")\n\nsomeArray == [\"hi\"] // Notice last item is gone.\n```\n"} - }, { - "label": "get", + "documentation": { + "kind": "markdown", + "value": "\n`pop(array)` removes the last item from `array` and returns it.\n\nBeware this will *mutate* the array.\n\nSee [`Array.pop`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/pop) on MDN.\n\n## Examples\n\n```rescript\nlet someArray = [\"hi\", \"hello\"]\n\nsomeArray->Array.pop == Some(\"hello\")\n\nsomeArray == [\"hi\"] // Notice last item is gone.\n```\n" + }, "kind": 12, - "tags": [], + "label": "pop", + "tags": [] + }, + { "detail": "(array<'a>, int) => option<'a>", - "documentation": {"kind": "markdown", "value": "\n`get(array, index)` returns the element at `index` of `array`.\n\nReturns `None` if the index does not exist in the array. Equivalent to doing `array[index]` in JavaScript.\n\n## Examples\n\n```rescript\nlet array = [\"Hello\", \"Hi\", \"Good bye\"]\n\narray->Array.get(0) == Some(\"Hello\")\n\narray->Array.get(3) == None\n```\n"} - }, { - "label": "asIterable", + "documentation": { + "kind": "markdown", + "value": "\n`get(array, index)` returns the element at `index` of `array`.\n\nReturns `None` if the index does not exist in the array. Equivalent to doing `array[index]` in JavaScript.\n\n## Examples\n\n```rescript\nlet array = [\"Hello\", \"Hi\", \"Good bye\"]\n\narray->Array.get(0) == Some(\"Hello\")\n\narray->Array.get(3) == None\n```\n" + }, "kind": 12, - "tags": [], + "label": "get", + "tags": [] + }, + { "detail": "array<'a> => Iterable.t<'a>", - "documentation": {"kind": "markdown", "value": "\n`asIterable(array)` views `array` as an `Iterable.t`.\n\nThis is useful when passing an array to APIs that consume iterables, such as\n`Array.from` or `for...of` in JavaScript.\n"} - }, { - "label": "removeInPlace", + "documentation": { + "kind": "markdown", + "value": "\n`asIterable(array)` views `array` as an `Iterable.t`.\n\nThis is useful when passing an array to APIs that consume iterables, such as\n`Array.from` or `for...of` in JavaScript.\n" + }, "kind": 12, - "tags": [], + "label": "asIterable", + "tags": [] + }, + { "detail": "(array<'a>, int) => unit", - "documentation": {"kind": "markdown", "value": "\n`removeInPlace(array, index)` removes the item at the specified `index` from `array`.\n\nBeware this will *mutate* the array.\n\n## Examples\n\n```rescript\nlet array = []\narray->Array.removeInPlace(0)\narray == [] // Removing from an empty array does nothing\n\nlet array2 = [\"Hello\", \"Hi\", \"Good bye\"]\narray2->Array.removeInPlace(1)\narray2 == [\"Hello\", \"Good bye\"] // Removes the item at index 1\n```\n "} - }, { - "label": "findLastIndexOpt", + "documentation": { + "kind": "markdown", + "value": "\n`removeInPlace(array, index)` removes the item at the specified `index` from `array`.\n\nBeware this will *mutate* the array.\n\n## Examples\n\n```rescript\nlet array = []\narray->Array.removeInPlace(0)\narray == [] // Removing from an empty array does nothing\n\nlet array2 = [\"Hello\", \"Hi\", \"Good bye\"]\narray2->Array.removeInPlace(1)\narray2 == [\"Hello\", \"Good bye\"] // Removes the item at index 1\n```\n " + }, "kind": 12, - "tags": [], + "label": "removeInPlace", + "tags": [] + }, + { "detail": "(array<'a>, 'a => bool) => option", - "documentation": {"kind": "markdown", "value": "\n`findIndexOpt(array, checker)` returns the index of the last element of `array` where the provided `checker` function returns true.\n\nReturns `None` if no item matches.\n\nSee [`Array.findLastIndex`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/findLastIndex) on MDN.\n\n## Examples\n\n```rescript\nlet array = [\"hello\", \"world\", \"!\"]\n\narray->Array.findLastIndexOpt(item => item->String.includes(\"o\")) == Some(1)\n```\n"} - }, { - "label": "pushMany", + "documentation": { + "kind": "markdown", + "value": "\n`findIndexOpt(array, checker)` returns the index of the last element of `array` where the provided `checker` function returns true.\n\nReturns `None` if no item matches.\n\nSee [`Array.findLastIndex`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/findLastIndex) on MDN.\n\n## Examples\n\n```rescript\nlet array = [\"hello\", \"world\", \"!\"]\n\narray->Array.findLastIndexOpt(item => item->String.includes(\"o\")) == Some(1)\n```\n" + }, "kind": 12, - "tags": [], + "label": "findLastIndexOpt", + "tags": [] + }, + { "detail": "(array<'a>, array<'a>) => unit", - "documentation": {"kind": "markdown", "value": "\n`pushMany(array, itemsArray)` appends many new items to the end of the array.\n\nBeware this will *mutate* the array.\n\nSee [`Array.push`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/push) on MDN.\n\n## Examples\n\n```rescript\nlet someArray = [\"hi\", \"hello\"]\n\nsomeArray->Array.pushMany([\"yay\", \"wehoo\"])\nsomeArray == [\"hi\", \"hello\", \"yay\", \"wehoo\"]\n```\n"} - }, { - "label": "unzip", + "documentation": { + "kind": "markdown", + "value": "\n`pushMany(array, itemsArray)` appends many new items to the end of the array.\n\nBeware this will *mutate* the array.\n\nSee [`Array.push`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/push) on MDN.\n\n## Examples\n\n```rescript\nlet someArray = [\"hi\", \"hello\"]\n\nsomeArray->Array.pushMany([\"yay\", \"wehoo\"])\nsomeArray == [\"hi\", \"hello\", \"yay\", \"wehoo\"]\n```\n" + }, "kind": 12, - "tags": [], + "label": "pushMany", + "tags": [] + }, + { "detail": "array<('a, 'b)> => (t<'a>, array<'b>)", - "documentation": {"kind": "markdown", "value": "\n`unzip(a)` takes an array of pairs and creates a pair of arrays. The first array\ncontains all the first items of the pairs; the second array contains all the\nsecond items.\n\n## Examples\n\n```rescript\nArray.unzip([(1, 2), (3, 4)]) == ([1, 3], [2, 4])\n\nArray.unzip([(1, 2), (3, 4), (5, 6), (7, 8)]) == ([1, 3, 5, 7], [2, 4, 6, 8])\n```\n"} - }, { - "label": "forEach", + "documentation": { + "kind": "markdown", + "value": "\n`unzip(a)` takes an array of pairs and creates a pair of arrays. The first array\ncontains all the first items of the pairs; the second array contains all the\nsecond items.\n\n## Examples\n\n```rescript\nArray.unzip([(1, 2), (3, 4)]) == ([1, 3], [2, 4])\n\nArray.unzip([(1, 2), (3, 4), (5, 6), (7, 8)]) == ([1, 3, 5, 7], [2, 4, 6, 8])\n```\n" + }, "kind": 12, - "tags": [], + "label": "unzip", + "tags": [] + }, + { "detail": "(array<'a>, 'a => unit) => unit", - "documentation": {"kind": "markdown", "value": "\n`forEach(array, fn)` runs the provided `fn` on every element of `array`.\n\nSee [`Array.forEach`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/forEach) on MDN.\n\n## Examples\n```rescript\nlet array = [\"Hello\", \"Hi\", \"Good bye\"]\n\narray->Array.forEach(item => {\n Console.log(item)\n})\n```\n"} - }, { - "label": "flatMap", + "documentation": { + "kind": "markdown", + "value": "\n`forEach(array, fn)` runs the provided `fn` on every element of `array`.\n\nSee [`Array.forEach`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/forEach) on MDN.\n\n## Examples\n```rescript\nlet array = [\"Hello\", \"Hi\", \"Good bye\"]\n\narray->Array.forEach(item => {\n Console.log(item)\n})\n```\n" + }, "kind": 12, - "tags": [], + "label": "forEach", + "tags": [] + }, + { "detail": "(array<'a>, 'a => array<'b>) => array<'b>", - "documentation": {"kind": "markdown", "value": "\n`flatMap(array, mapper)` returns a new array concatenating the arrays returned from running `mapper` on all items in `array`.\n\n## Examples\n\n```rescript\ntype language = ReScript | TypeScript | JavaScript\n\nlet array = [ReScript, TypeScript, JavaScript]\n\narray->Array.flatMap(item =>\n switch item {\n | ReScript => [1, 2, 3]\n | TypeScript => [4, 5, 6]\n | JavaScript => [7, 8, 9]\n }\n) == [1, 2, 3, 4, 5, 6, 7, 8, 9]\n```\n"} - }, { - "label": "fromArrayLike", + "documentation": { + "kind": "markdown", + "value": "\n`flatMap(array, mapper)` returns a new array concatenating the arrays returned from running `mapper` on all items in `array`.\n\n## Examples\n\n```rescript\ntype language = ReScript | TypeScript | JavaScript\n\nlet array = [ReScript, TypeScript, JavaScript]\n\narray->Array.flatMap(item =>\n switch item {\n | ReScript => [1, 2, 3]\n | TypeScript => [4, 5, 6]\n | JavaScript => [7, 8, 9]\n }\n) == [1, 2, 3, 4, 5, 6, 7, 8, 9]\n```\n" + }, "kind": 12, - "tags": [], + "label": "flatMap", + "tags": [] + }, + { "detail": "arrayLike<'a> => array<'a>", - "documentation": {"kind": "markdown", "value": "\n`fromArrayLike(source)` converts an array-like value (anything with indexed items and a `length`) into a regular array.\n\nSee [`Array.from`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/from) on MDN.\n\n## Examples\n\n```rescript\nlet source: Array.arrayLike = %raw(`{0: 10, 1: 20, length: 2}`)\nArray.fromArrayLike(source) == [10, 20]\n```\n"} - }, { - "label": "indexOfFrom", + "documentation": { + "kind": "markdown", + "value": "\n`fromArrayLike(source)` converts an array-like value (anything with indexed items and a `length`) into a regular array.\n\nSee [`Array.from`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/from) on MDN.\n\n## Examples\n\n```rescript\nlet source: Array.arrayLike = %raw(`{0: 10, 1: 20, length: 2}`)\nArray.fromArrayLike(source) == [10, 20]\n```\n" + }, "kind": 12, - "tags": [1], + "label": "fromArrayLike", + "tags": [] + }, + { + "deprecated": true, "detail": "(array<'a>, 'a, int) => int", - "documentation": {"kind": "markdown", "value": "Deprecated: Use `indexOf` instead\n\n"} - }] + "documentation": { + "kind": "markdown", + "value": "Deprecated: Use `indexOf` instead\n\n" + }, + "kind": 12, + "label": "indexOfFrom", + "tags": [ 1 ] + } +] Complete src/Completion.res 5:10 posCursor:[5:10] posNoWhite:[5:9] Found expr:[5:3->5:10] @@ -662,25 +1094,38 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Value[Array, m] Path Array.m -[{ - "label": "make", - "kind": 12, - "tags": [], +[ + { "detail": "(~length: int, 'a) => array<'a>", - "documentation": {"kind": "markdown", "value": "\n`make(~length, init)` creates an array of length `length` initialized with the value of `init`.\n\n## Examples\n\n```rescript\nArray.make(~length=3, #apple) == [#apple, #apple, #apple]\nArray.make(~length=6, 7) == [7, 7, 7, 7, 7, 7]\n```\n"} - }, { - "label": "map", + "documentation": { + "kind": "markdown", + "value": "\n`make(~length, init)` creates an array of length `length` initialized with the value of `init`.\n\n## Examples\n\n```rescript\nArray.make(~length=3, #apple) == [#apple, #apple, #apple]\nArray.make(~length=6, 7) == [7, 7, 7, 7, 7, 7]\n```\n" + }, "kind": 12, - "tags": [], + "label": "make", + "tags": [] + }, + { "detail": "(array<'a>, 'a => 'b) => array<'b>", - "documentation": {"kind": "markdown", "value": "\n`map(array, fn)` returns a new array with all elements from `array`, each element transformed using the provided `fn`.\n\nSee [`Array.map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map) on MDN.\n\n## Examples\n\n```rescript\nlet array = [\"Hello\", \"Hi\", \"Good bye\"]\nlet mappedArray = array->Array.map(greeting => greeting ++ \" to you\")\n\nmappedArray == [\"Hello to you\", \"Hi to you\", \"Good bye to you\"]\n```\n"} - }, { - "label": "mapWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`map(array, fn)` returns a new array with all elements from `array`, each element transformed using the provided `fn`.\n\nSee [`Array.map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map) on MDN.\n\n## Examples\n\n```rescript\nlet array = [\"Hello\", \"Hi\", \"Good bye\"]\nlet mappedArray = array->Array.map(greeting => greeting ++ \" to you\")\n\nmappedArray == [\"Hello to you\", \"Hi to you\", \"Good bye to you\"]\n```\n" + }, "kind": 12, - "tags": [], + "label": "map", + "tags": [] + }, + { "detail": "(array<'a>, ('a, int) => 'b) => array<'b>", - "documentation": {"kind": "markdown", "value": "\n`mapWithIndex(array, fn)` returns a new array with all elements from `array`, each element transformed using the provided `fn`.\n\nSee [`Array.map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map) on MDN.\n\n## Examples\n\n```rescript\nlet array = [\"Hello\", \"Hi\", \"Good bye\"]\nlet mappedArray =\n array->Array.mapWithIndex((greeting, index) => greeting ++ \" at position \" ++ Int.toString(index))\n\nmappedArray == [\"Hello at position 0\", \"Hi at position 1\", \"Good bye at position 2\"]\n```\n"} - }] + "documentation": { + "kind": "markdown", + "value": "\n`mapWithIndex(array, fn)` returns a new array with all elements from `array`, each element transformed using the provided `fn`.\n\nSee [`Array.map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map) on MDN.\n\n## Examples\n\n```rescript\nlet array = [\"Hello\", \"Hi\", \"Good bye\"]\nlet mappedArray =\n array->Array.mapWithIndex((greeting, index) => greeting ++ \" at position \" ++ Int.toString(index))\n\nmappedArray == [\"Hello at position 0\", \"Hi at position 1\", \"Good bye at position 2\"]\n```\n" + }, + "kind": 12, + "label": "mapWithIndex", + "tags": [] + } +] Complete src/Completion.res 15:17 posCursor:[15:17] posNoWhite:[15:16] Found expr:[15:12->15:17] @@ -690,13 +1135,19 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Value[Dep, c] Path Dep.c -[{ - "label": "customDouble", - "kind": 12, - "tags": [1], +[ + { + "deprecated": true, "detail": "int => int", - "documentation": {"kind": "markdown", "value": "Deprecated: Use customDouble instead\n\nSome doc comment"} - }] + "documentation": { + "kind": "markdown", + "value": "Deprecated: Use customDouble instead\n\nSome doc comment" + }, + "kind": 12, + "label": "customDouble", + "tags": [ 1 ] + } +] Complete src/Completion.res 23:20 posCursor:[23:20] posNoWhite:[23:19] Found expr:[23:11->23:20] @@ -707,19 +1158,10 @@ Resolved opens 1 Stdlib ContextPath Value[Lib, foo] Path Lib.foo Found type for function (~age: int, ~name: string) => string -[{ - "label": "age", - "kind": 4, - "tags": [], - "detail": "int", - "documentation": null - }, { - "label": "name", - "kind": 4, - "tags": [], - "detail": "string", - "documentation": null - }] +[ + { "detail": "int", "kind": 4, "label": "age", "tags": [] }, + { "detail": "string", "kind": 4, "label": "name", "tags": [] } +] Complete src/Completion.res 26:13 posCursor:[26:13] posNoWhite:[26:12] Found expr:[26:3->26:13] @@ -731,19 +1173,28 @@ ContextPath array Path Stdlib.Array.m Path ArrayUtils.m Path m -[{ - "label": "Array.map", - "kind": 12, - "tags": [], +[ + { "detail": "(array<'a>, 'a => 'b) => array<'b>", - "documentation": {"kind": "markdown", "value": "\n`map(array, fn)` returns a new array with all elements from `array`, each element transformed using the provided `fn`.\n\nSee [`Array.map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map) on MDN.\n\n## Examples\n\n```rescript\nlet array = [\"Hello\", \"Hi\", \"Good bye\"]\nlet mappedArray = array->Array.map(greeting => greeting ++ \" to you\")\n\nmappedArray == [\"Hello to you\", \"Hi to you\", \"Good bye to you\"]\n```\n"} - }, { - "label": "Array.mapWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`map(array, fn)` returns a new array with all elements from `array`, each element transformed using the provided `fn`.\n\nSee [`Array.map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map) on MDN.\n\n## Examples\n\n```rescript\nlet array = [\"Hello\", \"Hi\", \"Good bye\"]\nlet mappedArray = array->Array.map(greeting => greeting ++ \" to you\")\n\nmappedArray == [\"Hello to you\", \"Hi to you\", \"Good bye to you\"]\n```\n" + }, "kind": 12, - "tags": [], + "label": "Array.map", + "tags": [] + }, + { "detail": "(array<'a>, ('a, int) => 'b) => array<'b>", - "documentation": {"kind": "markdown", "value": "\n`mapWithIndex(array, fn)` returns a new array with all elements from `array`, each element transformed using the provided `fn`.\n\nSee [`Array.map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map) on MDN.\n\n## Examples\n\n```rescript\nlet array = [\"Hello\", \"Hi\", \"Good bye\"]\nlet mappedArray =\n array->Array.mapWithIndex((greeting, index) => greeting ++ \" at position \" ++ Int.toString(index))\n\nmappedArray == [\"Hello at position 0\", \"Hi at position 1\", \"Good bye at position 2\"]\n```\n"} - }] + "documentation": { + "kind": "markdown", + "value": "\n`mapWithIndex(array, fn)` returns a new array with all elements from `array`, each element transformed using the provided `fn`.\n\nSee [`Array.map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map) on MDN.\n\n## Examples\n\n```rescript\nlet array = [\"Hello\", \"Hi\", \"Good bye\"]\nlet mappedArray =\n array->Array.mapWithIndex((greeting, index) => greeting ++ \" at position \" ++ Int.toString(index))\n\nmappedArray == [\"Hello at position 0\", \"Hi at position 1\", \"Good bye at position 2\"]\n```\n" + }, + "kind": 12, + "label": "Array.mapWithIndex", + "tags": [] + } +] Complete src/Completion.res 29:13 posCursor:[29:13] posNoWhite:[29:12] Found expr:[29:3->29:13] @@ -754,13 +1205,18 @@ ContextPath string->toU ContextPath string Path Stdlib.String.toU Path toU -[{ - "label": "String.toUpperCase", - "kind": 12, - "tags": [], +[ + { "detail": "string => string", - "documentation": {"kind": "markdown", "value": "\n`toUpperCase(str)` converts `str` to upper case using the locale-insensitive\ncase mappings in the Unicode Character Database. Notice that the conversion can\nexpand the number of letters in the result, for example the German ß\ncapitalizes to two Ses in a row.\nSee [`String.toUpperCase`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/toUpperCase) on MDN.\n\n## Examples\n\n```rescript\nString.toUpperCase(\"abc\") == \"ABC\"\nString.toUpperCase(`Straße`) == `STRASSE`\nString.toUpperCase(`πς`) == `ΠΣ`\n```\n"} - }] + "documentation": { + "kind": "markdown", + "value": "\n`toUpperCase(str)` converts `str` to upper case using the locale-insensitive\ncase mappings in the Unicode Character Database. Notice that the conversion can\nexpand the number of letters in the result, for example the German ß\ncapitalizes to two Ses in a row.\nSee [`String.toUpperCase`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/toUpperCase) on MDN.\n\n## Examples\n\n```rescript\nString.toUpperCase(\"abc\") == \"ABC\"\nString.toUpperCase(`Straße`) == `STRASSE`\nString.toUpperCase(`πς`) == `ΠΣ`\n```\n" + }, + "kind": 12, + "label": "String.toUpperCase", + "tags": [] + } +] Complete src/Completion.res 34:8 posCursor:[34:8] posNoWhite:[34:7] Found expr:[34:3->34:8] @@ -772,13 +1228,18 @@ ContextPath Value[op] Path op Path Stdlib.Option.e Path e -[{ - "label": "Option.equal", - "kind": 12, - "tags": [], +[ + { "detail": "(option<'a>, option<'b>, ('a, 'b) => bool) => bool", - "documentation": {"kind": "markdown", "value": "\n`equal(opt1, opt2, f)` evaluates two optional values for equality with respect to a predicate function `f`. If both `opt1` and `opt2` are `None`, returns `true`.\nIf one of the arguments is `Some(value)` and the other is `None`, returns\n`false`.\nIf arguments are `Some(value1)` and `Some(value2)`, returns the result of\n`f(value1, value2)`, the predicate function `f` must return a bool.\n\n## Examples\n\n```rescript\nlet clockEqual = (a, b) => mod(a, 12) == mod(b, 12)\n\nopen Option\n\nequal(Some(3), Some(15), clockEqual) // true\nequal(Some(3), None, clockEqual) // false\nequal(None, Some(3), clockEqual) // false\nequal(None, None, clockEqual) // true\n```\n"} - }] + "documentation": { + "kind": "markdown", + "value": "\n`equal(opt1, opt2, f)` evaluates two optional values for equality with respect to a predicate function `f`. If both `opt1` and `opt2` are `None`, returns `true`.\nIf one of the arguments is `Some(value)` and the other is `None`, returns\n`false`.\nIf arguments are `Some(value1)` and `Some(value2)`, returns the result of\n`f(value1, value2)`, the predicate function `f` must return a bool.\n\n## Examples\n\n```rescript\nlet clockEqual = (a, b) => mod(a, 12) == mod(b, 12)\n\nopen Option\n\nequal(Some(3), Some(15), clockEqual) // true\nequal(Some(3), None, clockEqual) // false\nequal(None, Some(3), clockEqual) // false\nequal(None, None, clockEqual) // true\n```\n" + }, + "kind": 12, + "label": "Option.equal", + "tags": [] + } +] Complete src/Completion.res 44:7 posCursor:[44:7] posNoWhite:[44:6] Found expr:[44:3->54:3] @@ -793,19 +1254,20 @@ Path fa CPPipe pathFromEnv:ForAuto found:true Path ForAuto. Path -[{ - "label": "ForAuto.abc", - "kind": 12, - "tags": [], +[ + { "detail": "(t, int) => t", - "documentation": null - }, { - "label": "ForAuto.abd", "kind": 12, - "tags": [], + "label": "ForAuto.abc", + "tags": [] + }, + { "detail": "(t, int) => t", - "documentation": null - }] + "kind": 12, + "label": "ForAuto.abd", + "tags": [] + } +] Complete src/Completion.res 47:21 XXX Not found! @@ -819,13 +1281,7 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath CJsxPropValue [O, Comp] second Path O.Comp.make -[{ - "label": "zzz", - "kind": 12, - "tags": [], - "detail": "int", - "documentation": null - }] +[ { "detail": "int", "kind": 12, "label": "zzz", "tags": [] } ] Complete src/Completion.res 62:23 posCursor:[62:23] posNoWhite:[62:22] Found expr:[62:14->62:23] @@ -834,34 +1290,37 @@ Completable: Cjsx([O, Comp], z, [z]) Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib Path O.Comp.make -[{ - "label": "zoo", - "kind": 4, - "tags": [], - "detail": "option", - "documentation": null - }] +[ { "detail": "option", "kind": 4, "label": "zoo", "tags": [] } ] Complete src/Completion.res 65:8 Attribute id:reac:[65:3->65:8] label:reac Completable: Cdecorator(reac) Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib -[{ - "label": "react.component", - "kind": 4, - "tags": [], +[ + { "detail": "", - "documentation": {"kind": "markdown", "value": "The `@react.component` decorator is used to annotate functions that are RescriptReact components.\n\nYou will need this decorator whenever you want to use a ReScript / React component in ReScript JSX expressions.\n\nNote: The `@react.component` decorator requires the `jsx` config to be set in your `rescript.json` to enable the required React transformations.\n\n[Read more and see examples in the documentation](https://rescript-lang.org/syntax-lookup#react-component-decorator)."}, - "insertTextFormat": 2 - }, { - "label": "react.componentWithProps", + "documentation": { + "kind": "markdown", + "value": "The `@react.component` decorator is used to annotate functions that are RescriptReact components.\n\nYou will need this decorator whenever you want to use a ReScript / React component in ReScript JSX expressions.\n\nNote: The `@react.component` decorator requires the `jsx` config to be set in your `rescript.json` to enable the required React transformations.\n\n[Read more and see examples in the documentation](https://rescript-lang.org/syntax-lookup#react-component-decorator)." + }, + "insertTextFormat": 2, "kind": 4, - "tags": [], + "label": "react.component", + "tags": [] + }, + { "detail": "", - "documentation": {"kind": "markdown", "value": "The `@react.componentWithProps` decorator is used to annotate functions that are RescriptReact components.\n\nYou will need this decorator whenever you want to use a ReScript / React component in ReScript JSX expressions.\n\nNote: The `@react.componentWithProps` decorator requires the `jsx` config to be set in your `rescript.json` to enable the required React transformations.\n\n[Read more and see examples in the documentation](https://rescript-lang.org/syntax-lookup#react-component-with-props-decorator)."}, - "insertTextFormat": 2 - }] + "documentation": { + "kind": "markdown", + "value": "The `@react.componentWithProps` decorator is used to annotate functions that are RescriptReact components.\n\nYou will need this decorator whenever you want to use a ReScript / React component in ReScript JSX expressions.\n\nNote: The `@react.componentWithProps` decorator requires the `jsx` config to be set in your `rescript.json` to enable the required React transformations.\n\n[Read more and see examples in the documentation](https://rescript-lang.org/syntax-lookup#react-component-with-props-decorator)." + }, + "insertTextFormat": 2, + "kind": 4, + "label": "react.componentWithProps", + "tags": [] + } +] Complete src/Completion.res 68:10 posCursor:[68:10] posNoWhite:[68:9] Found expr:[0:-1->86:1] @@ -870,21 +1329,30 @@ Attribute id:react.let:[68:3->80:3] label:react. Completable: Cdecorator(react.) Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib -[{ - "label": "component", - "kind": 4, - "tags": [], +[ + { "detail": "", - "documentation": {"kind": "markdown", "value": "The `@react.component` decorator is used to annotate functions that are RescriptReact components.\n\nYou will need this decorator whenever you want to use a ReScript / React component in ReScript JSX expressions.\n\nNote: The `@react.component` decorator requires the `jsx` config to be set in your `rescript.json` to enable the required React transformations.\n\n[Read more and see examples in the documentation](https://rescript-lang.org/syntax-lookup#react-component-decorator)."}, - "insertTextFormat": 2 - }, { - "label": "componentWithProps", + "documentation": { + "kind": "markdown", + "value": "The `@react.component` decorator is used to annotate functions that are RescriptReact components.\n\nYou will need this decorator whenever you want to use a ReScript / React component in ReScript JSX expressions.\n\nNote: The `@react.component` decorator requires the `jsx` config to be set in your `rescript.json` to enable the required React transformations.\n\n[Read more and see examples in the documentation](https://rescript-lang.org/syntax-lookup#react-component-decorator)." + }, + "insertTextFormat": 2, "kind": 4, - "tags": [], + "label": "component", + "tags": [] + }, + { "detail": "", - "documentation": {"kind": "markdown", "value": "The `@react.componentWithProps` decorator is used to annotate functions that are RescriptReact components.\n\nYou will need this decorator whenever you want to use a ReScript / React component in ReScript JSX expressions.\n\nNote: The `@react.componentWithProps` decorator requires the `jsx` config to be set in your `rescript.json` to enable the required React transformations.\n\n[Read more and see examples in the documentation](https://rescript-lang.org/syntax-lookup#react-component-with-props-decorator)."}, - "insertTextFormat": 2 - }] + "documentation": { + "kind": "markdown", + "value": "The `@react.componentWithProps` decorator is used to annotate functions that are RescriptReact components.\n\nYou will need this decorator whenever you want to use a ReScript / React component in ReScript JSX expressions.\n\nNote: The `@react.componentWithProps` decorator requires the `jsx` config to be set in your `rescript.json` to enable the required React transformations.\n\n[Read more and see examples in the documentation](https://rescript-lang.org/syntax-lookup#react-component-with-props-decorator)." + }, + "insertTextFormat": 2, + "kind": 4, + "label": "componentWithProps", + "tags": [] + } +] Complete src/Completion.res 71:27 posCursor:[71:27] posNoWhite:[71:26] Found expr:[71:11->71:27] @@ -895,13 +1363,7 @@ Resolved opens 1 Stdlib ContextPath Value[Lib, foo] Path Lib.foo Found type for function (~age: int, ~name: string) => string -[{ - "label": "age", - "kind": 4, - "tags": [], - "detail": "int", - "documentation": null - }] +[ { "detail": "int", "kind": 4, "label": "age", "tags": [] } ] Complete src/Completion.res 74:26 posCursor:[74:26] posNoWhite:[74:25] Found expr:[74:11->74:26] @@ -912,13 +1374,7 @@ Resolved opens 1 Stdlib ContextPath Value[Lib, foo] Path Lib.foo Found type for function (~age: int, ~name: string) => string -[{ - "label": "name", - "kind": 4, - "tags": [], - "detail": "string", - "documentation": null - }] +[ { "detail": "string", "kind": 4, "label": "name", "tags": [] } ] Complete src/Completion.res 77:32 posCursor:[77:32] posNoWhite:[77:31] Found expr:[77:11->77:32] @@ -929,13 +1385,7 @@ Resolved opens 1 Stdlib ContextPath Value[Lib, foo] Path Lib.foo Found type for function (~age: int, ~name: string) => string -[{ - "label": "name", - "kind": 4, - "tags": [], - "detail": "string", - "documentation": null - }] +[ { "detail": "string", "kind": 4, "label": "name", "tags": [] } ] Complete src/Completion.res 82:5 posCursor:[82:5] posNoWhite:[82:4] Found expr:[80:8->86:1] @@ -957,13 +1407,7 @@ Resolved opens 1 Stdlib ContextPath Value[someObj]["a"] ContextPath Value[someObj] Path someObj -[{ - "label": "age", - "kind": 4, - "tags": [], - "detail": "int", - "documentation": null - }] +[ { "detail": "int", "kind": 4, "label": "age", "tags": [] } ] Complete src/Completion.res 95:24 posCursor:[95:24] posNoWhite:[95:23] Found expr:[95:3->99:6] @@ -976,19 +1420,10 @@ ContextPath Value[nestedObj]["x"]["y"] ContextPath Value[nestedObj]["x"] ContextPath Value[nestedObj] Path nestedObj -[{ - "label": "age", - "kind": 4, - "tags": [], - "detail": "int", - "documentation": null - }, { - "label": "name", - "kind": 4, - "tags": [], - "detail": "string", - "documentation": null - }] +[ + { "detail": "int", "kind": 4, "label": "age", "tags": [] }, + { "detail": "string", "kind": 4, "label": "name", "tags": [] } +] Complete src/Completion.res 99:7 posCursor:[99:7] posNoWhite:[99:6] Found expr:[99:3->102:20] @@ -999,13 +1434,7 @@ Resolved opens 1 Stdlib ContextPath Value[o]["a"] ContextPath Value[o] Path o -[{ - "label": "age", - "kind": 4, - "tags": [], - "detail": "int", - "documentation": null - }] +[ { "detail": "int", "kind": 4, "label": "age", "tags": [] } ] Complete src/Completion.res 104:17 posCursor:[104:17] posNoWhite:[104:16] Found expr:[104:3->125:19] @@ -1018,19 +1447,10 @@ ContextPath Value[no]["x"]["y"] ContextPath Value[no]["x"] ContextPath Value[no] Path no -[{ - "label": "name", - "kind": 4, - "tags": [], - "detail": "string", - "documentation": null - }, { - "label": "age", - "kind": 4, - "tags": [], - "detail": "int", - "documentation": null - }] +[ + { "detail": "string", "kind": 4, "label": "name", "tags": [] }, + { "detail": "int", "kind": 4, "label": "age", "tags": [] } +] Complete src/Completion.res 110:5 posCursor:[110:5] posNoWhite:[110:4] Found expr:[110:3->110:5] @@ -1047,19 +1467,28 @@ Path r CPPipe pathFromEnv: found:true Path Completion. Path -[{ - "label": "x", - "kind": 5, - "tags": [], +[ + { "detail": "int", - "documentation": {"kind": "markdown", "value": "```rescript\nx: int\n```\n\n```rescript\ntype r = {x: int, y: string}\n```"} - }, { - "label": "y", + "documentation": { + "kind": "markdown", + "value": "```rescript\nx: int\n```\n\n```rescript\ntype r = {x: int, y: string}\n```" + }, "kind": 5, - "tags": [], + "label": "x", + "tags": [] + }, + { "detail": "string", - "documentation": {"kind": "markdown", "value": "```rescript\ny: string\n```\n\n```rescript\ntype r = {x: int, y: string}\n```"} - }] + "documentation": { + "kind": "markdown", + "value": "```rescript\ny: string\n```\n\n```rescript\ntype r = {x: int, y: string}\n```" + }, + "kind": 5, + "label": "y", + "tags": [] + } +] Complete src/Completion.res 113:25 posCursor:[113:25] posNoWhite:[113:24] Found expr:[113:3->113:25] @@ -1076,19 +1505,28 @@ Path Objects.Rec.recordVal CPPipe pathFromEnv:Rec found:true Path Objects.Rec. Path -[{ - "label": "xx", - "kind": 5, - "tags": [], +[ + { "detail": "int", - "documentation": {"kind": "markdown", "value": "```rescript\nxx: int\n```\n\n```rescript\ntype recordt = {xx: int, ss: string}\n```"} - }, { - "label": "ss", + "documentation": { + "kind": "markdown", + "value": "```rescript\nxx: int\n```\n\n```rescript\ntype recordt = {xx: int, ss: string}\n```" + }, "kind": 5, - "tags": [], + "label": "xx", + "tags": [] + }, + { "detail": "string", - "documentation": {"kind": "markdown", "value": "```rescript\nss: string\n```\n\n```rescript\ntype recordt = {xx: int, ss: string}\n```"} - }] + "documentation": { + "kind": "markdown", + "value": "```rescript\nss: string\n```\n\n```rescript\ntype recordt = {xx: int, ss: string}\n```" + }, + "kind": 5, + "label": "ss", + "tags": [] + } +] Complete src/Completion.res 120:7 posCursor:[120:7] posNoWhite:[120:6] Found expr:[119:11->123:1] @@ -1100,13 +1538,14 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Value[my] Path my -[{ - "label": "myAmazingFunction", - "kind": 12, - "tags": [], +[ + { "detail": "(int, int) => int", - "documentation": null - }] + "kind": 12, + "label": "myAmazingFunction", + "tags": [] + } +] Complete src/Completion.res 125:19 posCursor:[125:19] posNoWhite:[125:18] Found expr:[125:3->145:32] @@ -1117,19 +1556,10 @@ Resolved opens 1 Stdlib ContextPath Value[Objects, object][""] ContextPath Value[Objects, object] Path Objects.object -[{ - "label": "name", - "kind": 4, - "tags": [], - "detail": "string", - "documentation": null - }, { - "label": "age", - "kind": 4, - "tags": [], - "detail": "int", - "documentation": null - }] +[ + { "detail": "string", "kind": 4, "label": "name", "tags": [] }, + { "detail": "int", "kind": 4, "label": "age", "tags": [] } +] Complete src/Completion.res 151:6 posCursor:[151:6] posNoWhite:[151:5] Found expr:[151:3->151:6] @@ -1165,19 +1595,28 @@ Path aa CPPipe pathFromEnv: found:true Path Completion. Path -[{ - "label": "x", - "kind": 5, - "tags": [], +[ + { "detail": "int", - "documentation": {"kind": "markdown", "value": "```rescript\nx: int\n```\n\n```rescript\ntype aa = {x: int, name: string}\n```"} - }, { - "label": "name", + "documentation": { + "kind": "markdown", + "value": "```rescript\nx: int\n```\n\n```rescript\ntype aa = {x: int, name: string}\n```" + }, "kind": 5, - "tags": [], + "label": "x", + "tags": [] + }, + { "detail": "string", - "documentation": {"kind": "markdown", "value": "```rescript\nname: string\n```\n\n```rescript\ntype aa = {x: int, name: string}\n```"} - }] + "documentation": { + "kind": "markdown", + "value": "```rescript\nname: string\n```\n\n```rescript\ntype aa = {x: int, name: string}\n```" + }, + "kind": 5, + "label": "name", + "tags": [] + } +] Complete src/Completion.res 159:9 posCursor:[159:9] posNoWhite:[159:8] Found expr:[159:3->159:9] @@ -1208,13 +1647,18 @@ Path aa CPPipe pathFromEnv: found:true Path Completion.n Path n -[{ - "label": "name", - "kind": 5, - "tags": [], +[ + { "detail": "string", - "documentation": {"kind": "markdown", "value": "```rescript\nname: string\n```\n\n```rescript\ntype aa = {x: int, name: string}\n```"} - }] + "documentation": { + "kind": "markdown", + "value": "```rescript\nname: string\n```\n\n```rescript\ntype aa = {x: int, name: string}\n```" + }, + "kind": 5, + "label": "name", + "tags": [] + } +] Complete src/Completion.res 162:6 posCursor:[162:6] posNoWhite:[162:5] Found expr:[162:3->162:6] @@ -1224,13 +1668,7 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Value[Lis] Path Lis -[{ - "label": "List", - "kind": 9, - "tags": [], - "detail": "module List", - "documentation": null - }] +[ { "detail": "module List", "kind": 9, "label": "List", "tags": [] } ] Complete src/Completion.res 169:16 posCursor:[169:16] posNoWhite:[169:15] Found expr:[169:3->169:16] @@ -1240,13 +1678,14 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Module[WithChildren] Path WithChildren -[{ - "label": "WithChildren", - "kind": 9, - "tags": [], +[ + { "detail": "module WithChildren", - "documentation": null - }] + "kind": 9, + "label": "WithChildren", + "tags": [] + } +] Complete src/Completion.res 172:17 posCursor:[172:17] posNoWhite:[172:16] Found type:[172:12->172:17] @@ -1256,13 +1695,18 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Type[Null, ""] Path Null. -[{ - "label": "t", - "kind": 22, - "tags": [], +[ + { "detail": "type t", - "documentation": {"kind": "markdown", "value": "\nA type representing a value that can be either `'a` or `null`.\n\n\n```rescript\n@unboxed\ntype t<'a> = Primitive_js_extern.null<'a> =\n | Value('a)\n | @as(null) Null\n```"} - }] + "documentation": { + "kind": "markdown", + "value": "\nA type representing a value that can be either `'a` or `null`.\n\n\n```rescript\n@unboxed\ntype t<'a> = Primitive_js_extern.null<'a> =\n | Value('a)\n | @as(null) Null\n```" + }, + "kind": 22, + "label": "t", + "tags": [] + } +] Complete src/Completion.res 174:20 posCursor:[174:20] posNoWhite:[174:19] Found type:[174:12->174:20] @@ -1272,13 +1716,18 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Type[ForAuto, ""] Path ForAuto. -[{ - "label": "t", - "kind": 22, - "tags": [], +[ + { "detail": "type t", - "documentation": {"kind": "markdown", "value": "```rescript\ntype t = int\n```"} - }] + "documentation": { + "kind": "markdown", + "value": "```rescript\ntype t = int\n```" + }, + "kind": 22, + "label": "t", + "tags": [] + } +] Complete src/Completion.res 179:13 posCursor:[179:13] posNoWhite:[179:12] Found expr:[179:11->179:13] @@ -1288,37 +1737,42 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Value[As] Path As -[{ - "label": "Asterix", - "kind": 4, - "tags": [], +[ + { "detail": "Asterix", - "documentation": {"kind": "markdown", "value": "```rescript\nAsterix\n```\n\n```rescript\ntype z = Allo | Asterix | Baba\n```"} - }, { - "label": "AsyncIterable", - "kind": 9, - "tags": [], + "documentation": { + "kind": "markdown", + "value": "```rescript\nAsterix\n```\n\n```rescript\ntype z = Allo | Asterix | Baba\n```" + }, + "kind": 4, + "label": "Asterix", + "tags": [] + }, + { "detail": "module AsyncIterable", - "documentation": null - }, { - "label": "AsyncIterator", "kind": 9, - "tags": [], + "label": "AsyncIterable", + "tags": [] + }, + { "detail": "module AsyncIterator", - "documentation": null - }, { - "label": "AsyncGenerator", "kind": 9, - "tags": [], + "label": "AsyncIterator", + "tags": [] + }, + { "detail": "module AsyncGenerator", - "documentation": null - }, { - "label": "AsyncIterableIterator", "kind": 9, - "tags": [], + "label": "AsyncGenerator", + "tags": [] + }, + { "detail": "module AsyncIterableIterator", - "documentation": null - }] + "kind": 9, + "label": "AsyncIterableIterator", + "tags": [] + } +] Complete src/Completion.res 182:17 Pmod_ident For:[182:14->182:17] @@ -1327,13 +1781,7 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Module[For] Path For -[{ - "label": "ForAuto", - "kind": 9, - "tags": [], - "detail": "module ForAuto", - "documentation": null - }] +[ { "detail": "module ForAuto", "kind": 9, "label": "ForAuto", "tags": [] } ] Complete src/Completion.res 190:11 posCursor:[190:11] posNoWhite:[190:10] Found expr:[190:3->190:11] @@ -1343,13 +1791,7 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Value[Private, ""] Path Private. -[{ - "label": "b", - "kind": 12, - "tags": [], - "detail": "int", - "documentation": null - }] +[ { "detail": "int", "kind": 12, "label": "b", "tags": [] } ] Complete src/Completion.res 202:6 posCursor:[202:6] posNoWhite:[202:5] Found expr:[202:3->202:6] @@ -1370,13 +1812,7 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 2 Stdlib Completion ContextPath Value[sha] Path sha -[{ - "label": "shadowed", - "kind": 12, - "tags": [], - "detail": "int", - "documentation": null - }] +[ { "detail": "int", "kind": 12, "label": "shadowed", "tags": [] } ] Complete src/Completion.res 208:6 posCursor:[208:6] posNoWhite:[208:5] Found expr:[208:3->208:6] @@ -1387,13 +1823,7 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 3 Stdlib Completion Completion ContextPath Value[sha] Path sha -[{ - "label": "shadowed", - "kind": 12, - "tags": [], - "detail": "string", - "documentation": null - }] +[ { "detail": "string", "kind": 12, "label": "shadowed", "tags": [] } ] Complete src/Completion.res 221:22 posCursor:[221:22] posNoWhite:[221:21] Found expr:[221:3->224:22] @@ -1405,19 +1835,15 @@ Resolved opens 3 Stdlib Completion Completion ContextPath Value[FAO, forAutoObject][""] ContextPath Value[FAO, forAutoObject] Path FAO.forAutoObject -[{ - "label": "age", +[ + { "detail": "int", "kind": 4, "label": "age", "tags": [] }, + { + "detail": "FAR.forAutoRecord", "kind": 4, - "tags": [], - "detail": "int", - "documentation": null - }, { "label": "forAutoLabel", - "kind": 4, - "tags": [], - "detail": "FAR.forAutoRecord", - "documentation": null - }] + "tags": [] + } +] Complete src/Completion.res 224:37 posCursor:[224:37] posNoWhite:[224:36] Found expr:[224:3->224:37] @@ -1437,19 +1863,28 @@ Path FAO.forAutoObject CPPipe pathFromEnv:FAR found:true Path FAR. Path -[{ - "label": "forAuto", - "kind": 5, - "tags": [], +[ + { "detail": "ForAuto.t", - "documentation": {"kind": "markdown", "value": "```rescript\nforAuto: ForAuto.t\n```\n\n```rescript\ntype forAutoRecord = {\n forAuto: ForAuto.t,\n something: option,\n}\n```"} - }, { - "label": "something", + "documentation": { + "kind": "markdown", + "value": "```rescript\nforAuto: ForAuto.t\n```\n\n```rescript\ntype forAutoRecord = {\n forAuto: ForAuto.t,\n something: option,\n}\n```" + }, "kind": 5, - "tags": [], + "label": "forAuto", + "tags": [] + }, + { "detail": "option", - "documentation": {"kind": "markdown", "value": "```rescript\nsomething: option\n```\n\n```rescript\ntype forAutoRecord = {\n forAuto: ForAuto.t,\n something: option,\n}\n```"} - }] + "documentation": { + "kind": "markdown", + "value": "```rescript\nsomething: option\n```\n\n```rescript\ntype forAutoRecord = {\n forAuto: ForAuto.t,\n something: option,\n}\n```" + }, + "kind": 5, + "label": "something", + "tags": [] + } +] Complete src/Completion.res 227:46 posCursor:[227:46] posNoWhite:[227:45] Found expr:[227:3->0:-1] @@ -1472,25 +1907,26 @@ Path forAuto CPPipe pathFromEnv:ForAuto found:false Path ForAuto. Path -[{ - "label": "ForAuto.abc", - "kind": 12, - "tags": [], +[ + { "detail": "(t, int) => t", - "documentation": null - }, { - "label": "ForAuto.abd", "kind": 12, - "tags": [], + "label": "ForAuto.abc", + "tags": [] + }, + { "detail": "(t, int) => t", - "documentation": null - }, { - "label": "myAmazingFunction", "kind": 12, - "tags": [], + "label": "ForAuto.abd", + "tags": [] + }, + { "detail": "(int, int) => int", - "documentation": null - }] + "kind": 12, + "label": "myAmazingFunction", + "tags": [] + } +] Complete src/Completion.res 230:55 posCursor:[230:55] posNoWhite:[230:54] Found expr:[230:3->230:55] @@ -1502,19 +1938,10 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 3 Stdlib Completion Completion ContextPath Value[ForAuto, a] Path ForAuto.a -[{ - "label": "abc", - "kind": 12, - "tags": [], - "detail": "(t, int) => t", - "documentation": null - }, { - "label": "abd", - "kind": 12, - "tags": [], - "detail": "(t, int) => t", - "documentation": null - }] +[ + { "detail": "(t, int) => t", "kind": 12, "label": "abc", "tags": [] }, + { "detail": "(t, int) => t", "kind": 12, "label": "abd", "tags": [] } +] Complete src/Completion.res 234:34 posCursor:[234:34] posNoWhite:[234:33] Found expr:[234:18->234:36] @@ -1529,13 +1956,7 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 3 Stdlib Completion Completion ContextPath Value[na] Path na -[{ - "label": "name", - "kind": 12, - "tags": [], - "detail": "string", - "documentation": null - }] +[ { "detail": "string", "kind": 12, "label": "name", "tags": [] } ] Complete src/Completion.res 237:17 posCursor:[237:17] posNoWhite:[237:14] Found expr:[237:14->237:22] @@ -1563,19 +1984,28 @@ Path _z CPPipe pathFromEnv: found:true Path Completion. Path -[{ - "label": "x", - "kind": 5, - "tags": [], +[ + { "detail": "int", - "documentation": {"kind": "markdown", "value": "```rescript\nx: int\n```\n\n```rescript\ntype r = {x: int, y: string}\n```"} - }, { - "label": "y", + "documentation": { + "kind": "markdown", + "value": "```rescript\nx: int\n```\n\n```rescript\ntype r = {x: int, y: string}\n```" + }, "kind": 5, - "tags": [], + "label": "x", + "tags": [] + }, + { "detail": "string", - "documentation": {"kind": "markdown", "value": "```rescript\ny: string\n```\n\n```rescript\ntype r = {x: int, y: string}\n```"} - }] + "documentation": { + "kind": "markdown", + "value": "```rescript\ny: string\n```\n\n```rescript\ntype r = {x: int, y: string}\n```" + }, + "kind": 5, + "label": "y", + "tags": [] + } +] Complete src/Completion.res 254:17 posCursor:[254:17] posNoWhite:[254:16] Found expr:[254:11->254:17] @@ -1586,13 +2016,14 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 3 Stdlib Completion Completion ContextPath Value[SomeLo] Path SomeLo -[{ - "label": "SomeLocalModule", - "kind": 9, - "tags": [], +[ + { "detail": "module SomeLocalModule", - "documentation": null - }] + "kind": 9, + "label": "SomeLocalModule", + "tags": [] + } +] Complete src/Completion.res 256:29 posCursor:[256:29] posNoWhite:[256:28] Found type:[256:13->256:29] @@ -1603,13 +2034,18 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 3 Stdlib Completion Completion ContextPath Type[SomeLocalModule, ""] Path SomeLocalModule. -[{ - "label": "zz", - "kind": 22, - "tags": [], +[ + { "detail": "type zz", - "documentation": {"kind": "markdown", "value": "```rescript\ntype zz = int\n```"} - }] + "documentation": { + "kind": "markdown", + "value": "```rescript\ntype zz = int\n```" + }, + "kind": 22, + "label": "zz", + "tags": [] + } +] Complete src/Completion.res 261:33 posCursor:[261:33] posNoWhite:[261:32] Found type:[261:17->263:11] @@ -1620,13 +2056,18 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 3 Stdlib Completion Completion ContextPath Type[SomeLocalModule, ""] Path SomeLocalModule. -[{ - "label": "zz", - "kind": 22, - "tags": [], +[ + { "detail": "type zz", - "documentation": {"kind": "markdown", "value": "```rescript\ntype zz = int\n```"} - }] + "documentation": { + "kind": "markdown", + "value": "```rescript\ntype zz = int\n```" + }, + "kind": 22, + "label": "zz", + "tags": [] + } +] Complete src/Completion.res 268:21 Ptype_variant unary SomeLocal:[268:12->268:21] @@ -1636,19 +2077,24 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 3 Stdlib Completion Completion ContextPath Value[SomeLocal] Path SomeLocal -[{ - "label": "SomeLocalVariantItem", - "kind": 4, - "tags": [], +[ + { "detail": "SomeLocalVariantItem", - "documentation": {"kind": "markdown", "value": "```rescript\nSomeLocalVariantItem\n```\n\n```rescript\ntype someLocalVariant = SomeLocalVariantItem\n```"} - }, { - "label": "SomeLocalModule", - "kind": 9, - "tags": [], + "documentation": { + "kind": "markdown", + "value": "```rescript\nSomeLocalVariantItem\n```\n\n```rescript\ntype someLocalVariant = SomeLocalVariantItem\n```" + }, + "kind": 4, + "label": "SomeLocalVariantItem", + "tags": [] + }, + { "detail": "module SomeLocalModule", - "documentation": null - }] + "kind": 9, + "label": "SomeLocalModule", + "tags": [] + } +] Complete src/Completion.res 271:20 posCursor:[271:20] posNoWhite:[271:19] Found pattern:[271:7->274:3] @@ -1660,13 +2106,14 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 3 Stdlib Completion Completion ContextPath Type[SomeLocal] Path SomeLocal -[{ - "label": "SomeLocalModule", - "kind": 9, - "tags": [], +[ + { "detail": "module SomeLocalModule", - "documentation": null - }] + "kind": 9, + "label": "SomeLocalModule", + "tags": [] + } +] Complete src/Completion.res 275:15 posCursor:[275:15] posNoWhite:[275:14] Found expr:[274:11->278:1] @@ -1679,13 +2126,7 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 3 Stdlib Completion Completion ContextPath Value[_w] Path _w -[{ - "label": "_world", - "kind": 12, - "tags": [], - "detail": "'a", - "documentation": null - }] +[ { "detail": "'a", "kind": 12, "label": "_world", "tags": [] } ] Complete src/Completion.res 281:22 posCursor:[281:22] posNoWhite:[281:21] Found type:[281:21->281:22] @@ -1696,19 +2137,28 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 3 Stdlib Completion Completion ContextPath Type[s] Path s -[{ - "label": "someType", - "kind": 22, - "tags": [], +[ + { "detail": "type someType", - "documentation": {"kind": "markdown", "value": "```rescript\ntype someType = {hello: string}\n```"} - }, { - "label": "someLocalVariant", + "documentation": { + "kind": "markdown", + "value": "```rescript\ntype someType = {hello: string}\n```" + }, "kind": 22, - "tags": [], + "label": "someType", + "tags": [] + }, + { "detail": "type someLocalVariant", - "documentation": {"kind": "markdown", "value": "```rescript\ntype someLocalVariant = SomeLocalVariantItem\n```"} - }] + "documentation": { + "kind": "markdown", + "value": "```rescript\ntype someLocalVariant = SomeLocalVariantItem\n```" + }, + "kind": 22, + "label": "someLocalVariant", + "tags": [] + } +] Complete src/Completion.res 291:30 posCursor:[291:30] posNoWhite:[291:29] Found expr:[291:11->291:32] @@ -1727,13 +2177,7 @@ CPPipe pathFromEnv: found:true Path Completion.someFun Path someFun Found type for function (~name: string) => unit -[{ - "label": "name", - "kind": 4, - "tags": [], - "detail": "string", - "documentation": null - }] +[ { "detail": "string", "kind": 4, "label": "name", "tags": [] } ] Complete src/Completion.res 296:11 posCursor:[296:11] posNoWhite:[296:10] Found expr:[296:3->296:11] @@ -1753,19 +2197,28 @@ Path retAA CPPipe pathFromEnv: found:true Path Completion. Path -[{ - "label": "x", - "kind": 5, - "tags": [], +[ + { "detail": "int", - "documentation": {"kind": "markdown", "value": "```rescript\nx: int\n```\n\n```rescript\ntype aa = {x: int, name: string}\n```"} - }, { - "label": "name", + "documentation": { + "kind": "markdown", + "value": "```rescript\nx: int\n```\n\n```rescript\ntype aa = {x: int, name: string}\n```" + }, "kind": 5, - "tags": [], + "label": "x", + "tags": [] + }, + { "detail": "string", - "documentation": {"kind": "markdown", "value": "```rescript\nname: string\n```\n\n```rescript\ntype aa = {x: int, name: string}\n```"} - }] + "documentation": { + "kind": "markdown", + "value": "```rescript\nname: string\n```\n\n```rescript\ntype aa = {x: int, name: string}\n```" + }, + "kind": 5, + "label": "name", + "tags": [] + } +] Complete src/Completion.res 301:13 posCursor:[301:13] posNoWhite:[301:12] Found expr:[301:3->301:13] @@ -1781,35 +2234,16 @@ Found type for function ( ~opt1: int=?, ~a: int, ~b: int, - unit, - ~opt2: int=?, - unit, -) => int -[{ - "label": "opt1", - "kind": 4, - "tags": [], - "detail": "option", - "documentation": null - }, { - "label": "a", - "kind": 4, - "tags": [], - "detail": "int", - "documentation": null - }, { - "label": "b", - "kind": 4, - "tags": [], - "detail": "int", - "documentation": null - }, { - "label": "opt2", - "kind": 4, - "tags": [], - "detail": "option", - "documentation": null - }] + unit, + ~opt2: int=?, + unit, +) => int +[ + { "detail": "option", "kind": 4, "label": "opt1", "tags": [] }, + { "detail": "int", "kind": 4, "label": "a", "tags": [] }, + { "detail": "int", "kind": 4, "label": "b", "tags": [] }, + { "detail": "option", "kind": 4, "label": "opt2", "tags": [] } +] Complete src/Completion.res 304:15 posCursor:[304:15] posNoWhite:[304:14] Found expr:[304:3->304:15] @@ -1823,25 +2257,11 @@ ContextPath Value[ff](~c) ContextPath Value[ff] Path ff Found type for function (~a: int, ~b: int, ~opt2: int=?, unit) => int -[{ - "label": "a", - "kind": 4, - "tags": [], - "detail": "int", - "documentation": null - }, { - "label": "b", - "kind": 4, - "tags": [], - "detail": "int", - "documentation": null - }, { - "label": "opt2", - "kind": 4, - "tags": [], - "detail": "option", - "documentation": null - }] +[ + { "detail": "int", "kind": 4, "label": "a", "tags": [] }, + { "detail": "int", "kind": 4, "label": "b", "tags": [] }, + { "detail": "option", "kind": 4, "label": "opt2", "tags": [] } +] Complete src/Completion.res 307:17 posCursor:[307:17] posNoWhite:[307:16] Found expr:[307:3->307:17] @@ -1854,25 +2274,11 @@ ContextPath Value[ff](~c, Nolabel) ContextPath Value[ff] Path ff Found type for function (~a: int, ~b: int, ~opt2: int=?, unit) => int -[{ - "label": "a", - "kind": 4, - "tags": [], - "detail": "int", - "documentation": null - }, { - "label": "b", - "kind": 4, - "tags": [], - "detail": "int", - "documentation": null - }, { - "label": "opt2", - "kind": 4, - "tags": [], - "detail": "option", - "documentation": null - }] +[ + { "detail": "int", "kind": 4, "label": "a", "tags": [] }, + { "detail": "int", "kind": 4, "label": "b", "tags": [] }, + { "detail": "option", "kind": 4, "label": "opt2", "tags": [] } +] Complete src/Completion.res 310:21 posCursor:[310:21] posNoWhite:[310:20] Found expr:[310:3->310:21] @@ -1885,19 +2291,10 @@ ContextPath Value[ff](~c, Nolabel, Nolabel) ContextPath Value[ff] Path ff Found type for function (~a: int, ~b: int) => int -[{ - "label": "a", - "kind": 4, - "tags": [], - "detail": "int", - "documentation": null - }, { - "label": "b", - "kind": 4, - "tags": [], - "detail": "int", - "documentation": null - }] +[ + { "detail": "int", "kind": 4, "label": "a", "tags": [] }, + { "detail": "int", "kind": 4, "label": "b", "tags": [] } +] Complete src/Completion.res 313:23 posCursor:[313:23] posNoWhite:[313:22] Found expr:[313:3->313:23] @@ -1910,19 +2307,10 @@ ContextPath Value[ff](~c, Nolabel, ~b) ContextPath Value[ff] Path ff Found type for function (~a: int, ~opt2: int=?, unit) => int -[{ - "label": "a", - "kind": 4, - "tags": [], - "detail": "int", - "documentation": null - }, { - "label": "opt2", - "kind": 4, - "tags": [], - "detail": "option", - "documentation": null - }] +[ + { "detail": "int", "kind": 4, "label": "a", "tags": [] }, + { "detail": "option", "kind": 4, "label": "opt2", "tags": [] } +] Complete src/Completion.res 316:16 posCursor:[316:16] posNoWhite:[316:15] Found expr:[316:3->316:16] @@ -1935,31 +2323,12 @@ ContextPath Value[ff](~opt2) ContextPath Value[ff] Path ff Found type for function (~opt1: int=?, ~a: int, ~b: int, unit, unit, ~c: int) => int -[{ - "label": "opt1", - "kind": 4, - "tags": [], - "detail": "option", - "documentation": null - }, { - "label": "a", - "kind": 4, - "tags": [], - "detail": "int", - "documentation": null - }, { - "label": "b", - "kind": 4, - "tags": [], - "detail": "int", - "documentation": null - }, { - "label": "c", - "kind": 4, - "tags": [], - "detail": "int", - "documentation": null - }] +[ + { "detail": "option", "kind": 4, "label": "opt1", "tags": [] }, + { "detail": "int", "kind": 4, "label": "a", "tags": [] }, + { "detail": "int", "kind": 4, "label": "b", "tags": [] }, + { "detail": "int", "kind": 4, "label": "c", "tags": [] } +] Complete src/Completion.res 326:17 posCursor:[326:17] posNoWhite:[326:16] Found expr:[326:3->326:17] @@ -1971,19 +2340,10 @@ Resolved opens 3 Stdlib Completion Completion ContextPath Value[withCallback] Path withCallback Found type for function (~b: int) => callback -[{ - "label": "b", - "kind": 4, - "tags": [], - "detail": "int", - "documentation": null - }, { - "label": "a", - "kind": 4, - "tags": [], - "detail": "int", - "documentation": null - }] +[ + { "detail": "int", "kind": 4, "label": "b", "tags": [] }, + { "detail": "int", "kind": 4, "label": "a", "tags": [] } +] Complete src/Completion.res 329:21 posCursor:[329:21] posNoWhite:[329:20] Found expr:[329:3->329:21] @@ -1996,19 +2356,10 @@ ContextPath Value[withCallback](~a) ContextPath Value[withCallback] Path withCallback Found type for function (~b: int) => callback -[{ - "label": "b", - "kind": 4, - "tags": [], - "detail": "int", - "documentation": null - }, { - "label": "a", - "kind": 4, - "tags": [], - "detail": "int", - "documentation": null - }] +[ + { "detail": "int", "kind": 4, "label": "b", "tags": [] }, + { "detail": "int", "kind": 4, "label": "a", "tags": [] } +] Complete src/Completion.res 332:21 posCursor:[332:21] posNoWhite:[332:20] Found expr:[332:3->332:21] @@ -2021,13 +2372,7 @@ ContextPath Value[withCallback](~b) ContextPath Value[withCallback] Path withCallback Found type for function callback -[{ - "label": "a", - "kind": 4, - "tags": [], - "detail": "int", - "documentation": null - }] +[ { "detail": "int", "kind": 4, "label": "a", "tags": [] } ] Complete src/Completion.res 339:26 posCursor:[339:26] posNoWhite:[339:25] Found expr:[336:2->349:23] @@ -2048,63 +2393,59 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 3 Stdlib Completion Completion ContextPath Type[Res] Path Res -[{ - "label": "Result", - "kind": 9, - "tags": [], - "detail": "module Result", - "documentation": null - }, { - "label": "RescriptReactErrorBoundary", - "kind": 9, - "tags": [], - "detail": "module RescriptReactErrorBoundary", - "documentation": null, +[ + { "detail": "module Result", "kind": 9, "label": "Result", "tags": [] }, + { "data": { "modulePath": "RescriptReactErrorBoundary", "filePath": "src/Completion.res" - } - }, { - "label": "RescriptReactRouter", + }, + "detail": "module RescriptReactErrorBoundary", "kind": 9, - "tags": [], - "detail": "module RescriptReactRouter", - "documentation": null, + "label": "RescriptReactErrorBoundary", + "tags": [] + }, + { "data": { "modulePath": "RescriptReactRouter", "filePath": "src/Completion.res" - } - }, { - "label": "RescriptTools", + }, + "detail": "module RescriptReactRouter", "kind": 9, - "tags": [], - "detail": "module RescriptTools", - "documentation": null, + "label": "RescriptReactRouter", + "tags": [] + }, + { "data": { "modulePath": "RescriptTools", "filePath": "src/Completion.res" - } - }, { - "label": "RescriptTools_Docgen", + }, + "detail": "module RescriptTools", "kind": 9, - "tags": [], - "detail": "module RescriptTools_Docgen", - "documentation": null, + "label": "RescriptTools", + "tags": [] + }, + { "data": { "modulePath": "RescriptTools_Docgen", "filePath": "src/Completion.res" - } - }, { - "label": "RescriptTools_ExtractCodeBlocks", + }, + "detail": "module RescriptTools_Docgen", "kind": 9, - "tags": [], - "detail": "module RescriptTools_ExtractCodeBlocks", - "documentation": null, + "label": "RescriptTools_Docgen", + "tags": [] + }, + { "data": { "modulePath": "RescriptTools_ExtractCodeBlocks", "filePath": "src/Completion.res" - } - }] + }, + "detail": "module RescriptTools_ExtractCodeBlocks", + "kind": 9, + "label": "RescriptTools_ExtractCodeBlocks", + "tags": [] + } +] Complete src/Completion.res 346:57 posCursor:[346:57] posNoWhite:[346:56] Found expr:[346:53->349:23] @@ -2116,16 +2457,22 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 3 Stdlib Completion Completion ContextPath Value[this] Path this -[{ - "label": "thisIsNotSaved", - "kind": 12, - "tags": [], +[ + { "detail": "\\\"Type Not Known\"", - "documentation": null - }] + "kind": 12, + "label": "thisIsNotSaved", + "tags": [] + } +] Hover src/Completion.res 349:14 -{"contents": {"kind": "markdown", "value": "```rescript\nJsxDOM.domProps\n```\n\n---\n\n```\n \n```\n```rescript\ntype JsxDOM.domProps = {\n key?: string,\n children?: Jsx.element,\n ref?: domRef,\n allow?: string,\n ariaCurrent?: [\n | #date\n | #\"false\"\n | #location\n | #page\n | #step\n | #time\n | #\"true\"\n ],\n ariaDetails?: string,\n ariaDisabled?: bool,\n ariaHidden?: bool,\n ariaInvalid?: [#\"false\" | #grammar | #spelling | #\"true\"],\n ariaKeyshortcuts?: string,\n ariaLabel?: string,\n ariaRoledescription?: string,\n ariaAutocomplete?: [#both | #inline | #list | #none],\n ariaChecked?: [#\"false\" | #mixed | #\"true\"],\n ariaExpanded?: bool,\n ariaHaspopup?: [\n | #dialog\n | #\"false\"\n | #grid\n | #listbox\n | #menu\n | #tree\n | #\"true\"\n ],\n ariaLevel?: int,\n ariaModal?: bool,\n ariaMultiline?: bool,\n ariaMultiselectable?: bool,\n ariaOrientation?: [#horizontal | #undefined | #vertical],\n ariaPlaceholder?: string,\n ariaPressed?: [#\"false\" | #mixed | #\"true\"],\n ariaReadonly?: bool,\n ariaRequired?: bool,\n ariaSelected?: bool,\n ariaSort?: string,\n ariaValuemax?: float,\n ariaValuemin?: float,\n ariaValuenow?: float,\n ariaValuetext?: string,\n ariaAtomic?: bool,\n ariaBusy?: bool,\n ariaLive?: [#assertive | #off | #polite | #rude],\n ariaRelevant?: string,\n ariaDropeffect?: [\n | #copy\n | #execute\n | #link\n | #move\n | #none\n | #popup\n ],\n ariaGrabbed?: bool,\n ariaActivedescendant?: string,\n ariaColcount?: int,\n ariaColindex?: int,\n ariaColspan?: int,\n ariaControls?: string,\n ariaDescribedby?: string,\n ariaErrormessage?: string,\n ariaFlowto?: string,\n ariaLabelledby?: string,\n ariaOwns?: string,\n ariaPosinset?: int,\n ariaRowcount?: int,\n ariaRowindex?: int,\n ariaRowspan?: int,\n ariaSetsize?: int,\n defaultChecked?: bool,\n defaultValue?: string,\n accessKey?: string,\n capture?: [#environment | #user],\n className?: string,\n contentEditable?: bool,\n contextMenu?: string,\n dataTestId?: string,\n dir?: string,\n draggable?: bool,\n hidden?: bool,\n id?: string,\n inert?: bool,\n lang?: string,\n popover?: popover,\n popoverTarget?: string,\n popoverTargetAction?: popoverTargetAction,\n role?: string,\n style?: style,\n spellCheck?: bool,\n tabIndex?: int,\n title?: string,\n itemID?: string,\n itemProp?: string,\n itemRef?: string,\n itemScope?: bool,\n itemType?: string,\n accept?: string,\n acceptCharset?: string,\n action?: string,\n allowFullScreen?: bool,\n alt?: string,\n as_?: string,\n async?: bool,\n autoComplete?: string,\n autoCapitalize?: string,\n autoFocus?: bool,\n autoPlay?: bool,\n challenge?: string,\n charSet?: string,\n checked?: bool,\n cite?: string,\n crossOrigin?: string,\n cols?: int,\n colSpan?: int,\n content?: string,\n controls?: bool,\n coords?: string,\n data?: string,\n dateTime?: string,\n default?: bool,\n defer?: bool,\n disabled?: bool,\n download?: string,\n encType?: string,\n form?: string,\n formAction?: string,\n formTarget?: string,\n formMethod?: string,\n frameBorder?: int,\n headers?: string,\n height?: string,\n high?: int,\n href?: string,\n hrefLang?: string,\n htmlFor?: string,\n httpEquiv?: string,\n icon?: string,\n inputMode?: string,\n integrity?: string,\n keyType?: string,\n kind?: string,\n label?: string,\n list?: string,\n loading?: [#eager | #lazy],\n loop?: bool,\n low?: int,\n manifest?: string,\n max?: string,\n maxLength?: int,\n media?: string,\n mediaGroup?: string,\n method?: string,\n min?: string,\n minLength?: int,\n multiple?: bool,\n muted?: bool,\n name?: string,\n nonce?: string,\n noValidate?: bool,\n open_?: bool,\n optimum?: int,\n pattern?: string,\n placeholder?: string,\n playsInline?: bool,\n poster?: string,\n preload?: string,\n radioGroup?: string,\n readOnly?: bool,\n rel?: string,\n required?: bool,\n reversed?: bool,\n rows?: int,\n rowSpan?: int,\n sandbox?: string,\n scope?: string,\n scoped?: bool,\n scrolling?: string,\n selected?: bool,\n shape?: string,\n size?: int,\n sizes?: string,\n span?: int,\n src?: string,\n srcDoc?: string,\n srcLang?: string,\n srcSet?: string,\n start?: int,\n step?: float,\n summary?: string,\n target?: string,\n type_?: string,\n useMap?: string,\n value?: string,\n width?: string,\n wrap?: string,\n onCopy?: JsxEvent.Clipboard.t => unit,\n onCut?: JsxEvent.Clipboard.t => unit,\n onPaste?: JsxEvent.Clipboard.t => unit,\n onCompositionEnd?: JsxEvent.Composition.t => unit,\n onCompositionStart?: JsxEvent.Composition.t => unit,\n onCompositionUpdate?: JsxEvent.Composition.t => unit,\n onKeyDown?: JsxEvent.Keyboard.t => unit,\n onKeyPress?: JsxEvent.Keyboard.t => unit,\n onKeyUp?: JsxEvent.Keyboard.t => unit,\n onFocus?: JsxEvent.Focus.t => unit,\n onBlur?: JsxEvent.Focus.t => unit,\n onBeforeInput?: JsxEvent.Form.t => unit,\n onChange?: JsxEvent.Form.t => unit,\n onInput?: JsxEvent.Form.t => unit,\n onReset?: JsxEvent.Form.t => unit,\n onSubmit?: JsxEvent.Form.t => unit,\n onInvalid?: JsxEvent.Form.t => unit,\n onClick?: JsxEvent.Mouse.t => unit,\n onContextMenu?: JsxEvent.Mouse.t => unit,\n onDoubleClick?: JsxEvent.Mouse.t => unit,\n onDrag?: JsxEvent.Mouse.t => unit,\n onDragEnd?: JsxEvent.Mouse.t => unit,\n onDragEnter?: JsxEvent.Mouse.t => unit,\n onDragExit?: JsxEvent.Mouse.t => unit,\n onDragLeave?: JsxEvent.Mouse.t => unit,\n onDragOver?: JsxEvent.Mouse.t => unit,\n onDragStart?: JsxEvent.Mouse.t => unit,\n onDrop?: JsxEvent.Mouse.t => unit,\n onMouseDown?: JsxEvent.Mouse.t => unit,\n onMouseEnter?: JsxEvent.Mouse.t => unit,\n onMouseLeave?: JsxEvent.Mouse.t => unit,\n onMouseMove?: JsxEvent.Mouse.t => unit,\n onMouseOut?: JsxEvent.Mouse.t => unit,\n onMouseOver?: JsxEvent.Mouse.t => unit,\n onMouseUp?: JsxEvent.Mouse.t => unit,\n onSelect?: JsxEvent.Selection.t => unit,\n onTouchCancel?: JsxEvent.Touch.t => unit,\n onTouchEnd?: JsxEvent.Touch.t => unit,\n onTouchMove?: JsxEvent.Touch.t => unit,\n onTouchStart?: JsxEvent.Touch.t => unit,\n onPointerOver?: JsxEvent.Pointer.t => unit,\n onPointerEnter?: JsxEvent.Pointer.t => unit,\n onPointerDown?: JsxEvent.Pointer.t => unit,\n onPointerMove?: JsxEvent.Pointer.t => unit,\n onPointerUp?: JsxEvent.Pointer.t => unit,\n onPointerCancel?: JsxEvent.Pointer.t => unit,\n onPointerOut?: JsxEvent.Pointer.t => unit,\n onPointerLeave?: JsxEvent.Pointer.t => unit,\n onGotPointerCapture?: JsxEvent.Pointer.t => unit,\n onLostPointerCapture?: JsxEvent.Pointer.t => unit,\n onScroll?: JsxEvent.UI.t => unit,\n onWheel?: JsxEvent.Wheel.t => unit,\n onAbort?: JsxEvent.Media.t => unit,\n onCanPlay?: JsxEvent.Media.t => unit,\n onCanPlayThrough?: JsxEvent.Media.t => unit,\n onDurationChange?: JsxEvent.Media.t => unit,\n onEmptied?: JsxEvent.Media.t => unit,\n onEncrypted?: JsxEvent.Media.t => unit,\n onEnded?: JsxEvent.Media.t => unit,\n onError?: JsxEvent.Media.t => unit,\n onLoadedData?: JsxEvent.Media.t => unit,\n onLoadedMetadata?: JsxEvent.Media.t => unit,\n onLoadStart?: JsxEvent.Media.t => unit,\n onPause?: JsxEvent.Media.t => unit,\n onPlay?: JsxEvent.Media.t => unit,\n onPlaying?: JsxEvent.Media.t => unit,\n onProgress?: JsxEvent.Media.t => unit,\n onRateChange?: JsxEvent.Media.t => unit,\n onSeeked?: JsxEvent.Media.t => unit,\n onSeeking?: JsxEvent.Media.t => unit,\n onStalled?: JsxEvent.Media.t => unit,\n onSuspend?: JsxEvent.Media.t => unit,\n onTimeUpdate?: JsxEvent.Media.t => unit,\n onVolumeChange?: JsxEvent.Media.t => unit,\n onWaiting?: JsxEvent.Media.t => unit,\n onLoad?: JsxEvent.Image.t => unit,\n onAnimationStart?: JsxEvent.Animation.t => unit,\n onAnimationEnd?: JsxEvent.Animation.t => unit,\n onAnimationIteration?: JsxEvent.Animation.t => unit,\n onTransitionEnd?: JsxEvent.Transition.t => unit,\n accentHeight?: string,\n accumulate?: string,\n additive?: string,\n alignmentBaseline?: string,\n allowReorder?: string,\n alphabetic?: string,\n amplitude?: string,\n arabicForm?: string,\n ascent?: string,\n attributeName?: string,\n attributeType?: string,\n autoReverse?: string,\n azimuth?: string,\n baseFrequency?: string,\n baseProfile?: string,\n baselineShift?: string,\n bbox?: string,\n begin?: string,\n begin_?: string,\n bias?: string,\n by?: string,\n calcMode?: string,\n capHeight?: string,\n clip?: string,\n clipPath?: string,\n clipPathUnits?: string,\n clipRule?: string,\n colorInterpolation?: string,\n colorInterpolationFilters?: string,\n colorProfile?: string,\n colorRendering?: string,\n contentScriptType?: string,\n contentStyleType?: string,\n cursor?: string,\n cx?: string,\n cy?: string,\n d?: string,\n decelerate?: string,\n descent?: string,\n diffuseConstant?: string,\n direction?: string,\n display?: string,\n divisor?: string,\n dominantBaseline?: string,\n dur?: string,\n dx?: string,\n dy?: string,\n edgeMode?: string,\n elevation?: string,\n enableBackground?: string,\n end?: string,\n end_?: string,\n exponent?: string,\n externalResourcesRequired?: string,\n fill?: string,\n fillOpacity?: string,\n fillRule?: string,\n filter?: string,\n filterRes?: string,\n filterUnits?: string,\n floodColor?: string,\n floodOpacity?: string,\n focusable?: string,\n fontFamily?: string,\n fontSize?: string,\n fontSizeAdjust?: string,\n fontStretch?: string,\n fontStyle?: string,\n fontVariant?: string,\n fontWeight?: string,\n fomat?: string,\n from?: string,\n fx?: string,\n fy?: string,\n g1?: string,\n g2?: string,\n glyphName?: string,\n glyphOrientationHorizontal?: string,\n glyphOrientationVertical?: string,\n glyphRef?: string,\n gradientTransform?: string,\n gradientUnits?: string,\n hanging?: string,\n horizAdvX?: string,\n horizOriginX?: string,\n ideographic?: string,\n imageRendering?: string,\n in_?: string,\n in2?: string,\n intercept?: string,\n k?: string,\n k1?: string,\n k2?: string,\n k3?: string,\n k4?: string,\n kernelMatrix?: string,\n kernelUnitLength?: string,\n kerning?: string,\n keyPoints?: string,\n keySplines?: string,\n keyTimes?: string,\n lengthAdjust?: string,\n letterSpacing?: string,\n lightingColor?: string,\n limitingConeAngle?: string,\n local?: string,\n markerEnd?: string,\n markerHeight?: string,\n markerMid?: string,\n markerStart?: string,\n markerUnits?: string,\n markerWidth?: string,\n mask?: string,\n maskContentUnits?: string,\n maskUnits?: string,\n mathematical?: string,\n mode?: string,\n numOctaves?: string,\n offset?: string,\n opacity?: string,\n operator?: string,\n order?: string,\n orient?: string,\n orientation?: string,\n origin?: string,\n overflow?: string,\n overflowX?: string,\n overflowY?: string,\n overlinePosition?: string,\n overlineThickness?: string,\n paintOrder?: string,\n panose1?: string,\n pathLength?: string,\n patternContentUnits?: string,\n patternTransform?: string,\n patternUnits?: string,\n pointerEvents?: string,\n points?: string,\n pointsAtX?: string,\n pointsAtY?: string,\n pointsAtZ?: string,\n preserveAlpha?: string,\n preserveAspectRatio?: string,\n primitiveUnits?: string,\n r?: string,\n radius?: string,\n referrerPolicy?: string,\n refX?: string,\n refY?: string,\n renderingIntent?: string,\n repeatCount?: string,\n repeatDur?: string,\n requiredExtensions?: string,\n requiredFeatures?: string,\n restart?: string,\n result?: string,\n rotate?: string,\n rx?: string,\n ry?: string,\n scale?: string,\n seed?: string,\n shapeRendering?: string,\n slope?: string,\n slot?: string,\n spacing?: string,\n specularConstant?: string,\n specularExponent?: string,\n speed?: string,\n spreadMethod?: string,\n startOffset?: string,\n stdDeviation?: string,\n stemh?: string,\n stemv?: string,\n stitchTiles?: string,\n stopColor?: string,\n stopOpacity?: string,\n strikethroughPosition?: string,\n strikethroughThickness?: string,\n string?: string,\n stroke?: string,\n strokeDasharray?: string,\n strokeDashoffset?: string,\n strokeLinecap?: string,\n strokeLinejoin?: string,\n strokeMiterlimit?: string,\n strokeOpacity?: string,\n strokeWidth?: string,\n surfaceScale?: string,\n systemLanguage?: string,\n tableValues?: string,\n targetX?: string,\n targetY?: string,\n textAnchor?: string,\n textDecoration?: string,\n textLength?: string,\n textRendering?: string,\n to?: string,\n to_?: string,\n transform?: string,\n u1?: string,\n u2?: string,\n underlinePosition?: string,\n underlineThickness?: string,\n unicode?: string,\n unicodeBidi?: string,\n unicodeRange?: string,\n unitsPerEm?: string,\n vAlphabetic?: string,\n vHanging?: string,\n vIdeographic?: string,\n vMathematical?: string,\n values?: string,\n vectorEffect?: string,\n version?: string,\n vertAdvX?: string,\n vertAdvY?: string,\n vertOriginX?: string,\n vertOriginY?: string,\n viewBox?: string,\n viewTarget?: string,\n visibility?: string,\n widths?: string,\n wordSpacing?: string,\n writingMode?: string,\n x?: string,\n x1?: string,\n x2?: string,\n xChannelSelector?: string,\n xHeight?: string,\n xlinkActuate?: string,\n xlinkArcrole?: string,\n xlinkHref?: string,\n xlinkRole?: string,\n xlinkShow?: string,\n xlinkTitle?: string,\n xlinkType?: string,\n xmlns?: string,\n xmlnsXlink?: string,\n xmlBase?: string,\n xmlLang?: string,\n xmlSpace?: string,\n y?: string,\n y1?: string,\n y2?: string,\n yChannelSelector?: string,\n z?: string,\n zoomAndPan?: string,\n about?: string,\n datatype?: string,\n inlist?: string,\n prefix?: string,\n property?: string,\n resource?: string,\n typeof?: string,\n vocab?: string,\n dangerouslySetInnerHTML?: {\"__html\": string},\n suppressContentEditableWarning?: bool,\n}\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22JsxDOM.res%22%2C20%2C0%5D)\n\n\n---\n\n```\n \n```\n```rescript\ntype Jsx.element\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22Jsx.res%22%2C7%2C0%5D)\n\n\n---\n\n```\n \n```\n```rescript\ntype domRef\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22JsxDOM.res%22%2C7%2C0%5D)\n\n\n---\n\n```\n \n```\n```rescript\ntype popover =\n | @as(\"auto\") Auto\n | @as(\"manual\") Manual\n | @as(\"hint\") Hint\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22JsxDOM.res%22%2C11%2C0%5D)\n\n\n---\n\n```\n \n```\n```rescript\ntype popoverTargetAction =\n | @as(\"toggle\") Toggle\n | @as(\"show\") Show\n | @as(\"hide\") Hide\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22JsxDOM.res%22%2C15%2C0%5D)\n\n\n---\n\n```\n \n```\n```rescript\ntype style = JsxDOMStyle.t\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22JsxDOM.res%22%2C6%2C0%5D)\n\n\n---\n\n```\n \n```\n```rescript\ntype JsxEvent.Clipboard.t = synthetic\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22JsxEvent.res%22%2C77%2C2%5D)\n\n\n---\n\n```\n \n```\n```rescript\ntype JsxEvent.Composition.t = synthetic\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22JsxEvent.res%22%2C87%2C2%5D)\n\n\n---\n\n```\n \n```\n```rescript\ntype JsxEvent.Keyboard.t = synthetic\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22JsxEvent.res%22%2C96%2C2%5D)\n\n\n---\n\n```\n \n```\n```rescript\ntype JsxEvent.Focus.t = synthetic\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22JsxEvent.res%22%2C118%2C2%5D)\n\n\n---\n\n```\n \n```\n```rescript\ntype JsxEvent.Form.t = synthetic\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22JsxEvent.res%22%2C128%2C2%5D)\n\n\n---\n\n```\n \n```\n```rescript\ntype JsxEvent.Mouse.t = synthetic\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22JsxEvent.res%22%2C135%2C2%5D)\n\n\n---\n\n```\n \n```\n```rescript\ntype JsxEvent.Selection.t = synthetic\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22JsxEvent.res%22%2C212%2C2%5D)\n\n\n---\n\n```\n \n```\n```rescript\ntype JsxEvent.Touch.t = synthetic\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22JsxEvent.res%22%2C219%2C2%5D)\n\n\n---\n\n```\n \n```\n```rescript\ntype JsxEvent.Pointer.t = synthetic\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22JsxEvent.res%22%2C164%2C2%5D)\n\n\n---\n\n```\n \n```\n```rescript\ntype JsxEvent.UI.t = synthetic\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22JsxEvent.res%22%2C242%2C2%5D)\n\n\n---\n\n```\n \n```\n```rescript\ntype JsxEvent.Wheel.t = synthetic\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22JsxEvent.res%22%2C253%2C2%5D)\n\n\n---\n\n```\n \n```\n```rescript\ntype JsxEvent.Media.t = synthetic\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22JsxEvent.res%22%2C265%2C2%5D)\n\n\n---\n\n```\n \n```\n```rescript\ntype JsxEvent.Image.t = synthetic\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22JsxEvent.res%22%2C272%2C2%5D)\n\n\n---\n\n```\n \n```\n```rescript\ntype JsxEvent.Animation.t = synthetic\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22JsxEvent.res%22%2C279%2C2%5D)\n\n\n---\n\n```\n \n```\n```rescript\ntype JsxEvent.Transition.t = synthetic\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22JsxEvent.res%22%2C290%2C2%5D)\n"}} +{ + "contents": { + "kind": "markdown", + "value": "```rescript\nJsxDOM.domProps\n```\n\n---\n\n```\n \n```\n```rescript\ntype JsxDOM.domProps = {\n key?: string,\n children?: Jsx.element,\n ref?: domRef,\n allow?: string,\n ariaCurrent?: [\n | #date\n | #\"false\"\n | #location\n | #page\n | #step\n | #time\n | #\"true\"\n ],\n ariaDetails?: string,\n ariaDisabled?: bool,\n ariaHidden?: bool,\n ariaInvalid?: [#\"false\" | #grammar | #spelling | #\"true\"],\n ariaKeyshortcuts?: string,\n ariaLabel?: string,\n ariaRoledescription?: string,\n ariaAutocomplete?: [#both | #inline | #list | #none],\n ariaChecked?: [#\"false\" | #mixed | #\"true\"],\n ariaExpanded?: bool,\n ariaHaspopup?: [\n | #dialog\n | #\"false\"\n | #grid\n | #listbox\n | #menu\n | #tree\n | #\"true\"\n ],\n ariaLevel?: int,\n ariaModal?: bool,\n ariaMultiline?: bool,\n ariaMultiselectable?: bool,\n ariaOrientation?: [#horizontal | #undefined | #vertical],\n ariaPlaceholder?: string,\n ariaPressed?: [#\"false\" | #mixed | #\"true\"],\n ariaReadonly?: bool,\n ariaRequired?: bool,\n ariaSelected?: bool,\n ariaSort?: string,\n ariaValuemax?: float,\n ariaValuemin?: float,\n ariaValuenow?: float,\n ariaValuetext?: string,\n ariaAtomic?: bool,\n ariaBusy?: bool,\n ariaLive?: [#assertive | #off | #polite | #rude],\n ariaRelevant?: string,\n ariaDropeffect?: [\n | #copy\n | #execute\n | #link\n | #move\n | #none\n | #popup\n ],\n ariaGrabbed?: bool,\n ariaActivedescendant?: string,\n ariaColcount?: int,\n ariaColindex?: int,\n ariaColspan?: int,\n ariaControls?: string,\n ariaDescribedby?: string,\n ariaErrormessage?: string,\n ariaFlowto?: string,\n ariaLabelledby?: string,\n ariaOwns?: string,\n ariaPosinset?: int,\n ariaRowcount?: int,\n ariaRowindex?: int,\n ariaRowspan?: int,\n ariaSetsize?: int,\n defaultChecked?: bool,\n defaultValue?: string,\n accessKey?: string,\n capture?: [#environment | #user],\n className?: string,\n contentEditable?: bool,\n contextMenu?: string,\n dataTestId?: string,\n dir?: string,\n draggable?: bool,\n hidden?: bool,\n id?: string,\n inert?: bool,\n lang?: string,\n popover?: popover,\n popoverTarget?: string,\n popoverTargetAction?: popoverTargetAction,\n role?: string,\n style?: style,\n spellCheck?: bool,\n tabIndex?: int,\n title?: string,\n itemID?: string,\n itemProp?: string,\n itemRef?: string,\n itemScope?: bool,\n itemType?: string,\n accept?: string,\n acceptCharset?: string,\n action?: string,\n allowFullScreen?: bool,\n alt?: string,\n as_?: string,\n async?: bool,\n autoComplete?: string,\n autoCapitalize?: string,\n autoFocus?: bool,\n autoPlay?: bool,\n challenge?: string,\n charSet?: string,\n checked?: bool,\n cite?: string,\n crossOrigin?: string,\n cols?: int,\n colSpan?: int,\n content?: string,\n controls?: bool,\n coords?: string,\n data?: string,\n dateTime?: string,\n default?: bool,\n defer?: bool,\n disabled?: bool,\n download?: string,\n encType?: string,\n form?: string,\n formAction?: string,\n formTarget?: string,\n formMethod?: string,\n frameBorder?: int,\n headers?: string,\n height?: string,\n high?: int,\n href?: string,\n hrefLang?: string,\n htmlFor?: string,\n httpEquiv?: string,\n icon?: string,\n inputMode?: string,\n integrity?: string,\n keyType?: string,\n kind?: string,\n label?: string,\n list?: string,\n loading?: [#eager | #lazy],\n loop?: bool,\n low?: int,\n manifest?: string,\n max?: string,\n maxLength?: int,\n media?: string,\n mediaGroup?: string,\n method?: string,\n min?: string,\n minLength?: int,\n multiple?: bool,\n muted?: bool,\n name?: string,\n nonce?: string,\n noValidate?: bool,\n open_?: bool,\n optimum?: int,\n pattern?: string,\n placeholder?: string,\n playsInline?: bool,\n poster?: string,\n preload?: string,\n radioGroup?: string,\n readOnly?: bool,\n rel?: string,\n required?: bool,\n reversed?: bool,\n rows?: int,\n rowSpan?: int,\n sandbox?: string,\n scope?: string,\n scoped?: bool,\n scrolling?: string,\n selected?: bool,\n shape?: string,\n size?: int,\n sizes?: string,\n span?: int,\n src?: string,\n srcDoc?: string,\n srcLang?: string,\n srcSet?: string,\n start?: int,\n step?: float,\n summary?: string,\n target?: string,\n type_?: string,\n useMap?: string,\n value?: string,\n width?: string,\n wrap?: string,\n onCopy?: JsxEvent.Clipboard.t => unit,\n onCut?: JsxEvent.Clipboard.t => unit,\n onPaste?: JsxEvent.Clipboard.t => unit,\n onCompositionEnd?: JsxEvent.Composition.t => unit,\n onCompositionStart?: JsxEvent.Composition.t => unit,\n onCompositionUpdate?: JsxEvent.Composition.t => unit,\n onKeyDown?: JsxEvent.Keyboard.t => unit,\n onKeyPress?: JsxEvent.Keyboard.t => unit,\n onKeyUp?: JsxEvent.Keyboard.t => unit,\n onFocus?: JsxEvent.Focus.t => unit,\n onBlur?: JsxEvent.Focus.t => unit,\n onBeforeInput?: JsxEvent.Form.t => unit,\n onChange?: JsxEvent.Form.t => unit,\n onInput?: JsxEvent.Form.t => unit,\n onReset?: JsxEvent.Form.t => unit,\n onSubmit?: JsxEvent.Form.t => unit,\n onInvalid?: JsxEvent.Form.t => unit,\n onClick?: JsxEvent.Mouse.t => unit,\n onContextMenu?: JsxEvent.Mouse.t => unit,\n onDoubleClick?: JsxEvent.Mouse.t => unit,\n onDrag?: JsxEvent.Mouse.t => unit,\n onDragEnd?: JsxEvent.Mouse.t => unit,\n onDragEnter?: JsxEvent.Mouse.t => unit,\n onDragExit?: JsxEvent.Mouse.t => unit,\n onDragLeave?: JsxEvent.Mouse.t => unit,\n onDragOver?: JsxEvent.Mouse.t => unit,\n onDragStart?: JsxEvent.Mouse.t => unit,\n onDrop?: JsxEvent.Mouse.t => unit,\n onMouseDown?: JsxEvent.Mouse.t => unit,\n onMouseEnter?: JsxEvent.Mouse.t => unit,\n onMouseLeave?: JsxEvent.Mouse.t => unit,\n onMouseMove?: JsxEvent.Mouse.t => unit,\n onMouseOut?: JsxEvent.Mouse.t => unit,\n onMouseOver?: JsxEvent.Mouse.t => unit,\n onMouseUp?: JsxEvent.Mouse.t => unit,\n onSelect?: JsxEvent.Selection.t => unit,\n onTouchCancel?: JsxEvent.Touch.t => unit,\n onTouchEnd?: JsxEvent.Touch.t => unit,\n onTouchMove?: JsxEvent.Touch.t => unit,\n onTouchStart?: JsxEvent.Touch.t => unit,\n onPointerOver?: JsxEvent.Pointer.t => unit,\n onPointerEnter?: JsxEvent.Pointer.t => unit,\n onPointerDown?: JsxEvent.Pointer.t => unit,\n onPointerMove?: JsxEvent.Pointer.t => unit,\n onPointerUp?: JsxEvent.Pointer.t => unit,\n onPointerCancel?: JsxEvent.Pointer.t => unit,\n onPointerOut?: JsxEvent.Pointer.t => unit,\n onPointerLeave?: JsxEvent.Pointer.t => unit,\n onGotPointerCapture?: JsxEvent.Pointer.t => unit,\n onLostPointerCapture?: JsxEvent.Pointer.t => unit,\n onScroll?: JsxEvent.UI.t => unit,\n onWheel?: JsxEvent.Wheel.t => unit,\n onAbort?: JsxEvent.Media.t => unit,\n onCanPlay?: JsxEvent.Media.t => unit,\n onCanPlayThrough?: JsxEvent.Media.t => unit,\n onDurationChange?: JsxEvent.Media.t => unit,\n onEmptied?: JsxEvent.Media.t => unit,\n onEncrypted?: JsxEvent.Media.t => unit,\n onEnded?: JsxEvent.Media.t => unit,\n onError?: JsxEvent.Media.t => unit,\n onLoadedData?: JsxEvent.Media.t => unit,\n onLoadedMetadata?: JsxEvent.Media.t => unit,\n onLoadStart?: JsxEvent.Media.t => unit,\n onPause?: JsxEvent.Media.t => unit,\n onPlay?: JsxEvent.Media.t => unit,\n onPlaying?: JsxEvent.Media.t => unit,\n onProgress?: JsxEvent.Media.t => unit,\n onRateChange?: JsxEvent.Media.t => unit,\n onSeeked?: JsxEvent.Media.t => unit,\n onSeeking?: JsxEvent.Media.t => unit,\n onStalled?: JsxEvent.Media.t => unit,\n onSuspend?: JsxEvent.Media.t => unit,\n onTimeUpdate?: JsxEvent.Media.t => unit,\n onVolumeChange?: JsxEvent.Media.t => unit,\n onWaiting?: JsxEvent.Media.t => unit,\n onLoad?: JsxEvent.Image.t => unit,\n onAnimationStart?: JsxEvent.Animation.t => unit,\n onAnimationEnd?: JsxEvent.Animation.t => unit,\n onAnimationIteration?: JsxEvent.Animation.t => unit,\n onTransitionEnd?: JsxEvent.Transition.t => unit,\n accentHeight?: string,\n accumulate?: string,\n additive?: string,\n alignmentBaseline?: string,\n allowReorder?: string,\n alphabetic?: string,\n amplitude?: string,\n arabicForm?: string,\n ascent?: string,\n attributeName?: string,\n attributeType?: string,\n autoReverse?: string,\n azimuth?: string,\n baseFrequency?: string,\n baseProfile?: string,\n baselineShift?: string,\n bbox?: string,\n begin?: string,\n begin_?: string,\n bias?: string,\n by?: string,\n calcMode?: string,\n capHeight?: string,\n clip?: string,\n clipPath?: string,\n clipPathUnits?: string,\n clipRule?: string,\n colorInterpolation?: string,\n colorInterpolationFilters?: string,\n colorProfile?: string,\n colorRendering?: string,\n contentScriptType?: string,\n contentStyleType?: string,\n cursor?: string,\n cx?: string,\n cy?: string,\n d?: string,\n decelerate?: string,\n descent?: string,\n diffuseConstant?: string,\n direction?: string,\n display?: string,\n divisor?: string,\n dominantBaseline?: string,\n dur?: string,\n dx?: string,\n dy?: string,\n edgeMode?: string,\n elevation?: string,\n enableBackground?: string,\n end?: string,\n end_?: string,\n exponent?: string,\n externalResourcesRequired?: string,\n fill?: string,\n fillOpacity?: string,\n fillRule?: string,\n filter?: string,\n filterRes?: string,\n filterUnits?: string,\n floodColor?: string,\n floodOpacity?: string,\n focusable?: string,\n fontFamily?: string,\n fontSize?: string,\n fontSizeAdjust?: string,\n fontStretch?: string,\n fontStyle?: string,\n fontVariant?: string,\n fontWeight?: string,\n fomat?: string,\n from?: string,\n fx?: string,\n fy?: string,\n g1?: string,\n g2?: string,\n glyphName?: string,\n glyphOrientationHorizontal?: string,\n glyphOrientationVertical?: string,\n glyphRef?: string,\n gradientTransform?: string,\n gradientUnits?: string,\n hanging?: string,\n horizAdvX?: string,\n horizOriginX?: string,\n ideographic?: string,\n imageRendering?: string,\n in_?: string,\n in2?: string,\n intercept?: string,\n k?: string,\n k1?: string,\n k2?: string,\n k3?: string,\n k4?: string,\n kernelMatrix?: string,\n kernelUnitLength?: string,\n kerning?: string,\n keyPoints?: string,\n keySplines?: string,\n keyTimes?: string,\n lengthAdjust?: string,\n letterSpacing?: string,\n lightingColor?: string,\n limitingConeAngle?: string,\n local?: string,\n markerEnd?: string,\n markerHeight?: string,\n markerMid?: string,\n markerStart?: string,\n markerUnits?: string,\n markerWidth?: string,\n mask?: string,\n maskContentUnits?: string,\n maskUnits?: string,\n mathematical?: string,\n mode?: string,\n numOctaves?: string,\n offset?: string,\n opacity?: string,\n operator?: string,\n order?: string,\n orient?: string,\n orientation?: string,\n origin?: string,\n overflow?: string,\n overflowX?: string,\n overflowY?: string,\n overlinePosition?: string,\n overlineThickness?: string,\n paintOrder?: string,\n panose1?: string,\n pathLength?: string,\n patternContentUnits?: string,\n patternTransform?: string,\n patternUnits?: string,\n pointerEvents?: string,\n points?: string,\n pointsAtX?: string,\n pointsAtY?: string,\n pointsAtZ?: string,\n preserveAlpha?: string,\n preserveAspectRatio?: string,\n primitiveUnits?: string,\n r?: string,\n radius?: string,\n referrerPolicy?: string,\n refX?: string,\n refY?: string,\n renderingIntent?: string,\n repeatCount?: string,\n repeatDur?: string,\n requiredExtensions?: string,\n requiredFeatures?: string,\n restart?: string,\n result?: string,\n rotate?: string,\n rx?: string,\n ry?: string,\n scale?: string,\n seed?: string,\n shapeRendering?: string,\n slope?: string,\n slot?: string,\n spacing?: string,\n specularConstant?: string,\n specularExponent?: string,\n speed?: string,\n spreadMethod?: string,\n startOffset?: string,\n stdDeviation?: string,\n stemh?: string,\n stemv?: string,\n stitchTiles?: string,\n stopColor?: string,\n stopOpacity?: string,\n strikethroughPosition?: string,\n strikethroughThickness?: string,\n string?: string,\n stroke?: string,\n strokeDasharray?: string,\n strokeDashoffset?: string,\n strokeLinecap?: string,\n strokeLinejoin?: string,\n strokeMiterlimit?: string,\n strokeOpacity?: string,\n strokeWidth?: string,\n surfaceScale?: string,\n systemLanguage?: string,\n tableValues?: string,\n targetX?: string,\n targetY?: string,\n textAnchor?: string,\n textDecoration?: string,\n textLength?: string,\n textRendering?: string,\n to?: string,\n to_?: string,\n transform?: string,\n u1?: string,\n u2?: string,\n underlinePosition?: string,\n underlineThickness?: string,\n unicode?: string,\n unicodeBidi?: string,\n unicodeRange?: string,\n unitsPerEm?: string,\n vAlphabetic?: string,\n vHanging?: string,\n vIdeographic?: string,\n vMathematical?: string,\n values?: string,\n vectorEffect?: string,\n version?: string,\n vertAdvX?: string,\n vertAdvY?: string,\n vertOriginX?: string,\n vertOriginY?: string,\n viewBox?: string,\n viewTarget?: string,\n visibility?: string,\n widths?: string,\n wordSpacing?: string,\n writingMode?: string,\n x?: string,\n x1?: string,\n x2?: string,\n xChannelSelector?: string,\n xHeight?: string,\n xlinkActuate?: string,\n xlinkArcrole?: string,\n xlinkHref?: string,\n xlinkRole?: string,\n xlinkShow?: string,\n xlinkTitle?: string,\n xlinkType?: string,\n xmlns?: string,\n xmlnsXlink?: string,\n xmlBase?: string,\n xmlLang?: string,\n xmlSpace?: string,\n y?: string,\n y1?: string,\n y2?: string,\n yChannelSelector?: string,\n z?: string,\n zoomAndPan?: string,\n about?: string,\n datatype?: string,\n inlist?: string,\n prefix?: string,\n property?: string,\n resource?: string,\n typeof?: string,\n vocab?: string,\n dangerouslySetInnerHTML?: {\"__html\": string},\n suppressContentEditableWarning?: bool,\n}\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22JsxDOM.res%22%2C20%2C0%5D)\n\n\n---\n\n```\n \n```\n```rescript\ntype Jsx.element\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22Jsx.res%22%2C7%2C0%5D)\n\n\n---\n\n```\n \n```\n```rescript\ntype domRef\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22JsxDOM.res%22%2C7%2C0%5D)\n\n\n---\n\n```\n \n```\n```rescript\ntype popover =\n | @as(\"auto\") Auto\n | @as(\"manual\") Manual\n | @as(\"hint\") Hint\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22JsxDOM.res%22%2C11%2C0%5D)\n\n\n---\n\n```\n \n```\n```rescript\ntype popoverTargetAction =\n | @as(\"toggle\") Toggle\n | @as(\"show\") Show\n | @as(\"hide\") Hide\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22JsxDOM.res%22%2C15%2C0%5D)\n\n\n---\n\n```\n \n```\n```rescript\ntype style = JsxDOMStyle.t\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22JsxDOM.res%22%2C6%2C0%5D)\n\n\n---\n\n```\n \n```\n```rescript\ntype JsxEvent.Clipboard.t = synthetic\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22JsxEvent.res%22%2C77%2C2%5D)\n\n\n---\n\n```\n \n```\n```rescript\ntype JsxEvent.Composition.t = synthetic\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22JsxEvent.res%22%2C87%2C2%5D)\n\n\n---\n\n```\n \n```\n```rescript\ntype JsxEvent.Keyboard.t = synthetic\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22JsxEvent.res%22%2C96%2C2%5D)\n\n\n---\n\n```\n \n```\n```rescript\ntype JsxEvent.Focus.t = synthetic\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22JsxEvent.res%22%2C118%2C2%5D)\n\n\n---\n\n```\n \n```\n```rescript\ntype JsxEvent.Form.t = synthetic\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22JsxEvent.res%22%2C128%2C2%5D)\n\n\n---\n\n```\n \n```\n```rescript\ntype JsxEvent.Mouse.t = synthetic\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22JsxEvent.res%22%2C135%2C2%5D)\n\n\n---\n\n```\n \n```\n```rescript\ntype JsxEvent.Selection.t = synthetic\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22JsxEvent.res%22%2C212%2C2%5D)\n\n\n---\n\n```\n \n```\n```rescript\ntype JsxEvent.Touch.t = synthetic\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22JsxEvent.res%22%2C219%2C2%5D)\n\n\n---\n\n```\n \n```\n```rescript\ntype JsxEvent.Pointer.t = synthetic\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22JsxEvent.res%22%2C164%2C2%5D)\n\n\n---\n\n```\n \n```\n```rescript\ntype JsxEvent.UI.t = synthetic\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22JsxEvent.res%22%2C242%2C2%5D)\n\n\n---\n\n```\n \n```\n```rescript\ntype JsxEvent.Wheel.t = synthetic\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22JsxEvent.res%22%2C253%2C2%5D)\n\n\n---\n\n```\n \n```\n```rescript\ntype JsxEvent.Media.t = synthetic\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22JsxEvent.res%22%2C265%2C2%5D)\n\n\n---\n\n```\n \n```\n```rescript\ntype JsxEvent.Image.t = synthetic\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22JsxEvent.res%22%2C272%2C2%5D)\n\n\n---\n\n```\n \n```\n```rescript\ntype JsxEvent.Animation.t = synthetic\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22JsxEvent.res%22%2C279%2C2%5D)\n\n\n---\n\n```\n \n```\n```rescript\ntype JsxEvent.Transition.t = synthetic\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22JsxEvent.res%22%2C290%2C2%5D)\n" + } +} Hover src/Completion.res 352:17 Nothing at that position. Now trying to use completion. @@ -2142,7 +2489,12 @@ Path FAO.forAutoObject Raw opens: 2 Shadow.B.place holder ... Shadow.A.place holder Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib -{"contents": {"kind": "markdown", "value": "```rescript\n{\"age\": int, \"forAutoLabel\": FAR.forAutoRecord}\n```"}} +{ + "contents": { + "kind": "markdown", + "value": "```rescript\n{\"age\": int, \"forAutoLabel\": FAR.forAutoRecord}\n```" + } +} Hover src/Completion.res 355:17 Nothing at that position. Now trying to use completion. @@ -2163,7 +2515,12 @@ Found type for function ( unit, ~c: int, ) => int -{"contents": {"kind": "markdown", "value": "```rescript\noption\n```"}} +{ + "contents": { + "kind": "markdown", + "value": "```rescript\noption\n```" + } +} Complete src/Completion.res 358:23 posCursor:[358:23] posNoWhite:[358:22] Found expr:[0:-1->358:23] @@ -2187,87 +2544,88 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 3 Stdlib Completion Completion ContextPath Value[T] Path T -[{ - "label": "That", - "kind": 4, - "tags": [], +[ + { "detail": "That", - "documentation": {"kind": "markdown", "value": "```rescript\nThat\n```\n\n```rescript\ntype v = This | That\n```"} - }, { - "label": "This", + "documentation": { + "kind": "markdown", + "value": "```rescript\nThat\n```\n\n```rescript\ntype v = This | That\n```" + }, "kind": 4, - "tags": [], + "label": "That", + "tags": [] + }, + { "detail": "This", - "documentation": {"kind": "markdown", "value": "```rescript\nThis\n```\n\n```rescript\ntype v = This | That\n```"} - }, { - "label": "TypedArray", - "kind": 9, - "tags": [], + "documentation": { + "kind": "markdown", + "value": "```rescript\nThis\n```\n\n```rescript\ntype v = This | That\n```" + }, + "kind": 4, + "label": "This", + "tags": [] + }, + { "detail": "module TypedArray", - "documentation": null - }, { - "label": "TimeoutId", "kind": 9, - "tags": [], + "label": "TypedArray", + "tags": [] + }, + { "detail": "module TimeoutId", - "documentation": null - }, { - "label": "Type", - "kind": 9, - "tags": [], - "detail": "module Type", - "documentation": null - }, { - "label": "TableclothMap", "kind": 9, - "tags": [], - "detail": "module TableclothMap", - "documentation": null, + "label": "TimeoutId", + "tags": [] + }, + { "detail": "module Type", "kind": 9, "label": "Type", "tags": [] }, + { "data": { "modulePath": "TableclothMap", "filePath": "src/Completion.res" - } - }, { - "label": "TypeArgCtx", + }, + "detail": "module TableclothMap", "kind": 9, - "tags": [], + "label": "TableclothMap", + "tags": [] + }, + { + "data": { "modulePath": "TypeArgCtx", "filePath": "src/Completion.res" }, "detail": "module TypeArgCtx", - "documentation": null, - "data": { - "modulePath": "TypeArgCtx", - "filePath": "src/Completion.res" - } - }, { - "label": "TypeAtPosCompletion", "kind": 9, - "tags": [], - "detail": "module TypeAtPosCompletion", - "documentation": null, + "label": "TypeArgCtx", + "tags": [] + }, + { "data": { "modulePath": "TypeAtPosCompletion", "filePath": "src/Completion.res" - } - }, { - "label": "TypeConstraint", + }, + "detail": "module TypeAtPosCompletion", "kind": 9, - "tags": [], - "detail": "module TypeConstraint", - "documentation": null, + "label": "TypeAtPosCompletion", + "tags": [] + }, + { "data": { "modulePath": "TypeConstraint", "filePath": "src/Completion.res" - } - }, { - "label": "TypeDefinition", + }, + "detail": "module TypeConstraint", "kind": 9, - "tags": [], - "detail": "module TypeDefinition", - "documentation": null, + "label": "TypeConstraint", + "tags": [] + }, + { "data": { "modulePath": "TypeDefinition", "filePath": "src/Completion.res" - } - }] + }, + "detail": "module TypeDefinition", + "kind": 9, + "label": "TypeDefinition", + "tags": [] + } +] Complete src/Completion.res 376:21 posCursor:[376:21] posNoWhite:[376:20] Found expr:[374:8->379:3] @@ -2280,13 +2638,18 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 3 Stdlib Completion Completion ContextPath Value[AndThatOther, T] Path AndThatOther.T -[{ - "label": "ThatOther", - "kind": 4, - "tags": [], +[ + { "detail": "ThatOther", - "documentation": {"kind": "markdown", "value": "```rescript\nThatOther\n```\n\n```rescript\ntype v = And | ThatOther\n```"} - }] + "documentation": { + "kind": "markdown", + "value": "```rescript\nThatOther\n```\n\n```rescript\ntype v = And | ThatOther\n```" + }, + "kind": 4, + "label": "ThatOther", + "tags": [] + } +] Complete src/Completion.res 381:24 posCursor:[381:24] posNoWhite:[381:23] Found expr:[381:12->381:26] @@ -2301,19 +2664,10 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 3 Stdlib Completion Completion ContextPath Value[ForAuto, ""] Path ForAuto. -[{ - "label": "abc", - "kind": 12, - "tags": [], - "detail": "(t, int) => t", - "documentation": null - }, { - "label": "abd", - "kind": 12, - "tags": [], - "detail": "(t, int) => t", - "documentation": null - }] +[ + { "detail": "(t, int) => t", "kind": 12, "label": "abc", "tags": [] }, + { "detail": "(t, int) => t", "kind": 12, "label": "abd", "tags": [] } +] Complete src/Completion.res 384:38 posCursor:[384:38] posNoWhite:[384:37] Found expr:[384:12->384:41] @@ -2329,19 +2683,15 @@ Resolved opens 3 Stdlib Completion Completion ContextPath Value[FAO, forAutoObject][""] ContextPath Value[FAO, forAutoObject] Path FAO.forAutoObject -[{ - "label": "age", +[ + { "detail": "int", "kind": 4, "label": "age", "tags": [] }, + { + "detail": "FAR.forAutoRecord", "kind": 4, - "tags": [], - "detail": "int", - "documentation": null - }, { "label": "forAutoLabel", - "kind": 4, - "tags": [], - "detail": "FAR.forAutoRecord", - "documentation": null - }] + "tags": [] + } +] Complete src/Completion.res 387:24 posCursor:[387:24] posNoWhite:[387:23] Found expr:[387:11->387:26] @@ -2363,19 +2713,28 @@ Path funRecord CPPipe pathFromEnv: found:true Path Completion. Path -[{ - "label": "someFun", - "kind": 5, - "tags": [], +[ + { "detail": "(~name: string) => unit", - "documentation": {"kind": "markdown", "value": "```rescript\nsomeFun: (~name: string) => unit\n```\n\n```rescript\ntype funRecord = {\n someFun: (~name: string) => unit,\n stuff: string,\n}\n```"} - }, { - "label": "stuff", + "documentation": { + "kind": "markdown", + "value": "```rescript\nsomeFun: (~name: string) => unit\n```\n\n```rescript\ntype funRecord = {\n someFun: (~name: string) => unit,\n stuff: string,\n}\n```" + }, "kind": 5, - "tags": [], + "label": "someFun", + "tags": [] + }, + { "detail": "string", - "documentation": {"kind": "markdown", "value": "```rescript\nstuff: string\n```\n\n```rescript\ntype funRecord = {\n someFun: (~name: string) => unit,\n stuff: string,\n}\n```"} - }] + "documentation": { + "kind": "markdown", + "value": "```rescript\nstuff: string\n```\n\n```rescript\ntype funRecord = {\n someFun: (~name: string) => unit,\n stuff: string,\n}\n```" + }, + "kind": 5, + "label": "stuff", + "tags": [] + } +] Complete src/Completion.res 391:12 posCursor:[391:12] posNoWhite:[391:11] Found expr:[390:8->394:1] @@ -2390,19 +2749,28 @@ ContextPath array Path Stdlib.Array.ma Path ArrayUtils.ma Path ma -[{ - "label": "Array.map", - "kind": 12, - "tags": [], +[ + { "detail": "(array<'a>, 'a => 'b) => array<'b>", - "documentation": {"kind": "markdown", "value": "\n`map(array, fn)` returns a new array with all elements from `array`, each element transformed using the provided `fn`.\n\nSee [`Array.map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map) on MDN.\n\n## Examples\n\n```rescript\nlet array = [\"Hello\", \"Hi\", \"Good bye\"]\nlet mappedArray = array->Array.map(greeting => greeting ++ \" to you\")\n\nmappedArray == [\"Hello to you\", \"Hi to you\", \"Good bye to you\"]\n```\n"} - }, { - "label": "Array.mapWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`map(array, fn)` returns a new array with all elements from `array`, each element transformed using the provided `fn`.\n\nSee [`Array.map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map) on MDN.\n\n## Examples\n\n```rescript\nlet array = [\"Hello\", \"Hi\", \"Good bye\"]\nlet mappedArray = array->Array.map(greeting => greeting ++ \" to you\")\n\nmappedArray == [\"Hello to you\", \"Hi to you\", \"Good bye to you\"]\n```\n" + }, "kind": 12, - "tags": [], + "label": "Array.map", + "tags": [] + }, + { "detail": "(array<'a>, ('a, int) => 'b) => array<'b>", - "documentation": {"kind": "markdown", "value": "\n`mapWithIndex(array, fn)` returns a new array with all elements from `array`, each element transformed using the provided `fn`.\n\nSee [`Array.map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map) on MDN.\n\n## Examples\n\n```rescript\nlet array = [\"Hello\", \"Hi\", \"Good bye\"]\nlet mappedArray =\n array->Array.mapWithIndex((greeting, index) => greeting ++ \" at position \" ++ Int.toString(index))\n\nmappedArray == [\"Hello at position 0\", \"Hi at position 1\", \"Good bye at position 2\"]\n```\n"} - }] + "documentation": { + "kind": "markdown", + "value": "\n`mapWithIndex(array, fn)` returns a new array with all elements from `array`, each element transformed using the provided `fn`.\n\nSee [`Array.map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map) on MDN.\n\n## Examples\n\n```rescript\nlet array = [\"Hello\", \"Hi\", \"Good bye\"]\nlet mappedArray =\n array->Array.mapWithIndex((greeting, index) => greeting ++ \" at position \" ++ Int.toString(index))\n\nmappedArray == [\"Hello at position 0\", \"Hi at position 1\", \"Good bye at position 2\"]\n```\n" + }, + "kind": 12, + "label": "Array.mapWithIndex", + "tags": [] + } +] Complete src/Completion.res 399:14 posCursor:[399:14] posNoWhite:[399:13] Found expr:[398:14->399:20] @@ -2417,13 +2785,7 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 3 Stdlib Completion Completion ContextPath Value[red] Path red -[{ - "label": "red", - "kind": 12, - "tags": [], - "detail": "string", - "documentation": null - }] +[ { "detail": "string", "kind": 12, "label": "red", "tags": [] } ] Complete src/Completion.res 404:25 posCursor:[404:25] posNoWhite:[404:24] Found expr:[402:14->404:31] @@ -2438,13 +2800,7 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 3 Stdlib Completion Completion ContextPath Value[red] Path red -[{ - "label": "red", - "kind": 12, - "tags": [], - "detail": "string", - "documentation": null - }] +[ { "detail": "string", "kind": 12, "label": "red", "tags": [] } ] Complete src/Completion.res 407:22 posCursor:[407:22] posNoWhite:[407:21] Found expr:[407:11->485:0] @@ -2460,25 +2816,20 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 3 Stdlib Completion Completion ContextPath Value[r] Path r -[{ - "label": "red", +[ + { "detail": "string", "kind": 12, "label": "red", "tags": [] }, + { "detail": "unit => aa", "kind": 12, "label": "retAA", "tags": [] }, + { + "detail": "rAlias", + "documentation": { + "kind": "markdown", + "value": "```rescript\ntype r = {x: int, y: string}\n```" + }, "kind": 12, - "tags": [], - "detail": "string", - "documentation": null - }, { - "label": "retAA", - "kind": 12, - "tags": [], - "detail": "unit => aa", - "documentation": null - }, { "label": "r", - "kind": 12, - "tags": [], - "detail": "rAlias", - "documentation": {"kind": "markdown", "value": "```rescript\ntype r = {x: int, y: string}\n```"} - }] + "tags": [] + } +] Complete src/Completion.res 411:21 posCursor:[411:21] posNoWhite:[411:20] Found expr:[410:14->417:1] @@ -2492,19 +2843,10 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 3 Stdlib Completion Completion ContextPath Value[SomeLocalModule, ""] Path SomeLocalModule. -[{ - "label": "bb", - "kind": 12, - "tags": [], - "detail": "int", - "documentation": null - }, { - "label": "aa", - "kind": 12, - "tags": [], - "detail": "int", - "documentation": null - }] +[ + { "detail": "int", "kind": 12, "label": "bb", "tags": [] }, + { "detail": "int", "kind": 12, "label": "aa", "tags": [] } +] Complete src/Completion.res 414:21 posCursor:[414:21] posNoWhite:[414:20] Found expr:[410:14->417:1] @@ -2519,19 +2861,10 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 3 Stdlib Completion Completion ContextPath Value[SomeLocalModule, ""] Path SomeLocalModule. -[{ - "label": "bb", - "kind": 12, - "tags": [], - "detail": "int", - "documentation": null - }, { - "label": "aa", - "kind": 12, - "tags": [], - "detail": "int", - "documentation": null - }] +[ + { "detail": "int", "kind": 12, "label": "bb", "tags": [] }, + { "detail": "int", "kind": 12, "label": "aa", "tags": [] } +] Complete src/Completion.res 419:17 posCursor:[419:17] posNoWhite:[419:16] Found expr:[419:11->419:17] @@ -2543,67 +2876,112 @@ ContextPath int->t ContextPath int Path Stdlib.Int.t Path t -[{ - "label": "Int.toStringWithRadix", - "kind": 12, - "tags": [1], +[ + { + "deprecated": true, "detail": "(int, ~radix: int) => string", - "documentation": {"kind": "markdown", "value": "Deprecated: Use `toString` instead\n\n\n`toStringWithRadix(n, ~radix)` return a `string` representing the given value.\n`~radix` specifies the radix base to use for the formatted number.\nSee [`Number.toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toString)\non MDN.\n\n## Examples\n\n```rescript\nInt.toStringWithRadix(6, ~radix=2) // \"110\"\nInt.toStringWithRadix(373592855, ~radix=16) // \"16449317\"\nInt.toStringWithRadix(123456, ~radix=36) // \"2n9c\"\n```\n\n## Exceptions\n\n`RangeError`: if `radix` is less than 2 or greater than 36.\n"} - }, { - "label": "Int.toExponentialWithPrecision", + "documentation": { + "kind": "markdown", + "value": "Deprecated: Use `toString` instead\n\n\n`toStringWithRadix(n, ~radix)` return a `string` representing the given value.\n`~radix` specifies the radix base to use for the formatted number.\nSee [`Number.toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toString)\non MDN.\n\n## Examples\n\n```rescript\nInt.toStringWithRadix(6, ~radix=2) // \"110\"\nInt.toStringWithRadix(373592855, ~radix=16) // \"16449317\"\nInt.toStringWithRadix(123456, ~radix=36) // \"2n9c\"\n```\n\n## Exceptions\n\n`RangeError`: if `radix` is less than 2 or greater than 36.\n" + }, "kind": 12, - "tags": [1], + "label": "Int.toStringWithRadix", + "tags": [ 1 ] + }, + { + "deprecated": true, "detail": "(int, ~digits: int) => string", - "documentation": {"kind": "markdown", "value": "Deprecated: Use `toExponential` instead\n\n\n`toExponential(n, ~digits)` return a `string` representing the given value in\nexponential notation. `digits` specifies how many digits should appear after\nthe decimal point. See [`Number.toExponential`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toExponential)\non MDN.\n\n## Examples\n\n```rescript\nInt.toExponentialWithPrecision(77, ~digits=2) // \"7.70e+1\"\nInt.toExponentialWithPrecision(5678, ~digits=2) // \"5.68e+3\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` less than 0 or greater than 10.\n"} - }, { - "label": "Int.toFixedWithPrecision", + "documentation": { + "kind": "markdown", + "value": "Deprecated: Use `toExponential` instead\n\n\n`toExponential(n, ~digits)` return a `string` representing the given value in\nexponential notation. `digits` specifies how many digits should appear after\nthe decimal point. See [`Number.toExponential`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toExponential)\non MDN.\n\n## Examples\n\n```rescript\nInt.toExponentialWithPrecision(77, ~digits=2) // \"7.70e+1\"\nInt.toExponentialWithPrecision(5678, ~digits=2) // \"5.68e+3\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` less than 0 or greater than 10.\n" + }, "kind": 12, - "tags": [1], + "label": "Int.toExponentialWithPrecision", + "tags": [ 1 ] + }, + { + "deprecated": true, "detail": "(int, ~digits: int) => string", - "documentation": {"kind": "markdown", "value": "Deprecated: Use `toFixed` instead\n\n\n`toFixedWithPrecision(n, ~digits)` return a `string` representing the given\nvalue using fixed-point notation. `digits` specifies how many digits should\nappear after the decimal point. See [`Number.toFixed`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toFixed)\non MDN.\n\n## Examples\n\n```rescript\nInt.toFixedWithPrecision(300, ~digits=4) // \"300.0000\"\nInt.toFixedWithPrecision(300, ~digits=1) // \"300.0\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` is less than 0 or larger than 100.\n"} - }, { - "label": "Int.toPrecisionWithPrecision", + "documentation": { + "kind": "markdown", + "value": "Deprecated: Use `toFixed` instead\n\n\n`toFixedWithPrecision(n, ~digits)` return a `string` representing the given\nvalue using fixed-point notation. `digits` specifies how many digits should\nappear after the decimal point. See [`Number.toFixed`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toFixed)\non MDN.\n\n## Examples\n\n```rescript\nInt.toFixedWithPrecision(300, ~digits=4) // \"300.0000\"\nInt.toFixedWithPrecision(300, ~digits=1) // \"300.0\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` is less than 0 or larger than 100.\n" + }, "kind": 12, - "tags": [1], + "label": "Int.toFixedWithPrecision", + "tags": [ 1 ] + }, + { + "deprecated": true, "detail": "(int, ~digits: int) => string", - "documentation": {"kind": "markdown", "value": "Deprecated: Use `toPrecision` instead\n\n\n`toPrecisionWithPrecision(n, ~digits)` return a `string` representing the giver value with\nprecision. `digits` specifies the number of significant digits. See [`Number.toPrecision`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toPrecision) on MDN.\n\n## Examples\n\n```rescript\nInt.toPrecisionWithPrecision(100, ~digits=2) // \"1.0e+2\"\nInt.toPrecisionWithPrecision(1, ~digits=2) // \"1.0\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` is not between 1 and 100 (inclusive).\n Implementations are allowed to support larger and smaller values as well.\n ECMA-262 only requires a precision of up to 21 significant digits.\n"} - }, { - "label": "Int.toPrecision", + "documentation": { + "kind": "markdown", + "value": "Deprecated: Use `toPrecision` instead\n\n\n`toPrecisionWithPrecision(n, ~digits)` return a `string` representing the giver value with\nprecision. `digits` specifies the number of significant digits. See [`Number.toPrecision`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toPrecision) on MDN.\n\n## Examples\n\n```rescript\nInt.toPrecisionWithPrecision(100, ~digits=2) // \"1.0e+2\"\nInt.toPrecisionWithPrecision(1, ~digits=2) // \"1.0\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` is not between 1 and 100 (inclusive).\n Implementations are allowed to support larger and smaller values as well.\n ECMA-262 only requires a precision of up to 21 significant digits.\n" + }, "kind": 12, - "tags": [], + "label": "Int.toPrecisionWithPrecision", + "tags": [ 1 ] + }, + { "detail": "(int, ~digits: int=?) => string", - "documentation": {"kind": "markdown", "value": "\n`toPrecision(n, ~digits=?)` return a `string` representing the giver value with\nprecision. `digits` specifies the number of significant digits. See [`Number.toPrecision`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toPrecision) on MDN.\n\n## Examples\n\n```rescript\nInt.toPrecision(100) // \"100\"\nInt.toPrecision(1) // \"1\"\nInt.toPrecision(100, ~digits=2) // \"1.0e+2\"\nInt.toPrecision(1, ~digits=2) // \"1.0\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` is not between 1 and 100 (inclusive).\n Implementations are allowed to support larger and smaller values as well.\n ECMA-262 only requires a precision of up to 21 significant digits.\n"} - }, { - "label": "Int.toString", + "documentation": { + "kind": "markdown", + "value": "\n`toPrecision(n, ~digits=?)` return a `string` representing the giver value with\nprecision. `digits` specifies the number of significant digits. See [`Number.toPrecision`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toPrecision) on MDN.\n\n## Examples\n\n```rescript\nInt.toPrecision(100) // \"100\"\nInt.toPrecision(1) // \"1\"\nInt.toPrecision(100, ~digits=2) // \"1.0e+2\"\nInt.toPrecision(1, ~digits=2) // \"1.0\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` is not between 1 and 100 (inclusive).\n Implementations are allowed to support larger and smaller values as well.\n ECMA-262 only requires a precision of up to 21 significant digits.\n" + }, "kind": 12, - "tags": [], + "label": "Int.toPrecision", + "tags": [] + }, + { "detail": "(int, ~radix: int=?) => string", - "documentation": {"kind": "markdown", "value": "\n`toString(n, ~radix=?)` return a `string` representing the given value.\n`~radix` specifies the radix base to use for the formatted number.\nSee [`Number.toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toString)\non MDN.\n\n## Examples\n\n```rescript\nInt.toString(1000) // \"1000\"\nInt.toString(-1000) // \"-1000\"\nInt.toString(6, ~radix=2) // \"110\"\nInt.toString(373592855, ~radix=16) // \"16449317\"\nInt.toString(123456, ~radix=36) // \"2n9c\"\n```\n\n## Exceptions\n\n`RangeError`: if `radix` is less than 2 or greater than 36.\n"} - }, { - "label": "Int.toFloat", + "documentation": { + "kind": "markdown", + "value": "\n`toString(n, ~radix=?)` return a `string` representing the given value.\n`~radix` specifies the radix base to use for the formatted number.\nSee [`Number.toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toString)\non MDN.\n\n## Examples\n\n```rescript\nInt.toString(1000) // \"1000\"\nInt.toString(-1000) // \"-1000\"\nInt.toString(6, ~radix=2) // \"110\"\nInt.toString(373592855, ~radix=16) // \"16449317\"\nInt.toString(123456, ~radix=36) // \"2n9c\"\n```\n\n## Exceptions\n\n`RangeError`: if `radix` is less than 2 or greater than 36.\n" + }, "kind": 12, - "tags": [], + "label": "Int.toString", + "tags": [] + }, + { "detail": "int => float", - "documentation": {"kind": "markdown", "value": "\n`toFloat(n)` return a `float` representing the given value.\n\n## Examples\n\n```rescript\nInt.toFloat(100) == 100.0\nInt.toFloat(2) == 2.0\n```\n"} - }, { - "label": "Int.toLocaleString", + "documentation": { + "kind": "markdown", + "value": "\n`toFloat(n)` return a `float` representing the given value.\n\n## Examples\n\n```rescript\nInt.toFloat(100) == 100.0\nInt.toFloat(2) == 2.0\n```\n" + }, "kind": 12, - "tags": [], + "label": "Int.toFloat", + "tags": [] + }, + { "detail": "int => string", - "documentation": {"kind": "markdown", "value": "\n`toLocaleString(n)` return a `string` with language-sensitive representing the\ngiven value. See [`Number.toLocaleString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toLocaleString) on MDN.\n\n## Examples\n\n```rescript\n// If the application uses English as the default language\nInt.toLocaleString(1000) // \"1,000\"\n\n// If the application uses Portuguese Brazil as the default language\nInt.toLocaleString(1000) // \"1.000\"\n```\n"} - }, { - "label": "Int.toExponential", + "documentation": { + "kind": "markdown", + "value": "\n`toLocaleString(n)` return a `string` with language-sensitive representing the\ngiven value. See [`Number.toLocaleString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toLocaleString) on MDN.\n\n## Examples\n\n```rescript\n// If the application uses English as the default language\nInt.toLocaleString(1000) // \"1,000\"\n\n// If the application uses Portuguese Brazil as the default language\nInt.toLocaleString(1000) // \"1.000\"\n```\n" + }, "kind": 12, - "tags": [], + "label": "Int.toLocaleString", + "tags": [] + }, + { "detail": "(int, ~digits: int=?) => string", - "documentation": {"kind": "markdown", "value": "\n`toExponential(n, ~digits=?)` return a `string` representing the given value in\nexponential notation. `digits` specifies how many digits should appear after\nthe decimal point. See [`Number.toExponential`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toExponential)\n\n## Examples\n\n```rescript\nInt.toExponential(1000) // \"1e+3\"\nInt.toExponential(-1000) // \"-1e+3\"\nInt.toExponential(77, ~digits=2) // \"7.70e+1\"\nInt.toExponential(5678, ~digits=2) // \"5.68e+3\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` less than 0 or greater than 10.\n"} - }, { - "label": "Int.toFixed", + "documentation": { + "kind": "markdown", + "value": "\n`toExponential(n, ~digits=?)` return a `string` representing the given value in\nexponential notation. `digits` specifies how many digits should appear after\nthe decimal point. See [`Number.toExponential`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toExponential)\n\n## Examples\n\n```rescript\nInt.toExponential(1000) // \"1e+3\"\nInt.toExponential(-1000) // \"-1e+3\"\nInt.toExponential(77, ~digits=2) // \"7.70e+1\"\nInt.toExponential(5678, ~digits=2) // \"5.68e+3\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` less than 0 or greater than 10.\n" + }, "kind": 12, - "tags": [], + "label": "Int.toExponential", + "tags": [] + }, + { "detail": "(int, ~digits: int=?) => string", - "documentation": {"kind": "markdown", "value": "\n`toFixed(n, ~digits=?)` return a `string` representing the given\nvalue using fixed-point notation. `digits` specifies how many digits should\nappear after the decimal point. See [`Number.toFixed`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toFixed)\non MDN.\n\n## Examples\n\n```rescript\nInt.toFixed(123456) // \"123456.00\"\nInt.toFixed(10) // \"10.00\"\nInt.toFixed(300, ~digits=4) // \"300.0000\"\nInt.toFixed(300, ~digits=1) // \"300.0\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` is less than 0 or larger than 100.\n"} - }] + "documentation": { + "kind": "markdown", + "value": "\n`toFixed(n, ~digits=?)` return a `string` representing the given\nvalue using fixed-point notation. `digits` specifies how many digits should\nappear after the decimal point. See [`Number.toFixed`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toFixed)\non MDN.\n\n## Examples\n\n```rescript\nInt.toFixed(123456) // \"123456.00\"\nInt.toFixed(10) // \"10.00\"\nInt.toFixed(300, ~digits=4) // \"300.0000\"\nInt.toFixed(300, ~digits=1) // \"300.0\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` is less than 0 or larger than 100.\n" + }, + "kind": 12, + "label": "Int.toFixed", + "tags": [] + } +] Complete src/Completion.res 422:19 posCursor:[422:19] posNoWhite:[422:18] Found expr:[422:11->422:19] @@ -2615,67 +2993,112 @@ ContextPath float->t ContextPath float Path Stdlib.Float.t Path t -[{ - "label": "Float.toStringWithRadix", - "kind": 12, - "tags": [1], +[ + { + "deprecated": true, "detail": "(float, ~radix: int) => string", - "documentation": {"kind": "markdown", "value": "Deprecated: Use `toString` with `~radix` instead\n\n\n`toStringWithRadix(v, ~radix)` return a `string` representing the given value.\n`~radix` specifies the radix base to use for the formatted number.\nSee [`Number.toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toString) on MDN.\n\n## Examples\n\n```rescript\nFloat.toStringWithRadix(6.0, ~radix=2) == \"110\"\nFloat.toStringWithRadix(3735928559.0, ~radix=16) == \"deadbeef\"\nFloat.toStringWithRadix(123456.0, ~radix=36) == \"2n9c\"\n```\n\n## Exceptions\n\n`RangeError`: if `radix` is less than 2 or greater than 36.\n"} - }, { - "label": "Float.toExponentialWithPrecision", + "documentation": { + "kind": "markdown", + "value": "Deprecated: Use `toString` with `~radix` instead\n\n\n`toStringWithRadix(v, ~radix)` return a `string` representing the given value.\n`~radix` specifies the radix base to use for the formatted number.\nSee [`Number.toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toString) on MDN.\n\n## Examples\n\n```rescript\nFloat.toStringWithRadix(6.0, ~radix=2) == \"110\"\nFloat.toStringWithRadix(3735928559.0, ~radix=16) == \"deadbeef\"\nFloat.toStringWithRadix(123456.0, ~radix=36) == \"2n9c\"\n```\n\n## Exceptions\n\n`RangeError`: if `radix` is less than 2 or greater than 36.\n" + }, "kind": 12, - "tags": [1], + "label": "Float.toStringWithRadix", + "tags": [ 1 ] + }, + { + "deprecated": true, "detail": "(float, ~digits: int) => string", - "documentation": {"kind": "markdown", "value": "Deprecated: Use `toExponential` instead\n\n\n`toExponential(v, ~digits)` return a `string` representing the given value in\nexponential notation. `digits` specifies how many digits should appear after\nthe decimal point.\nSee [`Number.toExponential`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toExponential) on MDN.\n\n## Examples\n\n```rescript\nFloat.toExponentialWithPrecision(77.0, ~digits=2) == \"7.70e+1\"\nFloat.toExponentialWithPrecision(5678.0, ~digits=2) == \"5.68e+3\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` less than 0 or greater than 10.\n"} - }, { - "label": "Float.toInt", + "documentation": { + "kind": "markdown", + "value": "Deprecated: Use `toExponential` instead\n\n\n`toExponential(v, ~digits)` return a `string` representing the given value in\nexponential notation. `digits` specifies how many digits should appear after\nthe decimal point.\nSee [`Number.toExponential`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toExponential) on MDN.\n\n## Examples\n\n```rescript\nFloat.toExponentialWithPrecision(77.0, ~digits=2) == \"7.70e+1\"\nFloat.toExponentialWithPrecision(5678.0, ~digits=2) == \"5.68e+3\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` less than 0 or greater than 10.\n" + }, "kind": 12, - "tags": [], + "label": "Float.toExponentialWithPrecision", + "tags": [ 1 ] + }, + { "detail": "float => int", - "documentation": {"kind": "markdown", "value": "\n`toInt(v)` returns an int to given float `v`.\n\n## Examples\n\n```rescript\nFloat.toInt(2.0) == 2\nFloat.toInt(1.0) == 1\nFloat.toInt(1.1) == 1\nFloat.toInt(1.6) == 1\n```\n"} - }, { - "label": "Float.toFixedWithPrecision", + "documentation": { + "kind": "markdown", + "value": "\n`toInt(v)` returns an int to given float `v`.\n\n## Examples\n\n```rescript\nFloat.toInt(2.0) == 2\nFloat.toInt(1.0) == 1\nFloat.toInt(1.1) == 1\nFloat.toInt(1.6) == 1\n```\n" + }, "kind": 12, - "tags": [1], + "label": "Float.toInt", + "tags": [] + }, + { + "deprecated": true, "detail": "(float, ~digits: int) => string", - "documentation": {"kind": "markdown", "value": "Deprecated: Use `toFixed` instead\n\n\n`toFixedWithPrecision(v, ~digits)` return a `string` representing the given\nvalue using fixed-point notation. `digits` specifies how many digits should\nappear after the decimal point.\nSee [`Number.toFixed`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toFixed) on MDN.\n\n## Examples\n\n```rescript\nFloat.toFixedWithPrecision(300.0, ~digits=4) == \"300.0000\"\nFloat.toFixedWithPrecision(300.0, ~digits=1) == \"300.0\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` is less than 0 or larger than 100.\n"} - }, { - "label": "Float.toPrecisionWithPrecision", + "documentation": { + "kind": "markdown", + "value": "Deprecated: Use `toFixed` instead\n\n\n`toFixedWithPrecision(v, ~digits)` return a `string` representing the given\nvalue using fixed-point notation. `digits` specifies how many digits should\nappear after the decimal point.\nSee [`Number.toFixed`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toFixed) on MDN.\n\n## Examples\n\n```rescript\nFloat.toFixedWithPrecision(300.0, ~digits=4) == \"300.0000\"\nFloat.toFixedWithPrecision(300.0, ~digits=1) == \"300.0\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` is less than 0 or larger than 100.\n" + }, "kind": 12, - "tags": [1], + "label": "Float.toFixedWithPrecision", + "tags": [ 1 ] + }, + { + "deprecated": true, "detail": "(float, ~digits: int) => string", - "documentation": {"kind": "markdown", "value": "Deprecated: Use `toPrecision` instead\n\n\n`toPrecisionWithPrecision(v, ~digits)` return a `string` representing the giver value with\nprecision. `digits` specifies the number of significant digits.\nSee [`Number.toPrecision`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toPrecision) on MDN.\n\n## Examples\n\n```rescript\nFloat.toPrecisionWithPrecision(100.0, ~digits=2) == \"1.0e+2\"\nFloat.toPrecisionWithPrecision(1.0, ~digits=1) == \"1\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` is not between 1 and 100 (inclusive).\n Implementations are allowed to support larger and smaller values as well.\n ECMA-262 only requires a precision of up to 21 significant digits.\n \n"} - }, { - "label": "Float.toPrecision", + "documentation": { + "kind": "markdown", + "value": "Deprecated: Use `toPrecision` instead\n\n\n`toPrecisionWithPrecision(v, ~digits)` return a `string` representing the giver value with\nprecision. `digits` specifies the number of significant digits.\nSee [`Number.toPrecision`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toPrecision) on MDN.\n\n## Examples\n\n```rescript\nFloat.toPrecisionWithPrecision(100.0, ~digits=2) == \"1.0e+2\"\nFloat.toPrecisionWithPrecision(1.0, ~digits=1) == \"1\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` is not between 1 and 100 (inclusive).\n Implementations are allowed to support larger and smaller values as well.\n ECMA-262 only requires a precision of up to 21 significant digits.\n \n" + }, "kind": 12, - "tags": [], + "label": "Float.toPrecisionWithPrecision", + "tags": [ 1 ] + }, + { "detail": "(float, ~digits: int=?) => string", - "documentation": {"kind": "markdown", "value": "\n`toPrecision(v, ~digits=?)` return a `string` representing the giver value with\nprecision. `digits` specifies the number of significant digits.\nSee [`Number.toPrecision`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toPrecision) on MDN.\n\n## Examples\n\n```rescript\nFloat.toPrecision(100.0) == \"100\"\nFloat.toPrecision(1.0) == \"1\"\nFloat.toPrecision(100.0, ~digits=2) == \"1.0e+2\"\nFloat.toPrecision(1.0, ~digits=1) == \"1\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` is not between 1 and 100 (inclusive).\n Implementations are allowed to support larger and smaller values as well.\n ECMA-262 only requires a precision of up to 21 significant digits.\n"} - }, { - "label": "Float.toString", + "documentation": { + "kind": "markdown", + "value": "\n`toPrecision(v, ~digits=?)` return a `string` representing the giver value with\nprecision. `digits` specifies the number of significant digits.\nSee [`Number.toPrecision`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toPrecision) on MDN.\n\n## Examples\n\n```rescript\nFloat.toPrecision(100.0) == \"100\"\nFloat.toPrecision(1.0) == \"1\"\nFloat.toPrecision(100.0, ~digits=2) == \"1.0e+2\"\nFloat.toPrecision(1.0, ~digits=1) == \"1\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` is not between 1 and 100 (inclusive).\n Implementations are allowed to support larger and smaller values as well.\n ECMA-262 only requires a precision of up to 21 significant digits.\n" + }, "kind": 12, - "tags": [], + "label": "Float.toPrecision", + "tags": [] + }, + { "detail": "(float, ~radix: int=?) => string", - "documentation": {"kind": "markdown", "value": "\n`toString(v)` return a `string` representing the given value.\nSee [`Number.toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toString) on MDN.\n\n## Examples\n\n```rescript\nFloat.toString(1000.0) == \"1000\"\nFloat.toString(-1000.0) == \"-1000\"\n```\n"} - }, { - "label": "Float.toLocaleString", + "documentation": { + "kind": "markdown", + "value": "\n`toString(v)` return a `string` representing the given value.\nSee [`Number.toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toString) on MDN.\n\n## Examples\n\n```rescript\nFloat.toString(1000.0) == \"1000\"\nFloat.toString(-1000.0) == \"-1000\"\n```\n" + }, "kind": 12, - "tags": [], + "label": "Float.toString", + "tags": [] + }, + { "detail": "float => string", - "documentation": {"kind": "markdown", "value": "\n`toLocaleString(v)` return a `string` with language-sensitive representing the\ngiven value.\nSee [`Number.toLocaleString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toLocaleString) on MDN.\n\n## Examples\n\n```rescript\n// If the application uses English as the default language\nFloat.toLocaleString(1000.0) // \"1,000\"\n\n// If the application uses Portuguese Brazil as the default language\nFloat.toLocaleString(1000.0) // \"1.000\"\n```\n"} - }, { - "label": "Float.toExponential", + "documentation": { + "kind": "markdown", + "value": "\n`toLocaleString(v)` return a `string` with language-sensitive representing the\ngiven value.\nSee [`Number.toLocaleString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toLocaleString) on MDN.\n\n## Examples\n\n```rescript\n// If the application uses English as the default language\nFloat.toLocaleString(1000.0) // \"1,000\"\n\n// If the application uses Portuguese Brazil as the default language\nFloat.toLocaleString(1000.0) // \"1.000\"\n```\n" + }, "kind": 12, - "tags": [], + "label": "Float.toLocaleString", + "tags": [] + }, + { "detail": "(float, ~digits: int=?) => string", - "documentation": {"kind": "markdown", "value": "\n`toExponential(v, ~digits=?)` return a `string` representing the given value in\nexponential notation. `digits` specifies how many digits should appear after\nthe decimal point.\nSee [`Number.toExponential`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toExponential) on MDN.\n\n## Examples\n\n```rescript\nFloat.toExponential(1000.0) == \"1e+3\"\nFloat.toExponential(-1000.0) == \"-1e+3\"\nFloat.toExponential(77.0, ~digits=2) == \"7.70e+1\"\nFloat.toExponential(5678.0, ~digits=2) == \"5.68e+3\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` less than 0 or greater than 10.\n"} - }, { - "label": "Float.toFixed", + "documentation": { + "kind": "markdown", + "value": "\n`toExponential(v, ~digits=?)` return a `string` representing the given value in\nexponential notation. `digits` specifies how many digits should appear after\nthe decimal point.\nSee [`Number.toExponential`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toExponential) on MDN.\n\n## Examples\n\n```rescript\nFloat.toExponential(1000.0) == \"1e+3\"\nFloat.toExponential(-1000.0) == \"-1e+3\"\nFloat.toExponential(77.0, ~digits=2) == \"7.70e+1\"\nFloat.toExponential(5678.0, ~digits=2) == \"5.68e+3\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` less than 0 or greater than 10.\n" + }, "kind": 12, - "tags": [], + "label": "Float.toExponential", + "tags": [] + }, + { "detail": "(float, ~digits: int=?) => string", - "documentation": {"kind": "markdown", "value": "\n`toFixed(v, ~digits=?)` return a `string` representing the given\nvalue using fixed-point notation. `digits` specifies how many digits should\nappear after the decimal point.\nSee [`Number.toFixed`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toFixed) on MDN.\n\n## Examples\n\n```rescript\nFloat.toFixed(123456.0) == \"123456\"\nFloat.toFixed(10.0) == \"10\"\nFloat.toFixed(300.0, ~digits=4) == \"300.0000\"\nFloat.toFixed(300.0, ~digits=1) == \"300.0\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` is less than 0 or larger than 100.\n"} - }] + "documentation": { + "kind": "markdown", + "value": "\n`toFixed(v, ~digits=?)` return a `string` representing the given\nvalue using fixed-point notation. `digits` specifies how many digits should\nappear after the decimal point.\nSee [`Number.toFixed`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toFixed) on MDN.\n\n## Examples\n\n```rescript\nFloat.toFixed(123456.0) == \"123456\"\nFloat.toFixed(10.0) == \"10\"\nFloat.toFixed(300.0, ~digits=4) == \"300.0000\"\nFloat.toFixed(300.0, ~digits=1) == \"300.0\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` is less than 0 or larger than 100.\n" + }, + "kind": 12, + "label": "Float.toFixed", + "tags": [] + } +] Complete src/Completion.res 427:8 posCursor:[427:8] posNoWhite:[427:7] Found expr:[427:3->427:8] @@ -2688,31 +3111,50 @@ ContextPath Value[ok] Path ok Path Stdlib.Result.g Path g -[{ - "label": "Result.getExn", - "kind": 12, - "tags": [1], +[ + { + "deprecated": true, "detail": "(result<'a, 'b>, ~message: string=?) => 'a", - "documentation": {"kind": "markdown", "value": "Deprecated: Use 'getOrThrow' instead\n\n\n `getExn(res, ~message=?)` returns `n` if `res` is `Ok(n)`, otherwise throws an exception with the message provided, or a generic message if no message was provided.\n\n ```res example\n Result.getExn(Result.Ok(42)) == 42\n \n switch Result.getExn(Error(\"Invalid data\")) {\n | exception _ => true\n | _ => false\n } == true\n\n switch Result.getExn(Error(\"Invalid data\"), ~message=\"was Error!\") {\n | exception _ => true // Throws a JsError with the message \"was Error!\"\n | _ => false\n } == true\n ```\n"} - }, { - "label": "Result.getOrThrow", + "documentation": { + "kind": "markdown", + "value": "Deprecated: Use 'getOrThrow' instead\n\n\n `getExn(res, ~message=?)` returns `n` if `res` is `Ok(n)`, otherwise throws an exception with the message provided, or a generic message if no message was provided.\n\n ```res example\n Result.getExn(Result.Ok(42)) == 42\n \n switch Result.getExn(Error(\"Invalid data\")) {\n | exception _ => true\n | _ => false\n } == true\n\n switch Result.getExn(Error(\"Invalid data\"), ~message=\"was Error!\") {\n | exception _ => true // Throws a JsError with the message \"was Error!\"\n | _ => false\n } == true\n ```\n" + }, "kind": 12, - "tags": [], + "label": "Result.getExn", + "tags": [ 1 ] + }, + { "detail": "(result<'a, 'b>, ~message: string=?) => 'a", - "documentation": {"kind": "markdown", "value": "\n `getOrThrow(res, ~message=?)` returns `n` if `res` is `Ok(n)`, otherwise throws an exception with the message provided, or a generic message if no message was provided.\n\n ```res example\n Result.getOrThrow(Result.Ok(42)) == 42\n \n switch Result.getOrThrow(Error(\"Invalid data\")) {\n | exception _ => true\n | _ => false\n } == true\n\n switch Result.getOrThrow(Error(\"Invalid data\"), ~message=\"was Error!\") {\n | exception _ => true // Throws a JsError with the message \"was Error!\"\n | _ => false\n } == true\n ```\n"} - }, { - "label": "Result.getOr", + "documentation": { + "kind": "markdown", + "value": "\n `getOrThrow(res, ~message=?)` returns `n` if `res` is `Ok(n)`, otherwise throws an exception with the message provided, or a generic message if no message was provided.\n\n ```res example\n Result.getOrThrow(Result.Ok(42)) == 42\n \n switch Result.getOrThrow(Error(\"Invalid data\")) {\n | exception _ => true\n | _ => false\n } == true\n\n switch Result.getOrThrow(Error(\"Invalid data\"), ~message=\"was Error!\") {\n | exception _ => true // Throws a JsError with the message \"was Error!\"\n | _ => false\n } == true\n ```\n" + }, "kind": 12, - "tags": [], + "label": "Result.getOrThrow", + "tags": [] + }, + { "detail": "(result<'a, 'b>, 'a) => 'a", - "documentation": {"kind": "markdown", "value": "\n`getOr(res, defaultValue)`: If `res` is `Ok(n)`, returns `n`, otherwise `default`\n\n## Examples\n\n```rescript\nResult.getOr(Ok(42), 0) == 42\n\nResult.getOr(Error(\"Invalid Data\"), 0) == 0\n```\n"} - }, { - "label": "Result.getWithDefault", + "documentation": { + "kind": "markdown", + "value": "\n`getOr(res, defaultValue)`: If `res` is `Ok(n)`, returns `n`, otherwise `default`\n\n## Examples\n\n```rescript\nResult.getOr(Ok(42), 0) == 42\n\nResult.getOr(Error(\"Invalid Data\"), 0) == 0\n```\n" + }, "kind": 12, - "tags": [1], + "label": "Result.getOr", + "tags": [] + }, + { + "deprecated": true, "detail": "(result<'a, 'b>, 'a) => 'a", - "documentation": {"kind": "markdown", "value": "Deprecated: Use getOr instead\n\n"} - }] + "documentation": { + "kind": "markdown", + "value": "Deprecated: Use getOr instead\n\n" + }, + "kind": 12, + "label": "Result.getWithDefault", + "tags": [ 1 ] + } +] Complete src/Completion.res 445:15 posCursor:[445:15] posNoWhite:[445:14] Found expr:[445:3->445:15] @@ -2730,19 +3172,30 @@ Path rWithDepr CPPipe pathFromEnv: found:true Path Completion.so Path so -[{ - "label": "someInt", - "kind": 5, - "tags": [1], +[ + { + "deprecated": true, "detail": "int", - "documentation": {"kind": "markdown", "value": "Deprecated: \n\n```rescript\nsomeInt: int\n```\n\n```rescript\ntype someRecordWithDeprecatedField = {\n name: string,\n someInt: int,\n someFloat: float,\n}\n```"} - }, { - "label": "someFloat", + "documentation": { + "kind": "markdown", + "value": "Deprecated: \n\n```rescript\nsomeInt: int\n```\n\n```rescript\ntype someRecordWithDeprecatedField = {\n name: string,\n someInt: int,\n someFloat: float,\n}\n```" + }, "kind": 5, - "tags": [1], + "label": "someInt", + "tags": [ 1 ] + }, + { + "deprecated": true, "detail": "float", - "documentation": {"kind": "markdown", "value": "Deprecated: Use 'someInt'.\n\n```rescript\nsomeFloat: float\n```\n\n```rescript\ntype someRecordWithDeprecatedField = {\n name: string,\n someInt: int,\n someFloat: float,\n}\n```"} - }] + "documentation": { + "kind": "markdown", + "value": "Deprecated: Use 'someInt'.\n\n```rescript\nsomeFloat: float\n```\n\n```rescript\ntype someRecordWithDeprecatedField = {\n name: string,\n someInt: int,\n someFloat: float,\n}\n```" + }, + "kind": 5, + "label": "someFloat", + "tags": [ 1 ] + } +] Complete src/Completion.res 452:37 XXX Not found! @@ -2752,31 +3205,46 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 3 Stdlib Completion Completion ContextPath Type[someVariantWithDeprecated] Path someVariantWithDeprecated -[{ - "label": "DoNotUseMe", - "kind": 4, - "tags": [1], +[ + { + "deprecated": true, "detail": "DoNotUseMe", - "documentation": {"kind": "markdown", "value": "Deprecated: \n\n```rescript\nDoNotUseMe\n```\n\n```rescript\ntype someVariantWithDeprecated =\n | DoNotUseMe\n | UseMeInstead\n | AndNotMe\n```"}, + "documentation": { + "kind": "markdown", + "value": "Deprecated: \n\n```rescript\nDoNotUseMe\n```\n\n```rescript\ntype someVariantWithDeprecated =\n | DoNotUseMe\n | UseMeInstead\n | AndNotMe\n```" + }, "insertText": "DoNotUseMe", - "insertTextFormat": 2 - }, { - "label": "UseMeInstead", + "insertTextFormat": 2, "kind": 4, - "tags": [], + "label": "DoNotUseMe", + "tags": [ 1 ] + }, + { "detail": "UseMeInstead", - "documentation": {"kind": "markdown", "value": "```rescript\nUseMeInstead\n```\n\n```rescript\ntype someVariantWithDeprecated =\n | DoNotUseMe\n | UseMeInstead\n | AndNotMe\n```"}, + "documentation": { + "kind": "markdown", + "value": "```rescript\nUseMeInstead\n```\n\n```rescript\ntype someVariantWithDeprecated =\n | DoNotUseMe\n | UseMeInstead\n | AndNotMe\n```" + }, "insertText": "UseMeInstead", - "insertTextFormat": 2 - }, { - "label": "AndNotMe", + "insertTextFormat": 2, "kind": 4, - "tags": [1], + "label": "UseMeInstead", + "tags": [] + }, + { + "deprecated": true, "detail": "AndNotMe", - "documentation": {"kind": "markdown", "value": "Deprecated: Use 'UseMeInstead'\n\n```rescript\nAndNotMe\n```\n\n```rescript\ntype someVariantWithDeprecated =\n | DoNotUseMe\n | UseMeInstead\n | AndNotMe\n```"}, + "documentation": { + "kind": "markdown", + "value": "Deprecated: Use 'UseMeInstead'\n\n```rescript\nAndNotMe\n```\n\n```rescript\ntype someVariantWithDeprecated =\n | DoNotUseMe\n | UseMeInstead\n | AndNotMe\n```" + }, "insertText": "AndNotMe", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 4, + "label": "AndNotMe", + "tags": [ 1 ] + } +] Complete src/Completion.res 457:28 posCursor:[457:28] posNoWhite:[457:27] Found expr:[457:11->457:28] @@ -2790,19 +3258,29 @@ ContextPath Value[uncurried] Path uncurried Path Stdlib.Int.toS Path toS -[{ - "label": "Int.toStringWithRadix", - "kind": 12, - "tags": [1], +[ + { + "deprecated": true, "detail": "(int, ~radix: int) => string", - "documentation": {"kind": "markdown", "value": "Deprecated: Use `toString` instead\n\n\n`toStringWithRadix(n, ~radix)` return a `string` representing the given value.\n`~radix` specifies the radix base to use for the formatted number.\nSee [`Number.toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toString)\non MDN.\n\n## Examples\n\n```rescript\nInt.toStringWithRadix(6, ~radix=2) // \"110\"\nInt.toStringWithRadix(373592855, ~radix=16) // \"16449317\"\nInt.toStringWithRadix(123456, ~radix=36) // \"2n9c\"\n```\n\n## Exceptions\n\n`RangeError`: if `radix` is less than 2 or greater than 36.\n"} - }, { - "label": "Int.toString", + "documentation": { + "kind": "markdown", + "value": "Deprecated: Use `toString` instead\n\n\n`toStringWithRadix(n, ~radix)` return a `string` representing the given value.\n`~radix` specifies the radix base to use for the formatted number.\nSee [`Number.toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toString)\non MDN.\n\n## Examples\n\n```rescript\nInt.toStringWithRadix(6, ~radix=2) // \"110\"\nInt.toStringWithRadix(373592855, ~radix=16) // \"16449317\"\nInt.toStringWithRadix(123456, ~radix=36) // \"2n9c\"\n```\n\n## Exceptions\n\n`RangeError`: if `radix` is less than 2 or greater than 36.\n" + }, "kind": 12, - "tags": [], + "label": "Int.toStringWithRadix", + "tags": [ 1 ] + }, + { "detail": "(int, ~radix: int=?) => string", - "documentation": {"kind": "markdown", "value": "\n`toString(n, ~radix=?)` return a `string` representing the given value.\n`~radix` specifies the radix base to use for the formatted number.\nSee [`Number.toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toString)\non MDN.\n\n## Examples\n\n```rescript\nInt.toString(1000) // \"1000\"\nInt.toString(-1000) // \"-1000\"\nInt.toString(6, ~radix=2) // \"110\"\nInt.toString(373592855, ~radix=16) // \"16449317\"\nInt.toString(123456, ~radix=36) // \"2n9c\"\n```\n\n## Exceptions\n\n`RangeError`: if `radix` is less than 2 or greater than 36.\n"} - }] + "documentation": { + "kind": "markdown", + "value": "\n`toString(n, ~radix=?)` return a `string` representing the given value.\n`~radix` specifies the radix base to use for the formatted number.\nSee [`Number.toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toString)\non MDN.\n\n## Examples\n\n```rescript\nInt.toString(1000) // \"1000\"\nInt.toString(-1000) // \"-1000\"\nInt.toString(6, ~radix=2) // \"110\"\nInt.toString(373592855, ~radix=16) // \"16449317\"\nInt.toString(123456, ~radix=36) // \"2n9c\"\n```\n\n## Exceptions\n\n`RangeError`: if `radix` is less than 2 or greater than 36.\n" + }, + "kind": 12, + "label": "Int.toString", + "tags": [] + } +] Complete src/Completion.res 462:30 XXX Not found! @@ -2812,16 +3290,17 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 3 Stdlib Completion Completion ContextPath Type[withUncurried] Path withUncurried -[{ - "label": "v => v", - "kind": 12, - "tags": [], +[ + { "detail": "int => unit", - "documentation": null, - "sortText": "A", "insertText": "${1:v} => ${0:v}", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 12, + "label": "v => v", + "sortText": "A", + "tags": [] + } +] Complete src/Completion.res 465:26 posCursor:[465:26] posNoWhite:[465:25] Found expr:[465:22->465:26] @@ -2832,25 +3311,38 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 3 Stdlib Completion Completion ContextPath ValueOrField[FAR, ""] Path FAR. -[{ - "label": "forAutoRecord", - "kind": 12, - "tags": [], +[ + { "detail": "forAutoRecord", - "documentation": {"kind": "markdown", "value": "```rescript\ntype forAutoRecord = {\n forAuto: ForAuto.t,\n something: option,\n}\n```"} - }, { - "label": "forAuto", - "kind": 5, - "tags": [], + "documentation": { + "kind": "markdown", + "value": "```rescript\ntype forAutoRecord = {\n forAuto: ForAuto.t,\n something: option,\n}\n```" + }, + "kind": 12, + "label": "forAutoRecord", + "tags": [] + }, + { "detail": "ForAuto.t", - "documentation": {"kind": "markdown", "value": "```rescript\nforAuto: ForAuto.t\n```\n\n```rescript\ntype forAutoRecord = {\n forAuto: ForAuto.t,\n something: option,\n}\n```"} - }, { - "label": "something", + "documentation": { + "kind": "markdown", + "value": "```rescript\nforAuto: ForAuto.t\n```\n\n```rescript\ntype forAutoRecord = {\n forAuto: ForAuto.t,\n something: option,\n}\n```" + }, "kind": 5, - "tags": [], + "label": "forAuto", + "tags": [] + }, + { "detail": "option", - "documentation": {"kind": "markdown", "value": "```rescript\nsomething: option\n```\n\n```rescript\ntype forAutoRecord = {\n forAuto: ForAuto.t,\n something: option,\n}\n```"} - }] + "documentation": { + "kind": "markdown", + "value": "```rescript\nsomething: option\n```\n\n```rescript\ntype forAutoRecord = {\n forAuto: ForAuto.t,\n something: option,\n}\n```" + }, + "kind": 5, + "label": "something", + "tags": [] + } +] Complete src/Completion.res 471:45 XXX Not found! @@ -2860,19 +3352,28 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 3 Stdlib Completion Completion ContextPath Type[someVariantWithRecord] Path someVariantWithRecord -[{ - "label": "field1", - "kind": 5, - "tags": [], +[ + { "detail": "string", - "documentation": {"kind": "markdown", "value": "```rescript\nfield1: string\n```\n\n```rescript\ntype someRecord = {field1: string, field2: int}\n```"} - }, { - "label": "field2", + "documentation": { + "kind": "markdown", + "value": "```rescript\nfield1: string\n```\n\n```rescript\ntype someRecord = {field1: string, field2: int}\n```" + }, "kind": 5, - "tags": [], + "label": "field1", + "tags": [] + }, + { "detail": "int", - "documentation": {"kind": "markdown", "value": "```rescript\nfield2: int\n```\n\n```rescript\ntype someRecord = {field1: string, field2: int}\n```"} - }] + "documentation": { + "kind": "markdown", + "value": "```rescript\nfield2: int\n```\n\n```rescript\ntype someRecord = {field1: string, field2: int}\n```" + }, + "kind": 5, + "label": "field2", + "tags": [] + } +] Complete src/Completion.res 474:48 XXX Not found! @@ -2882,19 +3383,28 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 3 Stdlib Completion Completion ContextPath Type[someVariantWithRecord] Path someVariantWithRecord -[{ - "label": "field1", - "kind": 5, - "tags": [], +[ + { "detail": "string", - "documentation": {"kind": "markdown", "value": "```rescript\nfield1: string\n```\n\n```rescript\ntype someRecord = {field1: string, field2: int}\n```"} - }, { - "label": "field2", + "documentation": { + "kind": "markdown", + "value": "```rescript\nfield1: string\n```\n\n```rescript\ntype someRecord = {field1: string, field2: int}\n```" + }, "kind": 5, - "tags": [], + "label": "field1", + "tags": [] + }, + { "detail": "int", - "documentation": {"kind": "markdown", "value": "```rescript\nfield2: int\n```\n\n```rescript\ntype someRecord = {field1: string, field2: int}\n```"} - }] + "documentation": { + "kind": "markdown", + "value": "```rescript\nfield2: int\n```\n\n```rescript\ntype someRecord = {field1: string, field2: int}\n```" + }, + "kind": 5, + "label": "field2", + "tags": [] + } +] Complete src/Completion.res 479:57 XXX Not found! @@ -2904,19 +3414,28 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 3 Stdlib Completion Completion ContextPath Type[someVariantWithInlineRecord] Path someVariantWithInlineRecord -[{ - "label": "field1", - "kind": 5, - "tags": [], +[ + { "detail": "string", - "documentation": {"kind": "markdown", "value": "```rescript\nfield1: string\n```\n\n```rescript\n{field1: string, field2: int}\n```"} - }, { - "label": "field2", + "documentation": { + "kind": "markdown", + "value": "```rescript\nfield1: string\n```\n\n```rescript\n{field1: string, field2: int}\n```" + }, "kind": 5, - "tags": [], + "label": "field1", + "tags": [] + }, + { "detail": "int", - "documentation": {"kind": "markdown", "value": "```rescript\nfield2: int\n```\n\n```rescript\n{field1: string, field2: int}\n```"} - }] + "documentation": { + "kind": "markdown", + "value": "```rescript\nfield2: int\n```\n\n```rescript\n{field1: string, field2: int}\n```" + }, + "kind": 5, + "label": "field2", + "tags": [] + } +] Complete src/Completion.res 482:60 XXX Not found! @@ -2926,17 +3445,26 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 3 Stdlib Completion Completion ContextPath Type[someVariantWithInlineRecord] Path someVariantWithInlineRecord -[{ - "label": "field1", - "kind": 5, - "tags": [], +[ + { "detail": "string", - "documentation": {"kind": "markdown", "value": "```rescript\nfield1: string\n```\n\n```rescript\n{field1: string, field2: int}\n```"} - }, { - "label": "field2", + "documentation": { + "kind": "markdown", + "value": "```rescript\nfield1: string\n```\n\n```rescript\n{field1: string, field2: int}\n```" + }, "kind": 5, - "tags": [], + "label": "field1", + "tags": [] + }, + { "detail": "int", - "documentation": {"kind": "markdown", "value": "```rescript\nfield2: int\n```\n\n```rescript\n{field1: string, field2: int}\n```"} - }] + "documentation": { + "kind": "markdown", + "value": "```rescript\nfield2: int\n```\n\n```rescript\n{field1: string, field2: int}\n```" + }, + "kind": 5, + "label": "field2", + "tags": [] + } +] diff --git a/tests/analysis_tests/tests/src/expected/CompletionAttributes.res.txt b/tests/analysis_tests/tests/src/expected/CompletionAttributes.res.txt index 1c7c3fb9df5..ee833853eec 100644 --- a/tests/analysis_tests/tests/src/expected/CompletionAttributes.res.txt +++ b/tests/analysis_tests/tests/src/expected/CompletionAttributes.res.txt @@ -3,252 +3,272 @@ Attribute id:modu:[0:3->0:8] label:modu Completable: Cdecorator(modu) Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib -[{ - "label": "module", - "kind": 4, - "tags": [], +[ + { "detail": "", - "documentation": {"kind": "markdown", "value": "The `@module` decorator is used to bind to a JavaScript module.\n\n[Read more and see examples in the documentation](https://rescript-lang.org/syntax-lookup#module-decorator)."}, + "documentation": { + "kind": "markdown", + "value": "The `@module` decorator is used to bind to a JavaScript module.\n\n[Read more and see examples in the documentation](https://rescript-lang.org/syntax-lookup#module-decorator)." + }, "insertText": "module(\"$0\")", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 4, + "label": "module", + "tags": [] + } +] Complete src/CompletionAttributes.res 3:12 XXX Not found! Completable: CdecoratorPayload(module=) Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib -[{ - "label": "@rescript/react", - "kind": 4, - "tags": [], - "detail": "Package", - "documentation": null - }, { - "label": "./test.json", - "kind": 4, - "tags": [], - "detail": "Local file", - "documentation": null - }, { - "label": "./tst.js", - "kind": 4, - "tags": [], - "detail": "Local file", - "documentation": null - }] +[ + { "detail": "Package", "kind": 4, "label": "@rescript/react", "tags": [] }, + { "detail": "Local file", "kind": 4, "label": "./test.json", "tags": [] }, + { "detail": "Local file", "kind": 4, "label": "./tst.js", "tags": [] } +] Complete src/CompletionAttributes.res 6:7 Attribute id:js:[6:3->6:7] label:@js Completable: Cdecorator(@js) Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib -[{ - "label": "jsxConfig", - "kind": 4, - "tags": [], +[ + { "detail": "", - "documentation": {"kind": "markdown", "value": "The `@@jsxConfig` decorator is used to change the config for JSX on the fly.\n\n[Read more and see examples in the documentation](https://rescript-lang.org/docs/manual/latest/jsx#file-level-configuration)."}, + "documentation": { + "kind": "markdown", + "value": "The `@@jsxConfig` decorator is used to change the config for JSX on the fly.\n\n[Read more and see examples in the documentation](https://rescript-lang.org/docs/manual/latest/jsx#file-level-configuration)." + }, "insertText": "jsxConfig({$0})", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 4, + "label": "jsxConfig", + "tags": [] + } +] Complete src/CompletionAttributes.res 9:16 XXX Not found! Completable: JsxConfig Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib -[{ - "label": "version", - "kind": 5, - "tags": [], +[ + { "detail": "int", - "documentation": {"kind": "markdown", "value": "```rescript\nversion?: int\n```\n\n```rescript\ntype jsxConfig = {version: int, module_: string, mode: string}\n```"} - }, { - "label": "module_", + "documentation": { + "kind": "markdown", + "value": "```rescript\nversion?: int\n```\n\n```rescript\ntype jsxConfig = {version: int, module_: string, mode: string}\n```" + }, "kind": 5, - "tags": [], + "label": "version", + "tags": [] + }, + { "detail": "string", - "documentation": {"kind": "markdown", "value": "```rescript\nmodule_?: string\n```\n\n```rescript\ntype jsxConfig = {version: int, module_: string, mode: string}\n```"} - }, { - "label": "mode", + "documentation": { + "kind": "markdown", + "value": "```rescript\nmodule_?: string\n```\n\n```rescript\ntype jsxConfig = {version: int, module_: string, mode: string}\n```" + }, "kind": 5, - "tags": [], + "label": "module_", + "tags": [] + }, + { "detail": "string", - "documentation": {"kind": "markdown", "value": "```rescript\nmode?: string\n```\n\n```rescript\ntype jsxConfig = {version: int, module_: string, mode: string}\n```"} - }] + "documentation": { + "kind": "markdown", + "value": "```rescript\nmode?: string\n```\n\n```rescript\ntype jsxConfig = {version: int, module_: string, mode: string}\n```" + }, + "kind": 5, + "label": "mode", + "tags": [] + } +] Complete src/CompletionAttributes.res 12:17 XXX Not found! Completable: JsxConfig Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib -[{ - "label": "module_", - "kind": 5, - "tags": [], +[ + { "detail": "string", - "documentation": {"kind": "markdown", "value": "```rescript\nmodule_?: string\n```\n\n```rescript\ntype jsxConfig = {version: int, module_: string, mode: string}\n```"} - }, { - "label": "mode", + "documentation": { + "kind": "markdown", + "value": "```rescript\nmodule_?: string\n```\n\n```rescript\ntype jsxConfig = {version: int, module_: string, mode: string}\n```" + }, "kind": 5, - "tags": [], + "label": "module_", + "tags": [] + }, + { "detail": "string", - "documentation": {"kind": "markdown", "value": "```rescript\nmode?: string\n```\n\n```rescript\ntype jsxConfig = {version: int, module_: string, mode: string}\n```"} - }] + "documentation": { + "kind": "markdown", + "value": "```rescript\nmode?: string\n```\n\n```rescript\ntype jsxConfig = {version: int, module_: string, mode: string}\n```" + }, + "kind": 5, + "label": "mode", + "tags": [] + } +] Complete src/CompletionAttributes.res 15:25 XXX Not found! Completable: JsxConfig Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib -[{ - "label": "\"\"", - "kind": 12, - "tags": [], +[ + { "detail": "string", - "documentation": null, - "sortText": "A", "insertText": "\"$0\"", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 12, + "label": "\"\"", + "sortText": "A", + "tags": [] + } +] Complete src/CompletionAttributes.res 18:29 XXX Not found! Completable: JsxConfig Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib -[{ - "label": "version", - "kind": 5, - "tags": [], +[ + { "detail": "int", - "documentation": {"kind": "markdown", "value": "```rescript\nversion?: int\n```\n\n```rescript\ntype jsxConfig = {version: int, module_: string, mode: string}\n```"} - }, { - "label": "mode", + "documentation": { + "kind": "markdown", + "value": "```rescript\nversion?: int\n```\n\n```rescript\ntype jsxConfig = {version: int, module_: string, mode: string}\n```" + }, "kind": 5, - "tags": [], + "label": "version", + "tags": [] + }, + { "detail": "string", - "documentation": {"kind": "markdown", "value": "```rescript\nmode?: string\n```\n\n```rescript\ntype jsxConfig = {version: int, module_: string, mode: string}\n```"} - }] + "documentation": { + "kind": "markdown", + "value": "```rescript\nmode?: string\n```\n\n```rescript\ntype jsxConfig = {version: int, module_: string, mode: string}\n```" + }, + "kind": 5, + "label": "mode", + "tags": [] + } +] Complete src/CompletionAttributes.res 21:12 XXX Not found! Completable: CdecoratorPayload(moduleWithImportAttributes) Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib -[{ - "label": "from", - "kind": 5, - "tags": [], +[ + { "detail": "string", - "documentation": {"kind": "markdown", "value": "```rescript\nfrom?: string\n```\n\n```rescript\ntype moduleConfig = {from: string, with: string}\n```"} - }, { - "label": "with", + "documentation": { + "kind": "markdown", + "value": "```rescript\nfrom?: string\n```\n\n```rescript\ntype moduleConfig = {from: string, with: string}\n```" + }, "kind": 5, - "tags": [], + "label": "from", + "tags": [] + }, + { "detail": "string", - "documentation": {"kind": "markdown", "value": "```rescript\nwith?: string\n```\n\n```rescript\ntype moduleConfig = {from: string, with: string}\n```"} - }] + "documentation": { + "kind": "markdown", + "value": "```rescript\nwith?: string\n```\n\n```rescript\ntype moduleConfig = {from: string, with: string}\n```" + }, + "kind": 5, + "label": "with", + "tags": [] + } +] Complete src/CompletionAttributes.res 24:17 XXX Not found! Completable: CdecoratorPayload(moduleWithImportAttributes) Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib -[{ - "label": "{}", - "kind": 12, - "tags": [], +[ + { "detail": "importAttributesConfig", - "documentation": {"kind": "markdown", "value": "```rescript\ntype importAttributesConfig = {type_: string}\n```"}, - "sortText": "A", + "documentation": { + "kind": "markdown", + "value": "```rescript\ntype importAttributesConfig = {type_: string}\n```" + }, "insertText": "{$0}", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 12, + "label": "{}", + "sortText": "A", + "tags": [] + } +] Complete src/CompletionAttributes.res 27:19 XXX Not found! Completable: CdecoratorPayload(moduleWithImportAttributes) Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib -[{ - "label": "type_", - "kind": 5, - "tags": [], +[ + { "detail": "string", - "documentation": {"kind": "markdown", "value": "```rescript\ntype_?: string\n```\n\n```rescript\ntype importAttributesConfig = {type_: string}\n```"} - }] + "documentation": { + "kind": "markdown", + "value": "```rescript\ntype_?: string\n```\n\n```rescript\ntype importAttributesConfig = {type_: string}\n```" + }, + "kind": 5, + "label": "type_", + "tags": [] + } +] Complete src/CompletionAttributes.res 30:19 XXX Not found! Completable: CdecoratorPayload(module=) Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib -[{ - "label": "@rescript/react", - "kind": 4, - "tags": [], - "detail": "Package", - "documentation": null - }, { - "label": "./test.json", - "kind": 4, - "tags": [], - "detail": "Local file", - "documentation": null - }, { - "label": "./tst.js", - "kind": 4, - "tags": [], - "detail": "Local file", - "documentation": null - }] +[ + { "detail": "Package", "kind": 4, "label": "@rescript/react", "tags": [] }, + { "detail": "Local file", "kind": 4, "label": "./test.json", "tags": [] }, + { "detail": "Local file", "kind": 4, "label": "./tst.js", "tags": [] } +] Complete src/CompletionAttributes.res 33:17 XXX Not found! Completable: CdecoratorPayload(module=) Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib -[{ - "label": "@rescript/react", - "kind": 4, - "tags": [], - "detail": "Package", - "documentation": null - }, { - "label": "./test.json", - "kind": 4, - "tags": [], - "detail": "Local file", - "documentation": null - }, { - "label": "./tst.js", - "kind": 4, - "tags": [], - "detail": "Local file", - "documentation": null - }] +[ + { "detail": "Package", "kind": 4, "label": "@rescript/react", "tags": [] }, + { "detail": "Local file", "kind": 4, "label": "./test.json", "tags": [] }, + { "detail": "Local file", "kind": 4, "label": "./tst.js", "tags": [] } +] Complete src/CompletionAttributes.res 36:14 posCursor:[36:14] posNoWhite:[36:13] Found expr:[36:12->36:14] Completable: CextensionNode(t) Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib -[{ - "label": "todo", - "kind": 4, - "tags": [], +[ + { "detail": "`%todo` is used to tell the compiler that some code still needs to be implemented.", - "documentation": null, - "insertText": "todo" - }, { - "label": "todo (with payload)", + "insertText": "todo", "kind": 4, - "tags": [], + "label": "todo", + "tags": [] + }, + { "detail": "`%todo` is used to tell the compiler that some code still needs to be implemented. With a payload.", - "documentation": null, "insertText": "todo(\"${0:TODO}\")", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 4, + "label": "todo (with payload)", + "tags": [] + } +] diff --git a/tests/analysis_tests/tests/src/expected/CompletionConfiguredBuiltins.res.txt b/tests/analysis_tests/tests/src/expected/CompletionConfiguredBuiltins.res.txt index bb2bf05e4e4..16b2766451f 100644 --- a/tests/analysis_tests/tests/src/expected/CompletionConfiguredBuiltins.res.txt +++ b/tests/analysis_tests/tests/src/expected/CompletionConfiguredBuiltins.res.txt @@ -9,13 +9,14 @@ Path x Path Stdlib.Array.em Path ArrayUtils.em Path em -[{ - "label": "ArrayUtils.empty", - "kind": 12, - "tags": [], +[ + { "detail": "array<'a> => bool", - "documentation": null - }] + "kind": 12, + "label": "ArrayUtils.empty", + "tags": [] + } +] Complete src/CompletionConfiguredBuiltins.res 7:16 posCursor:[7:16] posNoWhite:[7:15] Found expr:[7:3->7:16] @@ -29,11 +30,12 @@ CPPipe pathFromEnv:Fastify found:false Path Fastify.doSt Path FastifyExt.doSt Path doSt -[{ - "label": "FastifyExt.doStuff", - "kind": 12, - "tags": [], +[ + { "detail": "Fastify.t => unit", - "documentation": null - }] + "kind": 12, + "label": "FastifyExt.doStuff", + "tags": [] + } +] diff --git a/tests/analysis_tests/tests/src/expected/CompletionDicts.res.txt b/tests/analysis_tests/tests/src/expected/CompletionDicts.res.txt index 60614d70457..86f52b8c81c 100644 --- a/tests/analysis_tests/tests/src/expected/CompletionDicts.res.txt +++ b/tests/analysis_tests/tests/src/expected/CompletionDicts.res.txt @@ -7,15 +7,16 @@ Resolved opens 1 Stdlib ContextPath CArgument Value[Dict, fromArray]($0) ContextPath Value[Dict, fromArray] Path Dict.fromArray -[{ - "label": "(_, _)", - "kind": 12, - "tags": [], +[ + { "detail": "(string, 'a)", - "documentation": null, "insertText": "(${1:_}, ${2:_})", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 12, + "label": "(_, _)", + "tags": [] + } +] Complete src/CompletionDicts.res 3:31 posCursor:[3:31] posNoWhite:[3:30] Found expr:[3:14->3:34] @@ -26,15 +27,16 @@ Resolved opens 1 Stdlib ContextPath CArgument Value[Dict, fromArray]($0) ContextPath Value[Dict, fromArray] Path Dict.fromArray -[{ - "label": "(_, _)", - "kind": 12, - "tags": [], +[ + { "detail": "(string, 'a)", - "documentation": null, "insertText": "(${1:_}, ${2:_})", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 12, + "label": "(_, _)", + "tags": [] + } +] Complete src/CompletionDicts.res 6:37 posCursor:[6:37] posNoWhite:[6:36] Found expr:[6:14->6:41] @@ -57,18 +59,9 @@ Resolved opens 1 Stdlib ContextPath CArgument Value[Dict, fromArray]($0) ContextPath Value[Dict, fromArray] Path Dict.fromArray -[{ - "label": "true", - "kind": 4, - "tags": [], - "detail": "bool", - "documentation": null - }, { - "label": "false", - "kind": 4, - "tags": [], - "detail": "bool", - "documentation": null - }] +[ + { "detail": "bool", "kind": 4, "label": "true", "tags": [] }, + { "detail": "bool", "kind": 4, "label": "false", "tags": [] } +] diff --git a/tests/analysis_tests/tests/src/expected/CompletionExpressions.res.txt b/tests/analysis_tests/tests/src/expected/CompletionExpressions.res.txt index 2e1b28d5f57..9c6b1137266 100644 --- a/tests/analysis_tests/tests/src/expected/CompletionExpressions.res.txt +++ b/tests/analysis_tests/tests/src/expected/CompletionExpressions.res.txt @@ -8,15 +8,16 @@ ContextPath Value[s] Path s ContextPath Value[f] Path f -[{ - "label": "(_, _)", - "kind": 12, - "tags": [], +[ + { "detail": "(bool, option>)", - "documentation": null, "insertText": "(${1:_}, ${2:_})", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 12, + "label": "(_, _)", + "tags": [] + } +] Complete src/CompletionExpressions.res 26:27 posCursor:[26:27] posNoWhite:[26:26] Found expr:[26:11->26:29] @@ -27,43 +28,68 @@ Resolved opens 1 Stdlib ContextPath CArgument Value[fnTakingRecord]($0) ContextPath Value[fnTakingRecord] Path fnTakingRecord -[{ - "label": "age", - "kind": 5, - "tags": [], +[ + { "detail": "int", - "documentation": {"kind": "markdown", "value": "```rescript\nage: int\n```\n\n```rescript\ntype someRecord = {age: int, offline: bool, online: option, variant: someVariant, polyvariant: somePolyVariant, nested: option}\n```"} - }, { - "label": "offline", + "documentation": { + "kind": "markdown", + "value": "```rescript\nage: int\n```\n\n```rescript\ntype someRecord = {age: int, offline: bool, online: option, variant: someVariant, polyvariant: somePolyVariant, nested: option}\n```" + }, "kind": 5, - "tags": [], + "label": "age", + "tags": [] + }, + { "detail": "bool", - "documentation": {"kind": "markdown", "value": "```rescript\noffline: bool\n```\n\n```rescript\ntype someRecord = {age: int, offline: bool, online: option, variant: someVariant, polyvariant: somePolyVariant, nested: option}\n```"} - }, { - "label": "online", + "documentation": { + "kind": "markdown", + "value": "```rescript\noffline: bool\n```\n\n```rescript\ntype someRecord = {age: int, offline: bool, online: option, variant: someVariant, polyvariant: somePolyVariant, nested: option}\n```" + }, "kind": 5, - "tags": [], + "label": "offline", + "tags": [] + }, + { "detail": "option", - "documentation": {"kind": "markdown", "value": "```rescript\nonline: option\n```\n\n```rescript\ntype someRecord = {age: int, offline: bool, online: option, variant: someVariant, polyvariant: somePolyVariant, nested: option}\n```"} - }, { - "label": "variant", + "documentation": { + "kind": "markdown", + "value": "```rescript\nonline: option\n```\n\n```rescript\ntype someRecord = {age: int, offline: bool, online: option, variant: someVariant, polyvariant: somePolyVariant, nested: option}\n```" + }, "kind": 5, - "tags": [], + "label": "online", + "tags": [] + }, + { "detail": "someVariant", - "documentation": {"kind": "markdown", "value": "```rescript\nvariant: someVariant\n```\n\n```rescript\ntype someRecord = {age: int, offline: bool, online: option, variant: someVariant, polyvariant: somePolyVariant, nested: option}\n```"} - }, { - "label": "polyvariant", + "documentation": { + "kind": "markdown", + "value": "```rescript\nvariant: someVariant\n```\n\n```rescript\ntype someRecord = {age: int, offline: bool, online: option, variant: someVariant, polyvariant: somePolyVariant, nested: option}\n```" + }, "kind": 5, - "tags": [], + "label": "variant", + "tags": [] + }, + { "detail": "somePolyVariant", - "documentation": {"kind": "markdown", "value": "```rescript\npolyvariant: somePolyVariant\n```\n\n```rescript\ntype someRecord = {age: int, offline: bool, online: option, variant: someVariant, polyvariant: somePolyVariant, nested: option}\n```"} - }, { - "label": "nested", + "documentation": { + "kind": "markdown", + "value": "```rescript\npolyvariant: somePolyVariant\n```\n\n```rescript\ntype someRecord = {age: int, offline: bool, online: option, variant: someVariant, polyvariant: somePolyVariant, nested: option}\n```" + }, "kind": 5, - "tags": [], + "label": "polyvariant", + "tags": [] + }, + { "detail": "option", - "documentation": {"kind": "markdown", "value": "```rescript\nnested: option\n```\n\n```rescript\ntype someRecord = {age: int, offline: bool, online: option, variant: someVariant, polyvariant: somePolyVariant, nested: option}\n```"} - }] + "documentation": { + "kind": "markdown", + "value": "```rescript\nnested: option\n```\n\n```rescript\ntype someRecord = {age: int, offline: bool, online: option, variant: someVariant, polyvariant: somePolyVariant, nested: option}\n```" + }, + "kind": 5, + "label": "nested", + "tags": [] + } +] Complete src/CompletionExpressions.res 29:28 posCursor:[29:28] posNoWhite:[29:27] Found expr:[29:11->29:30] @@ -74,13 +100,18 @@ Resolved opens 1 Stdlib ContextPath CArgument Value[fnTakingRecord]($0) ContextPath Value[fnTakingRecord] Path fnTakingRecord -[{ - "label": "nested", - "kind": 5, - "tags": [], +[ + { "detail": "option", - "documentation": {"kind": "markdown", "value": "```rescript\nnested: option\n```\n\n```rescript\ntype someRecord = {age: int, offline: bool, online: option, variant: someVariant, polyvariant: somePolyVariant, nested: option}\n```"} - }] + "documentation": { + "kind": "markdown", + "value": "```rescript\nnested: option\n```\n\n```rescript\ntype someRecord = {age: int, offline: bool, online: option, variant: someVariant, polyvariant: somePolyVariant, nested: option}\n```" + }, + "kind": 5, + "label": "nested", + "tags": [] + } +] Complete src/CompletionExpressions.res 32:35 posCursor:[32:35] posNoWhite:[32:34] Found expr:[32:11->32:38] @@ -91,19 +122,10 @@ Resolved opens 1 Stdlib ContextPath CArgument Value[fnTakingRecord]($0) ContextPath Value[fnTakingRecord] Path fnTakingRecord -[{ - "label": "true", - "kind": 4, - "tags": [], - "detail": "bool", - "documentation": null - }, { - "label": "false", - "kind": 4, - "tags": [], - "detail": "bool", - "documentation": null - }] +[ + { "detail": "bool", "kind": 4, "label": "true", "tags": [] }, + { "detail": "bool", "kind": 4, "label": "false", "tags": [] } +] Complete src/CompletionExpressions.res 35:36 posCursor:[35:36] posNoWhite:[35:35] Found expr:[35:11->35:39] @@ -114,37 +136,58 @@ Resolved opens 1 Stdlib ContextPath CArgument Value[fnTakingRecord]($0) ContextPath Value[fnTakingRecord] Path fnTakingRecord -[{ - "label": "offline", - "kind": 5, - "tags": [], +[ + { "detail": "bool", - "documentation": {"kind": "markdown", "value": "```rescript\noffline: bool\n```\n\n```rescript\ntype someRecord = {age: int, offline: bool, online: option, variant: someVariant, polyvariant: somePolyVariant, nested: option}\n```"} - }, { - "label": "online", + "documentation": { + "kind": "markdown", + "value": "```rescript\noffline: bool\n```\n\n```rescript\ntype someRecord = {age: int, offline: bool, online: option, variant: someVariant, polyvariant: somePolyVariant, nested: option}\n```" + }, "kind": 5, - "tags": [], + "label": "offline", + "tags": [] + }, + { "detail": "option", - "documentation": {"kind": "markdown", "value": "```rescript\nonline: option\n```\n\n```rescript\ntype someRecord = {age: int, offline: bool, online: option, variant: someVariant, polyvariant: somePolyVariant, nested: option}\n```"} - }, { - "label": "variant", + "documentation": { + "kind": "markdown", + "value": "```rescript\nonline: option\n```\n\n```rescript\ntype someRecord = {age: int, offline: bool, online: option, variant: someVariant, polyvariant: somePolyVariant, nested: option}\n```" + }, "kind": 5, - "tags": [], + "label": "online", + "tags": [] + }, + { "detail": "someVariant", - "documentation": {"kind": "markdown", "value": "```rescript\nvariant: someVariant\n```\n\n```rescript\ntype someRecord = {age: int, offline: bool, online: option, variant: someVariant, polyvariant: somePolyVariant, nested: option}\n```"} - }, { - "label": "polyvariant", + "documentation": { + "kind": "markdown", + "value": "```rescript\nvariant: someVariant\n```\n\n```rescript\ntype someRecord = {age: int, offline: bool, online: option, variant: someVariant, polyvariant: somePolyVariant, nested: option}\n```" + }, "kind": 5, - "tags": [], + "label": "variant", + "tags": [] + }, + { "detail": "somePolyVariant", - "documentation": {"kind": "markdown", "value": "```rescript\npolyvariant: somePolyVariant\n```\n\n```rescript\ntype someRecord = {age: int, offline: bool, online: option, variant: someVariant, polyvariant: somePolyVariant, nested: option}\n```"} - }, { - "label": "nested", + "documentation": { + "kind": "markdown", + "value": "```rescript\npolyvariant: somePolyVariant\n```\n\n```rescript\ntype someRecord = {age: int, offline: bool, online: option, variant: someVariant, polyvariant: somePolyVariant, nested: option}\n```" + }, "kind": 5, - "tags": [], + "label": "polyvariant", + "tags": [] + }, + { "detail": "option", - "documentation": {"kind": "markdown", "value": "```rescript\nnested: option\n```\n\n```rescript\ntype someRecord = {age: int, offline: bool, online: option, variant: someVariant, polyvariant: somePolyVariant, nested: option}\n```"} - }] + "documentation": { + "kind": "markdown", + "value": "```rescript\nnested: option\n```\n\n```rescript\ntype someRecord = {age: int, offline: bool, online: option, variant: someVariant, polyvariant: somePolyVariant, nested: option}\n```" + }, + "kind": 5, + "label": "nested", + "tags": [] + } +] Complete src/CompletionExpressions.res 38:37 posCursor:[38:37] posNoWhite:[38:35] Found expr:[38:11->38:53] @@ -155,31 +198,48 @@ Resolved opens 1 Stdlib ContextPath CArgument Value[fnTakingRecord]($0) ContextPath Value[fnTakingRecord] Path fnTakingRecord -[{ - "label": "online", - "kind": 5, - "tags": [], +[ + { "detail": "option", - "documentation": {"kind": "markdown", "value": "```rescript\nonline: option\n```\n\n```rescript\ntype someRecord = {age: int, offline: bool, online: option, variant: someVariant, polyvariant: somePolyVariant, nested: option}\n```"} - }, { - "label": "variant", + "documentation": { + "kind": "markdown", + "value": "```rescript\nonline: option\n```\n\n```rescript\ntype someRecord = {age: int, offline: bool, online: option, variant: someVariant, polyvariant: somePolyVariant, nested: option}\n```" + }, "kind": 5, - "tags": [], + "label": "online", + "tags": [] + }, + { "detail": "someVariant", - "documentation": {"kind": "markdown", "value": "```rescript\nvariant: someVariant\n```\n\n```rescript\ntype someRecord = {age: int, offline: bool, online: option, variant: someVariant, polyvariant: somePolyVariant, nested: option}\n```"} - }, { - "label": "polyvariant", + "documentation": { + "kind": "markdown", + "value": "```rescript\nvariant: someVariant\n```\n\n```rescript\ntype someRecord = {age: int, offline: bool, online: option, variant: someVariant, polyvariant: somePolyVariant, nested: option}\n```" + }, "kind": 5, - "tags": [], + "label": "variant", + "tags": [] + }, + { "detail": "somePolyVariant", - "documentation": {"kind": "markdown", "value": "```rescript\npolyvariant: somePolyVariant\n```\n\n```rescript\ntype someRecord = {age: int, offline: bool, online: option, variant: someVariant, polyvariant: somePolyVariant, nested: option}\n```"} - }, { - "label": "nested", + "documentation": { + "kind": "markdown", + "value": "```rescript\npolyvariant: somePolyVariant\n```\n\n```rescript\ntype someRecord = {age: int, offline: bool, online: option, variant: someVariant, polyvariant: somePolyVariant, nested: option}\n```" + }, "kind": 5, - "tags": [], + "label": "polyvariant", + "tags": [] + }, + { "detail": "option", - "documentation": {"kind": "markdown", "value": "```rescript\nnested: option\n```\n\n```rescript\ntype someRecord = {age: int, offline: bool, online: option, variant: someVariant, polyvariant: somePolyVariant, nested: option}\n```"} - }] + "documentation": { + "kind": "markdown", + "value": "```rescript\nnested: option\n```\n\n```rescript\ntype someRecord = {age: int, offline: bool, online: option, variant: someVariant, polyvariant: somePolyVariant, nested: option}\n```" + }, + "kind": 5, + "label": "nested", + "tags": [] + } +] Complete src/CompletionExpressions.res 41:44 posCursor:[41:44] posNoWhite:[41:43] Found expr:[41:11->41:47] @@ -190,37 +250,54 @@ Resolved opens 1 Stdlib ContextPath CArgument Value[fnTakingRecord]($0) ContextPath Value[fnTakingRecord] Path fnTakingRecord -[{ - "label": "Some(nested)", - "kind": 12, - "tags": [], +[ + { "detail": "otherRecord", - "documentation": {"kind": "markdown", "value": "```rescript\ntype otherRecord = {someField: int, otherField: string}\n```"}, + "documentation": { + "kind": "markdown", + "value": "```rescript\ntype otherRecord = {someField: int, otherField: string}\n```" + }, "insertText": "Some(nested)$0", - "insertTextFormat": 2 - }, { - "label": "Some(_)", + "insertTextFormat": 2, "kind": 12, - "tags": [], + "label": "Some(nested)", + "tags": [] + }, + { "detail": "otherRecord", - "documentation": {"kind": "markdown", "value": "```rescript\ntype otherRecord = {someField: int, otherField: string}\n```"}, + "documentation": { + "kind": "markdown", + "value": "```rescript\ntype otherRecord = {someField: int, otherField: string}\n```" + }, "insertText": "Some($0)", - "insertTextFormat": 2 - }, { - "label": "None", + "insertTextFormat": 2, "kind": 12, - "tags": [], + "label": "Some(_)", + "tags": [] + }, + { "detail": "otherRecord", - "documentation": {"kind": "markdown", "value": "```rescript\ntype otherRecord = {someField: int, otherField: string}\n```"} - }, { - "label": "Some({})", + "documentation": { + "kind": "markdown", + "value": "```rescript\ntype otherRecord = {someField: int, otherField: string}\n```" + }, "kind": 12, - "tags": [], + "label": "None", + "tags": [] + }, + { "detail": "otherRecord", - "documentation": {"kind": "markdown", "value": "```rescript\ntype otherRecord = {someField: int, otherField: string}\n```"}, + "documentation": { + "kind": "markdown", + "value": "```rescript\ntype otherRecord = {someField: int, otherField: string}\n```" + }, "insertText": "Some({$0})", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 12, + "label": "Some({})", + "tags": [] + } +] Complete src/CompletionExpressions.res 44:46 posCursor:[44:46] posNoWhite:[44:45] Found expr:[44:11->44:49] @@ -242,19 +319,28 @@ Resolved opens 1 Stdlib ContextPath CArgument Value[fnTakingRecord]($0) ContextPath Value[fnTakingRecord] Path fnTakingRecord -[{ - "label": "someField", - "kind": 5, - "tags": [], +[ + { "detail": "int", - "documentation": {"kind": "markdown", "value": "```rescript\nsomeField: int\n```\n\n```rescript\ntype otherRecord = {someField: int, otherField: string}\n```"} - }, { - "label": "otherField", + "documentation": { + "kind": "markdown", + "value": "```rescript\nsomeField: int\n```\n\n```rescript\ntype otherRecord = {someField: int, otherField: string}\n```" + }, "kind": 5, - "tags": [], + "label": "someField", + "tags": [] + }, + { "detail": "string", - "documentation": {"kind": "markdown", "value": "```rescript\notherField: string\n```\n\n```rescript\ntype otherRecord = {someField: int, otherField: string}\n```"} - }] + "documentation": { + "kind": "markdown", + "value": "```rescript\notherField: string\n```\n\n```rescript\ntype otherRecord = {someField: int, otherField: string}\n```" + }, + "kind": 5, + "label": "otherField", + "tags": [] + } +] Complete src/CompletionExpressions.res 50:45 posCursor:[50:45] posNoWhite:[50:44] Found expr:[50:11->50:48] @@ -265,31 +351,44 @@ Resolved opens 1 Stdlib ContextPath CArgument Value[fnTakingRecord]($0) ContextPath Value[fnTakingRecord] Path fnTakingRecord -[{ - "label": "One", - "kind": 4, - "tags": [], +[ + { "detail": "One", - "documentation": {"kind": "markdown", "value": "```rescript\nOne\n```\n\n```rescript\ntype someVariant = One | Two | Three(int, string)\n```"}, + "documentation": { + "kind": "markdown", + "value": "```rescript\nOne\n```\n\n```rescript\ntype someVariant = One | Two | Three(int, string)\n```" + }, "insertText": "One", - "insertTextFormat": 2 - }, { - "label": "Two", + "insertTextFormat": 2, "kind": 4, - "tags": [], + "label": "One", + "tags": [] + }, + { "detail": "Two", - "documentation": {"kind": "markdown", "value": "```rescript\nTwo\n```\n\n```rescript\ntype someVariant = One | Two | Three(int, string)\n```"}, + "documentation": { + "kind": "markdown", + "value": "```rescript\nTwo\n```\n\n```rescript\ntype someVariant = One | Two | Three(int, string)\n```" + }, "insertText": "Two", - "insertTextFormat": 2 - }, { - "label": "Three(_, _)", + "insertTextFormat": 2, "kind": 4, - "tags": [], + "label": "Two", + "tags": [] + }, + { "detail": "Three(int, string)", - "documentation": {"kind": "markdown", "value": "```rescript\nThree(int, string)\n```\n\n```rescript\ntype someVariant = One | Two | Three(int, string)\n```"}, + "documentation": { + "kind": "markdown", + "value": "```rescript\nThree(int, string)\n```\n\n```rescript\ntype someVariant = One | Two | Three(int, string)\n```" + }, "insertText": "Three(${1:_}, ${2:_})", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 4, + "label": "Three(_, _)", + "tags": [] + } +] Complete src/CompletionExpressions.res 53:47 posCursor:[53:47] posNoWhite:[53:46] Found expr:[53:11->53:50] @@ -300,15 +399,20 @@ Resolved opens 1 Stdlib ContextPath CArgument Value[fnTakingRecord]($0) ContextPath Value[fnTakingRecord] Path fnTakingRecord -[{ - "label": "One", - "kind": 4, - "tags": [], +[ + { "detail": "One", - "documentation": {"kind": "markdown", "value": "```rescript\nOne\n```\n\n```rescript\ntype someVariant = One | Two | Three(int, string)\n```"}, + "documentation": { + "kind": "markdown", + "value": "```rescript\nOne\n```\n\n```rescript\ntype someVariant = One | Two | Three(int, string)\n```" + }, "insertText": "One", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 4, + "label": "One", + "tags": [] + } +] Complete src/CompletionExpressions.res 56:57 posCursor:[56:57] posNoWhite:[56:56] Found expr:[56:11->56:61] @@ -319,16 +423,21 @@ Resolved opens 1 Stdlib ContextPath CArgument Value[fnTakingRecord]($0) ContextPath Value[fnTakingRecord] Path fnTakingRecord -[{ - "label": "{}", - "kind": 12, - "tags": [], +[ + { "detail": "someRecord", - "documentation": {"kind": "markdown", "value": "```rescript\ntype someRecord = {age: int, offline: bool, online: option, variant: someVariant, polyvariant: somePolyVariant, nested: option}\n```"}, - "sortText": "A", + "documentation": { + "kind": "markdown", + "value": "```rescript\ntype someRecord = {age: int, offline: bool, online: option, variant: someVariant, polyvariant: somePolyVariant, nested: option}\n```" + }, "insertText": "{$0}", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 12, + "label": "{}", + "sortText": "A", + "tags": [] + } +] Complete src/CompletionExpressions.res 59:60 posCursor:[59:60] posNoWhite:[59:59] Found expr:[59:11->59:65] @@ -339,19 +448,10 @@ Resolved opens 1 Stdlib ContextPath CArgument Value[fnTakingRecord]($0) ContextPath Value[fnTakingRecord] Path fnTakingRecord -[{ - "label": "true", - "kind": 4, - "tags": [], - "detail": "bool", - "documentation": null - }, { - "label": "false", - "kind": 4, - "tags": [], - "detail": "bool", - "documentation": null - }] +[ + { "detail": "bool", "kind": 4, "label": "true", "tags": [] }, + { "detail": "bool", "kind": 4, "label": "false", "tags": [] } +] Complete src/CompletionExpressions.res 62:62 posCursor:[62:62] posNoWhite:[62:61] Found expr:[62:11->62:66] @@ -362,20 +462,25 @@ Resolved opens 1 Stdlib ContextPath CArgument Value[fnTakingRecord]($0) ContextPath Value[fnTakingRecord] Path fnTakingRecord -[{ - "label": "true", - "kind": 4, - "tags": [], +[ + { "detail": "bool", - "documentation": null, - "sortText": "A true" - }, { - "label": "typeof", - "kind": 12, - "tags": [], + "kind": 4, + "label": "true", + "sortText": "A true", + "tags": [] + }, + { "detail": "'a => Type.t", - "documentation": {"kind": "markdown", "value": "\n`typeof(value)` exposes JavaScript's `typeof` operator and returns a `Type.t` enum.\nIt helps you inspect values that come from JavaScript APIs.\n\n## Examples\n\n```rescript\ntypeof(1) == #number\ntypeof(\"a\") == #string\n```\n"} - }] + "documentation": { + "kind": "markdown", + "value": "\n`typeof(value)` exposes JavaScript's `typeof` operator and returns a `Type.t` enum.\nIt helps you inspect values that come from JavaScript APIs.\n\n## Examples\n\n```rescript\ntypeof(1) == #number\ntypeof(\"a\") == #string\n```\n" + }, + "kind": 12, + "label": "typeof", + "tags": [] + } +] Complete src/CompletionExpressions.res 69:25 posCursor:[69:25] posNoWhite:[69:24] Found expr:[69:11->69:26] @@ -386,16 +491,17 @@ Resolved opens 1 Stdlib ContextPath CArgument Value[fnTakingArray]($0) ContextPath Value[fnTakingArray] Path fnTakingArray -[{ - "label": "[]", - "kind": 12, - "tags": [], +[ + { "detail": "option", - "documentation": null, - "sortText": "A", "insertText": "[$0]", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 12, + "label": "[]", + "sortText": "A", + "tags": [] + } +] Complete src/CompletionExpressions.res 72:26 posCursor:[72:26] posNoWhite:[72:25] Found expr:[72:11->72:28] @@ -406,33 +512,19 @@ Resolved opens 1 Stdlib ContextPath CArgument Value[fnTakingArray]($0) ContextPath Value[fnTakingArray] Path fnTakingArray -[{ - "label": "None", - "kind": 12, - "tags": [], - "detail": "bool", - "documentation": null - }, { - "label": "Some(_)", - "kind": 12, - "tags": [], +[ + { "detail": "bool", "kind": 12, "label": "None", "tags": [] }, + { "detail": "bool", - "documentation": null, "insertText": "Some($0)", - "insertTextFormat": 2 - }, { - "label": "Some(true)", - "kind": 4, - "tags": [], - "detail": "bool", - "documentation": null - }, { - "label": "Some(false)", - "kind": 4, - "tags": [], - "detail": "bool", - "documentation": null - }] + "insertTextFormat": 2, + "kind": 12, + "label": "Some(_)", + "tags": [] + }, + { "detail": "bool", "kind": 4, "label": "Some(true)", "tags": [] }, + { "detail": "bool", "kind": 4, "label": "Some(false)", "tags": [] } +] Complete src/CompletionExpressions.res 75:26 posCursor:[75:26] posNoWhite:[75:25] Found expr:[75:11->75:27] @@ -443,37 +535,49 @@ Resolved opens 1 Stdlib ContextPath CArgument Value[fnTakingArray]($0) ContextPath Value[fnTakingArray] Path fnTakingArray -[{ - "label": "s", +[ + { "detail": "bool", "kind": 12, "label": "s", "tags": [] }, + { + "detail": "(unit => unit, float) => timeoutId", + "documentation": { + "kind": "markdown", + "value": "\n`setTimeoutFloat(callback, durationInMilliseconds)` starts a timer that will execute `callback` after `durationInMilliseconds`.\n\nThe same as `setTimeout`, but allows you to pass a `float` instead of an `int` for the duration.\n\nSee [`setTimeout`](https://developer.mozilla.org/en-US/docs/Web/API/setTimeout) on MDN.\n\n## Examples\n\n```rescript\n// Log to the console after 200 milliseconds.\nlet timeoutId = setTimeoutFloat(() => {\n Console.log(\"This prints in 200 ms.\")\n}, 200.)\n```\n" + }, "kind": 12, - "tags": [], - "detail": "bool", - "documentation": null - }, { "label": "setTimeoutFloat", + "tags": [] + }, + { + "detail": "(unit => unit, float) => intervalId", + "documentation": { + "kind": "markdown", + "value": "\n`setIntervalFloat(callback, intervalInMilliseconds)` starts an interval that will execute `callback` every `durationInMilliseconds` milliseconds.\n\nThe same as `setInterval`, but allows you to pass a `float` instead of an `int` for the duration.\n\nSee [`setInterval`](https://developer.mozilla.org/en-US/docs/Web/API/setInterval) on MDN.\n\n## Examples\n\n```rescript\n// Log to the console ever 2 seconds (200 milliseconds).\nlet intervalId = setIntervalFloat(() => {\n Console.log(\"This prints every 200 ms\")\n}, 200.)\n\n// Stop the interval after 500 ms\nlet timeoutId = setTimeoutFloat(() => {\n clearInterval(intervalId)\n}, 500.0)\n```\n" + }, "kind": 12, - "tags": [], - "detail": "(unit => unit, float) => timeoutId", - "documentation": {"kind": "markdown", "value": "\n`setTimeoutFloat(callback, durationInMilliseconds)` starts a timer that will execute `callback` after `durationInMilliseconds`.\n\nThe same as `setTimeout`, but allows you to pass a `float` instead of an `int` for the duration.\n\nSee [`setTimeout`](https://developer.mozilla.org/en-US/docs/Web/API/setTimeout) on MDN.\n\n## Examples\n\n```rescript\n// Log to the console after 200 milliseconds.\nlet timeoutId = setTimeoutFloat(() => {\n Console.log(\"This prints in 200 ms.\")\n}, 200.)\n```\n"} - }, { "label": "setIntervalFloat", + "tags": [] + }, + { + "detail": "(unit => unit, int) => intervalId", + "documentation": { + "kind": "markdown", + "value": "\n`setInterval(callback, intervalInMilliseconds)` starts an interval that will execute `callback` every `durationInMilliseconds` milliseconds.\n\nSee [`setInterval`](https://developer.mozilla.org/en-US/docs/Web/API/setInterval) on MDN.\n\n## Examples\n\n```rescript\n// Log to the console ever 200 ms (200 milliseconds).\nlet intervalId = setInterval(() => {\n Console.log(\"This prints every 200 ms.\")\n}, 200)\n\nlet timeoutId = setTimeout(() => {\n clearInterval(intervalId)\n}, 500)\n```\n" + }, "kind": 12, - "tags": [], - "detail": "(unit => unit, float) => intervalId", - "documentation": {"kind": "markdown", "value": "\n`setIntervalFloat(callback, intervalInMilliseconds)` starts an interval that will execute `callback` every `durationInMilliseconds` milliseconds.\n\nThe same as `setInterval`, but allows you to pass a `float` instead of an `int` for the duration.\n\nSee [`setInterval`](https://developer.mozilla.org/en-US/docs/Web/API/setInterval) on MDN.\n\n## Examples\n\n```rescript\n// Log to the console ever 2 seconds (200 milliseconds).\nlet intervalId = setIntervalFloat(() => {\n Console.log(\"This prints every 200 ms\")\n}, 200.)\n\n// Stop the interval after 500 ms\nlet timeoutId = setTimeoutFloat(() => {\n clearInterval(intervalId)\n}, 500.0)\n```\n"} - }, { "label": "setInterval", + "tags": [] + }, + { + "detail": "(unit => unit, int) => timeoutId", + "documentation": { + "kind": "markdown", + "value": "\n`setTimeout(callback, durationInMilliseconds)` starts a timer that will execute `callback` after `durationInMilliseconds`.\n\nSee [`setTimeout`](https://developer.mozilla.org/en-US/docs/Web/API/setTimeout) on MDN.\n\n## Examples\n\n```rescript\n// Log to the console after 200 milliseconds.\nlet timeoutId = setTimeout(() => {\n Console.log(\"This prints in 200 ms.\")\n}, 200)\n```\n" + }, "kind": 12, - "tags": [], - "detail": "(unit => unit, int) => intervalId", - "documentation": {"kind": "markdown", "value": "\n`setInterval(callback, intervalInMilliseconds)` starts an interval that will execute `callback` every `durationInMilliseconds` milliseconds.\n\nSee [`setInterval`](https://developer.mozilla.org/en-US/docs/Web/API/setInterval) on MDN.\n\n## Examples\n\n```rescript\n// Log to the console ever 200 ms (200 milliseconds).\nlet intervalId = setInterval(() => {\n Console.log(\"This prints every 200 ms.\")\n}, 200)\n\nlet timeoutId = setTimeout(() => {\n clearInterval(intervalId)\n}, 500)\n```\n"} - }, { "label": "setTimeout", - "kind": 12, - "tags": [], - "detail": "(unit => unit, int) => timeoutId", - "documentation": {"kind": "markdown", "value": "\n`setTimeout(callback, durationInMilliseconds)` starts a timer that will execute `callback` after `durationInMilliseconds`.\n\nSee [`setTimeout`](https://developer.mozilla.org/en-US/docs/Web/API/setTimeout) on MDN.\n\n## Examples\n\n```rescript\n// Log to the console after 200 milliseconds.\nlet timeoutId = setTimeout(() => {\n Console.log(\"This prints in 200 ms.\")\n}, 200)\n```\n"} - }] + "tags": [] + } +] Complete src/CompletionExpressions.res 78:31 posCursor:[78:31] posNoWhite:[78:30] Found expr:[78:11->78:34] @@ -484,19 +588,10 @@ Resolved opens 1 Stdlib ContextPath CArgument Value[fnTakingArray]($0) ContextPath Value[fnTakingArray] Path fnTakingArray -[{ - "label": "true", - "kind": 4, - "tags": [], - "detail": "bool", - "documentation": null - }, { - "label": "false", - "kind": 4, - "tags": [], - "detail": "bool", - "documentation": null - }] +[ + { "detail": "bool", "kind": 4, "label": "true", "tags": [] }, + { "detail": "bool", "kind": 4, "label": "false", "tags": [] } +] Complete src/CompletionExpressions.res 81:31 posCursor:[81:31] posNoWhite:[81:30] Found expr:[81:11->81:34] @@ -507,33 +602,19 @@ Resolved opens 1 Stdlib ContextPath CArgument Value[fnTakingArray]($0) ContextPath Value[fnTakingArray] Path fnTakingArray -[{ - "label": "None", - "kind": 12, - "tags": [], +[ + { "detail": "bool", "kind": 12, "label": "None", "tags": [] }, + { "detail": "bool", - "documentation": null - }, { - "label": "Some(_)", - "kind": 12, - "tags": [], - "detail": "bool", - "documentation": null, "insertText": "Some($0)", - "insertTextFormat": 2 - }, { - "label": "Some(true)", - "kind": 4, - "tags": [], - "detail": "bool", - "documentation": null - }, { - "label": "Some(false)", - "kind": 4, - "tags": [], - "detail": "bool", - "documentation": null - }] + "insertTextFormat": 2, + "kind": 12, + "label": "Some(_)", + "tags": [] + }, + { "detail": "bool", "kind": 4, "label": "Some(true)", "tags": [] }, + { "detail": "bool", "kind": 4, "label": "Some(false)", "tags": [] } +] Complete src/CompletionExpressions.res 84:31 posCursor:[84:31] posNoWhite:[84:30] Found expr:[84:11->84:40] @@ -544,33 +625,19 @@ Resolved opens 1 Stdlib ContextPath CArgument Value[fnTakingArray]($0) ContextPath Value[fnTakingArray] Path fnTakingArray -[{ - "label": "None", - "kind": 12, - "tags": [], - "detail": "bool", - "documentation": null - }, { - "label": "Some(_)", - "kind": 12, - "tags": [], +[ + { "detail": "bool", "kind": 12, "label": "None", "tags": [] }, + { "detail": "bool", - "documentation": null, "insertText": "Some($0)", - "insertTextFormat": 2 - }, { - "label": "Some(true)", - "kind": 4, - "tags": [], - "detail": "bool", - "documentation": null - }, { - "label": "Some(false)", - "kind": 4, - "tags": [], - "detail": "bool", - "documentation": null - }] + "insertTextFormat": 2, + "kind": 12, + "label": "Some(_)", + "tags": [] + }, + { "detail": "bool", "kind": 4, "label": "Some(true)", "tags": [] }, + { "detail": "bool", "kind": 4, "label": "Some(false)", "tags": [] } +] Complete src/CompletionExpressions.res 89:38 posCursor:[89:38] posNoWhite:[89:37] Found expr:[89:11->89:41] @@ -581,13 +648,7 @@ Resolved opens 1 Stdlib ContextPath CArgument Value[fnTakingRecord]($0) ContextPath Value[fnTakingRecord] Path fnTakingRecord -[{ - "label": "someBoolVar", - "kind": 12, - "tags": [], - "detail": "bool", - "documentation": null - }] +[ { "detail": "bool", "kind": 12, "label": "someBoolVar", "tags": [] } ] Complete src/CompletionExpressions.res 96:43 posCursor:[96:43] posNoWhite:[96:42] Found expr:[96:11->96:46] @@ -598,16 +659,17 @@ Resolved opens 1 Stdlib ContextPath CArgument Value[fnTakingOtherRecord]($0) ContextPath Value[fnTakingOtherRecord] Path fnTakingOtherRecord -[{ - "label": "\"\"", - "kind": 12, - "tags": [], +[ + { "detail": "string", - "documentation": null, - "sortText": "A", "insertText": "\"$0\"", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 12, + "label": "\"\"", + "sortText": "A", + "tags": [] + } +] Complete src/CompletionExpressions.res 108:57 posCursor:[108:57] posNoWhite:[108:56] Found expr:[108:11->108:60] @@ -618,19 +680,10 @@ Resolved opens 1 Stdlib ContextPath CArgument Value[fnTakingRecordWithOptionalField]($0) ContextPath Value[fnTakingRecordWithOptionalField] Path fnTakingRecordWithOptionalField -[{ - "label": "true", - "kind": 4, - "tags": [], - "detail": "bool", - "documentation": null - }, { - "label": "false", - "kind": 4, - "tags": [], - "detail": "bool", - "documentation": null - }] +[ + { "detail": "bool", "kind": 4, "label": "true", "tags": [] }, + { "detail": "bool", "kind": 4, "label": "false", "tags": [] } +] Complete src/CompletionExpressions.res 116:53 posCursor:[116:53] posNoWhite:[116:52] Found expr:[116:11->116:56] @@ -641,53 +694,78 @@ Resolved opens 1 Stdlib ContextPath CArgument Value[fnTakingRecordWithOptVariant]($0) ContextPath Value[fnTakingRecordWithOptVariant] Path fnTakingRecordWithOptVariant -[{ - "label": "Some(someVariant)", - "kind": 12, - "tags": [], +[ + { "detail": "someVariant", - "documentation": {"kind": "markdown", "value": "```rescript\ntype someVariant = One | Two | Three(int, string)\n```"}, + "documentation": { + "kind": "markdown", + "value": "```rescript\ntype someVariant = One | Two | Three(int, string)\n```" + }, "insertText": "Some(someVariant)$0", - "insertTextFormat": 2 - }, { - "label": "Some(_)", + "insertTextFormat": 2, "kind": 12, - "tags": [], + "label": "Some(someVariant)", + "tags": [] + }, + { "detail": "someVariant", - "documentation": {"kind": "markdown", "value": "```rescript\ntype someVariant = One | Two | Three(int, string)\n```"}, + "documentation": { + "kind": "markdown", + "value": "```rescript\ntype someVariant = One | Two | Three(int, string)\n```" + }, "insertText": "Some($0)", - "insertTextFormat": 2 - }, { - "label": "None", + "insertTextFormat": 2, "kind": 12, - "tags": [], + "label": "Some(_)", + "tags": [] + }, + { "detail": "someVariant", - "documentation": {"kind": "markdown", "value": "```rescript\ntype someVariant = One | Two | Three(int, string)\n```"} - }, { - "label": "Some(One)", - "kind": 4, - "tags": [], + "documentation": { + "kind": "markdown", + "value": "```rescript\ntype someVariant = One | Two | Three(int, string)\n```" + }, + "kind": 12, + "label": "None", + "tags": [] + }, + { "detail": "One", - "documentation": {"kind": "markdown", "value": "```rescript\nOne\n```\n\n```rescript\ntype someVariant = One | Two | Three(int, string)\n```"}, + "documentation": { + "kind": "markdown", + "value": "```rescript\nOne\n```\n\n```rescript\ntype someVariant = One | Two | Three(int, string)\n```" + }, "insertText": "Some(One)", - "insertTextFormat": 2 - }, { - "label": "Some(Two)", + "insertTextFormat": 2, "kind": 4, - "tags": [], + "label": "Some(One)", + "tags": [] + }, + { "detail": "Two", - "documentation": {"kind": "markdown", "value": "```rescript\nTwo\n```\n\n```rescript\ntype someVariant = One | Two | Three(int, string)\n```"}, + "documentation": { + "kind": "markdown", + "value": "```rescript\nTwo\n```\n\n```rescript\ntype someVariant = One | Two | Three(int, string)\n```" + }, "insertText": "Some(Two)", - "insertTextFormat": 2 - }, { - "label": "Some(Three(_, _))", + "insertTextFormat": 2, "kind": 4, - "tags": [], + "label": "Some(Two)", + "tags": [] + }, + { "detail": "Three(int, string)", - "documentation": {"kind": "markdown", "value": "```rescript\nThree(int, string)\n```\n\n```rescript\ntype someVariant = One | Two | Three(int, string)\n```"}, + "documentation": { + "kind": "markdown", + "value": "```rescript\nThree(int, string)\n```\n\n```rescript\ntype someVariant = One | Two | Three(int, string)\n```" + }, "insertText": "Some(Three(${1:_}, ${2:_}))", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 4, + "label": "Some(Three(_, _))", + "tags": [] + } +] Complete src/CompletionExpressions.res 126:49 posCursor:[126:49] posNoWhite:[126:48] Found expr:[126:11->126:51] @@ -698,16 +776,21 @@ Resolved opens 1 Stdlib ContextPath CArgument Value[fnTakingInlineRecord]($0) ContextPath Value[fnTakingInlineRecord] Path fnTakingInlineRecord -[{ - "label": "{}", - "kind": 12, - "tags": [], +[ + { "detail": "{someBoolField: bool, otherField: option, nestedRecord: otherRecord}", - "documentation": {"kind": "markdown", "value": "```rescript\n{someBoolField: bool, otherField: option, nestedRecord: otherRecord}\n```"}, - "sortText": "A", + "documentation": { + "kind": "markdown", + "value": "```rescript\n{someBoolField: bool, otherField: option, nestedRecord: otherRecord}\n```" + }, "insertText": "{$0}", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 12, + "label": "{}", + "sortText": "A", + "tags": [] + } +] Complete src/CompletionExpressions.res 129:50 posCursor:[129:50] posNoWhite:[129:49] Found expr:[129:11->129:53] @@ -718,25 +801,38 @@ Resolved opens 1 Stdlib ContextPath CArgument Value[fnTakingInlineRecord]($0) ContextPath Value[fnTakingInlineRecord] Path fnTakingInlineRecord -[{ - "label": "someBoolField", - "kind": 5, - "tags": [], +[ + { "detail": "bool", - "documentation": {"kind": "markdown", "value": "```rescript\nsomeBoolField: bool\n```\n\n```rescript\n{someBoolField: bool, otherField: option, nestedRecord: otherRecord}\n```"} - }, { - "label": "otherField", + "documentation": { + "kind": "markdown", + "value": "```rescript\nsomeBoolField: bool\n```\n\n```rescript\n{someBoolField: bool, otherField: option, nestedRecord: otherRecord}\n```" + }, "kind": 5, - "tags": [], + "label": "someBoolField", + "tags": [] + }, + { "detail": "option", - "documentation": {"kind": "markdown", "value": "```rescript\notherField: option\n```\n\n```rescript\n{someBoolField: bool, otherField: option, nestedRecord: otherRecord}\n```"} - }, { - "label": "nestedRecord", + "documentation": { + "kind": "markdown", + "value": "```rescript\notherField: option\n```\n\n```rescript\n{someBoolField: bool, otherField: option, nestedRecord: otherRecord}\n```" + }, "kind": 5, - "tags": [], + "label": "otherField", + "tags": [] + }, + { "detail": "otherRecord", - "documentation": {"kind": "markdown", "value": "```rescript\nnestedRecord: otherRecord\n```\n\n```rescript\n{someBoolField: bool, otherField: option, nestedRecord: otherRecord}\n```"} - }] + "documentation": { + "kind": "markdown", + "value": "```rescript\nnestedRecord: otherRecord\n```\n\n```rescript\n{someBoolField: bool, otherField: option, nestedRecord: otherRecord}\n```" + }, + "kind": 5, + "label": "nestedRecord", + "tags": [] + } +] Complete src/CompletionExpressions.res 132:51 posCursor:[132:51] posNoWhite:[132:50] Found expr:[132:11->132:54] @@ -747,13 +843,18 @@ Resolved opens 1 Stdlib ContextPath CArgument Value[fnTakingInlineRecord]($0) ContextPath Value[fnTakingInlineRecord] Path fnTakingInlineRecord -[{ - "label": "someBoolField", - "kind": 5, - "tags": [], +[ + { "detail": "bool", - "documentation": {"kind": "markdown", "value": "```rescript\nsomeBoolField: bool\n```\n\n```rescript\n{someBoolField: bool, otherField: option, nestedRecord: otherRecord}\n```"} - }] + "documentation": { + "kind": "markdown", + "value": "```rescript\nsomeBoolField: bool\n```\n\n```rescript\n{someBoolField: bool, otherField: option, nestedRecord: otherRecord}\n```" + }, + "kind": 5, + "label": "someBoolField", + "tags": [] + } +] Complete src/CompletionExpressions.res 135:63 posCursor:[135:63] posNoWhite:[135:62] Found expr:[135:11->135:67] @@ -764,16 +865,21 @@ Resolved opens 1 Stdlib ContextPath CArgument Value[fnTakingInlineRecord]($0) ContextPath Value[fnTakingInlineRecord] Path fnTakingInlineRecord -[{ - "label": "{}", - "kind": 12, - "tags": [], +[ + { "detail": "otherRecord", - "documentation": {"kind": "markdown", "value": "```rescript\ntype otherRecord = {someField: int, otherField: string}\n```"}, - "sortText": "A", + "documentation": { + "kind": "markdown", + "value": "```rescript\ntype otherRecord = {someField: int, otherField: string}\n```" + }, "insertText": "{$0}", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 12, + "label": "{}", + "sortText": "A", + "tags": [] + } +] Complete src/CompletionExpressions.res 138:65 posCursor:[138:65] posNoWhite:[138:64] Found expr:[138:11->138:70] @@ -784,19 +890,28 @@ Resolved opens 1 Stdlib ContextPath CArgument Value[fnTakingInlineRecord]($0) ContextPath Value[fnTakingInlineRecord] Path fnTakingInlineRecord -[{ - "label": "someField", - "kind": 5, - "tags": [], +[ + { "detail": "int", - "documentation": {"kind": "markdown", "value": "```rescript\nsomeField: int\n```\n\n```rescript\ntype otherRecord = {someField: int, otherField: string}\n```"} - }, { - "label": "otherField", + "documentation": { + "kind": "markdown", + "value": "```rescript\nsomeField: int\n```\n\n```rescript\ntype otherRecord = {someField: int, otherField: string}\n```" + }, "kind": 5, - "tags": [], + "label": "someField", + "tags": [] + }, + { "detail": "string", - "documentation": {"kind": "markdown", "value": "```rescript\notherField: string\n```\n\n```rescript\ntype otherRecord = {someField: int, otherField: string}\n```"} - }] + "documentation": { + "kind": "markdown", + "value": "```rescript\notherField: string\n```\n\n```rescript\ntype otherRecord = {someField: int, otherField: string}\n```" + }, + "kind": 5, + "label": "otherField", + "tags": [] + } +] Complete src/CompletionExpressions.res 159:20 posCursor:[159:20] posNoWhite:[159:19] Found expr:[159:3->159:21] @@ -807,16 +922,17 @@ Resolved opens 1 Stdlib ContextPath CArgument Value[fnTakingCallback]($0) ContextPath Value[fnTakingCallback] Path fnTakingCallback -[{ - "label": "() => {}", - "kind": 12, - "tags": [], +[ + { "detail": "unit => unit", - "documentation": null, - "sortText": "A", "insertText": "() => ${0:()}", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 12, + "label": "() => {}", + "sortText": "A", + "tags": [] + } +] Complete src/CompletionExpressions.res 162:21 posCursor:[162:21] posNoWhite:[162:20] Found expr:[162:3->162:22] @@ -827,13 +943,18 @@ Resolved opens 1 Stdlib ContextPath CArgument Value[fnTakingCallback]($0) ContextPath Value[fnTakingCallback] Path fnTakingCallback -[{ - "label": "assertEqual", - "kind": 12, - "tags": [], +[ + { "detail": "('a, 'a) => unit", - "documentation": {"kind": "markdown", "value": "\n`assertEqual(a, b)` check if `a` is equal `b`. If not throw a panic exception\n\n## Examples\n\n```rescript\nlist{1, 2}->List.tailExn == list{2}\n```\n"} - }] + "documentation": { + "kind": "markdown", + "value": "\n`assertEqual(a, b)` check if `a` is equal `b`. If not throw a panic exception\n\n## Examples\n\n```rescript\nlist{1, 2}->List.tailExn == list{2}\n```\n" + }, + "kind": 12, + "label": "assertEqual", + "tags": [] + } +] Complete src/CompletionExpressions.res 165:22 posCursor:[165:22] posNoWhite:[165:21] Found expr:[165:3->165:24] @@ -844,16 +965,17 @@ Resolved opens 1 Stdlib ContextPath CArgument Value[fnTakingCallback]($1) ContextPath Value[fnTakingCallback] Path fnTakingCallback -[{ - "label": "v => v", - "kind": 12, - "tags": [], +[ + { "detail": "bool => unit", - "documentation": null, - "sortText": "A", "insertText": "${1:v} => ${0:v}", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 12, + "label": "v => v", + "sortText": "A", + "tags": [] + } +] Complete src/CompletionExpressions.res 168:25 posCursor:[168:25] posNoWhite:[168:24] Found expr:[168:3->168:27] @@ -864,16 +986,17 @@ Resolved opens 1 Stdlib ContextPath CArgument Value[fnTakingCallback]($2) ContextPath Value[fnTakingCallback] Path fnTakingCallback -[{ - "label": "event => event", - "kind": 12, - "tags": [], +[ + { "detail": "ReactEvent.Mouse.t => unit", - "documentation": null, - "sortText": "A", "insertText": "${1:event} => ${0:event}", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 12, + "label": "event => event", + "sortText": "A", + "tags": [] + } +] Complete src/CompletionExpressions.res 171:29 posCursor:[171:29] posNoWhite:[171:27] Found expr:[171:3->171:30] @@ -884,16 +1007,17 @@ Resolved opens 1 Stdlib ContextPath CArgument Value[fnTakingCallback]($3) ContextPath Value[fnTakingCallback] Path fnTakingCallback -[{ - "label": "(~on, ~off=?, variant) => {}", - "kind": 12, - "tags": [], +[ + { "detail": "(~on: bool, ~off: bool=?, variant) => int", - "documentation": null, - "sortText": "A", "insertText": "(~on, ~off=?, ${1:variant}) => {${0:()}}", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 12, + "label": "(~on, ~off=?, variant) => {}", + "sortText": "A", + "tags": [] + } +] Complete src/CompletionExpressions.res 174:32 posCursor:[174:32] posNoWhite:[174:30] Found expr:[174:3->174:33] @@ -904,16 +1028,17 @@ Resolved opens 1 Stdlib ContextPath CArgument Value[fnTakingCallback]($4) ContextPath Value[fnTakingCallback] Path fnTakingCallback -[{ - "label": "(v1, v2, v3) => {}", - "kind": 12, - "tags": [], +[ + { "detail": "(bool, option, bool) => unit", - "documentation": null, - "sortText": "A", "insertText": "(${1:v1}, ${2:v2}, ${3:v3}) => {${0:()}}", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 12, + "label": "(v1, v2, v3) => {}", + "sortText": "A", + "tags": [] + } +] Complete src/CompletionExpressions.res 177:34 posCursor:[177:34] posNoWhite:[177:33] Found expr:[177:3->177:36] @@ -924,16 +1049,17 @@ Resolved opens 1 Stdlib ContextPath CArgument Value[fnTakingCallback]($5) ContextPath Value[fnTakingCallback] Path fnTakingCallback -[{ - "label": "(~on=?, ~off=?, ()) => {}", - "kind": 12, - "tags": [], +[ + { "detail": "(~on: bool=?, ~off: bool=?, unit) => int", - "documentation": null, - "sortText": "A", "insertText": "(~on=?, ~off=?, ()) => {${0:()}}", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 12, + "label": "(~on=?, ~off=?, ()) => {}", + "sortText": "A", + "tags": [] + } +] Complete src/CompletionExpressions.res 185:15 posCursor:[185:15] posNoWhite:[185:14] Found expr:[181:2->185:16] @@ -948,55 +1074,52 @@ Resolved opens 1 Stdlib ContextPath CArgument Value[Console, log]($0) ContextPath Value[Console, log] Path Console.log -[{ - "label": "second2", - "kind": 12, - "tags": [], - "detail": "int", - "documentation": null - }, { - "label": "second", - "kind": 12, - "tags": [], - "detail": "bool", - "documentation": null - }, { - "label": "someBoolVar", - "kind": 12, - "tags": [], - "detail": "bool", - "documentation": null - }, { - "label": "s", +[ + { "detail": "int", "kind": 12, "label": "second2", "tags": [] }, + { "detail": "bool", "kind": 12, "label": "second", "tags": [] }, + { "detail": "bool", "kind": 12, "label": "someBoolVar", "tags": [] }, + { "detail": "bool", "kind": 12, "label": "s", "tags": [] }, + { + "detail": "(unit => unit, float) => timeoutId", + "documentation": { + "kind": "markdown", + "value": "\n`setTimeoutFloat(callback, durationInMilliseconds)` starts a timer that will execute `callback` after `durationInMilliseconds`.\n\nThe same as `setTimeout`, but allows you to pass a `float` instead of an `int` for the duration.\n\nSee [`setTimeout`](https://developer.mozilla.org/en-US/docs/Web/API/setTimeout) on MDN.\n\n## Examples\n\n```rescript\n// Log to the console after 200 milliseconds.\nlet timeoutId = setTimeoutFloat(() => {\n Console.log(\"This prints in 200 ms.\")\n}, 200.)\n```\n" + }, "kind": 12, - "tags": [], - "detail": "bool", - "documentation": null - }, { "label": "setTimeoutFloat", + "tags": [] + }, + { + "detail": "(unit => unit, float) => intervalId", + "documentation": { + "kind": "markdown", + "value": "\n`setIntervalFloat(callback, intervalInMilliseconds)` starts an interval that will execute `callback` every `durationInMilliseconds` milliseconds.\n\nThe same as `setInterval`, but allows you to pass a `float` instead of an `int` for the duration.\n\nSee [`setInterval`](https://developer.mozilla.org/en-US/docs/Web/API/setInterval) on MDN.\n\n## Examples\n\n```rescript\n// Log to the console ever 2 seconds (200 milliseconds).\nlet intervalId = setIntervalFloat(() => {\n Console.log(\"This prints every 200 ms\")\n}, 200.)\n\n// Stop the interval after 500 ms\nlet timeoutId = setTimeoutFloat(() => {\n clearInterval(intervalId)\n}, 500.0)\n```\n" + }, "kind": 12, - "tags": [], - "detail": "(unit => unit, float) => timeoutId", - "documentation": {"kind": "markdown", "value": "\n`setTimeoutFloat(callback, durationInMilliseconds)` starts a timer that will execute `callback` after `durationInMilliseconds`.\n\nThe same as `setTimeout`, but allows you to pass a `float` instead of an `int` for the duration.\n\nSee [`setTimeout`](https://developer.mozilla.org/en-US/docs/Web/API/setTimeout) on MDN.\n\n## Examples\n\n```rescript\n// Log to the console after 200 milliseconds.\nlet timeoutId = setTimeoutFloat(() => {\n Console.log(\"This prints in 200 ms.\")\n}, 200.)\n```\n"} - }, { "label": "setIntervalFloat", + "tags": [] + }, + { + "detail": "(unit => unit, int) => intervalId", + "documentation": { + "kind": "markdown", + "value": "\n`setInterval(callback, intervalInMilliseconds)` starts an interval that will execute `callback` every `durationInMilliseconds` milliseconds.\n\nSee [`setInterval`](https://developer.mozilla.org/en-US/docs/Web/API/setInterval) on MDN.\n\n## Examples\n\n```rescript\n// Log to the console ever 200 ms (200 milliseconds).\nlet intervalId = setInterval(() => {\n Console.log(\"This prints every 200 ms.\")\n}, 200)\n\nlet timeoutId = setTimeout(() => {\n clearInterval(intervalId)\n}, 500)\n```\n" + }, "kind": 12, - "tags": [], - "detail": "(unit => unit, float) => intervalId", - "documentation": {"kind": "markdown", "value": "\n`setIntervalFloat(callback, intervalInMilliseconds)` starts an interval that will execute `callback` every `durationInMilliseconds` milliseconds.\n\nThe same as `setInterval`, but allows you to pass a `float` instead of an `int` for the duration.\n\nSee [`setInterval`](https://developer.mozilla.org/en-US/docs/Web/API/setInterval) on MDN.\n\n## Examples\n\n```rescript\n// Log to the console ever 2 seconds (200 milliseconds).\nlet intervalId = setIntervalFloat(() => {\n Console.log(\"This prints every 200 ms\")\n}, 200.)\n\n// Stop the interval after 500 ms\nlet timeoutId = setTimeoutFloat(() => {\n clearInterval(intervalId)\n}, 500.0)\n```\n"} - }, { "label": "setInterval", + "tags": [] + }, + { + "detail": "(unit => unit, int) => timeoutId", + "documentation": { + "kind": "markdown", + "value": "\n`setTimeout(callback, durationInMilliseconds)` starts a timer that will execute `callback` after `durationInMilliseconds`.\n\nSee [`setTimeout`](https://developer.mozilla.org/en-US/docs/Web/API/setTimeout) on MDN.\n\n## Examples\n\n```rescript\n// Log to the console after 200 milliseconds.\nlet timeoutId = setTimeout(() => {\n Console.log(\"This prints in 200 ms.\")\n}, 200)\n```\n" + }, "kind": 12, - "tags": [], - "detail": "(unit => unit, int) => intervalId", - "documentation": {"kind": "markdown", "value": "\n`setInterval(callback, intervalInMilliseconds)` starts an interval that will execute `callback` every `durationInMilliseconds` milliseconds.\n\nSee [`setInterval`](https://developer.mozilla.org/en-US/docs/Web/API/setInterval) on MDN.\n\n## Examples\n\n```rescript\n// Log to the console ever 200 ms (200 milliseconds).\nlet intervalId = setInterval(() => {\n Console.log(\"This prints every 200 ms.\")\n}, 200)\n\nlet timeoutId = setTimeout(() => {\n clearInterval(intervalId)\n}, 500)\n```\n"} - }, { "label": "setTimeout", - "kind": 12, - "tags": [], - "detail": "(unit => unit, int) => timeoutId", - "documentation": {"kind": "markdown", "value": "\n`setTimeout(callback, durationInMilliseconds)` starts a timer that will execute `callback` after `durationInMilliseconds`.\n\nSee [`setTimeout`](https://developer.mozilla.org/en-US/docs/Web/API/setTimeout) on MDN.\n\n## Examples\n\n```rescript\n// Log to the console after 200 milliseconds.\nlet timeoutId = setTimeout(() => {\n Console.log(\"This prints in 200 ms.\")\n}, 200)\n```\n"} - }] + "tags": [] + } +] Complete src/CompletionExpressions.res 196:14 posCursor:[196:14] posNoWhite:[196:13] Found expr:[196:3->196:14] @@ -1013,13 +1136,18 @@ Path fff CPPipe pathFromEnv: found:true Path CompletionExpressions.someOpt Path someOpt -[{ - "label": "someOptField", - "kind": 5, - "tags": [], +[ + { "detail": "bool", - "documentation": {"kind": "markdown", "value": "```rescript\nsomeOptField?: bool\n```\n\n```rescript\ntype recordWithOptionalField = {\n someField: int,\n someOptField?: bool,\n}\n```"} - }] + "documentation": { + "kind": "markdown", + "value": "```rescript\nsomeOptField?: bool\n```\n\n```rescript\ntype recordWithOptionalField = {\n someField: int,\n someOptField?: bool,\n}\n```" + }, + "kind": 5, + "label": "someOptField", + "tags": [] + } +] Complete src/CompletionExpressions.res 205:11 posCursor:[205:11] posNoWhite:[205:10] Found expr:[205:3->205:12] @@ -1030,16 +1158,17 @@ Resolved opens 1 Stdlib ContextPath CArgument Value[takesCb]($0) ContextPath Value[takesCb] Path takesCb -[{ - "label": "someTyp => someTyp", - "kind": 12, - "tags": [], +[ + { "detail": "someTyp => 'a", - "documentation": null, - "sortText": "A", "insertText": "${1:someTyp} => ${0:someTyp}", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 12, + "label": "someTyp => someTyp", + "sortText": "A", + "tags": [] + } +] Complete src/CompletionExpressions.res 216:12 posCursor:[216:12] posNoWhite:[216:11] Found expr:[216:3->216:13] @@ -1050,16 +1179,17 @@ Resolved opens 1 Stdlib ContextPath CArgument Value[takesCb2]($0) ContextPath Value[takesCb2] Path takesCb2 -[{ - "label": "environment => environment", - "kind": 12, - "tags": [], +[ + { "detail": "Environment.t => 'a", - "documentation": null, - "sortText": "A", "insertText": "${1:environment} => ${0:environment}", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 12, + "label": "environment => environment", + "sortText": "A", + "tags": [] + } +] Complete src/CompletionExpressions.res 225:12 posCursor:[225:12] posNoWhite:[225:11] Found expr:[225:3->225:13] @@ -1070,16 +1200,17 @@ Resolved opens 1 Stdlib ContextPath CArgument Value[takesCb3]($0) ContextPath Value[takesCb3] Path takesCb3 -[{ - "label": "apiCallResult => apiCallResult", - "kind": 12, - "tags": [], +[ + { "detail": "apiCallResult => 'a", - "documentation": null, - "sortText": "A", "insertText": "${1:apiCallResult} => ${0:apiCallResult}", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 12, + "label": "apiCallResult => apiCallResult", + "sortText": "A", + "tags": [] + } +] Complete src/CompletionExpressions.res 232:12 posCursor:[232:12] posNoWhite:[232:11] Found expr:[232:3->232:13] @@ -1090,16 +1221,17 @@ Resolved opens 1 Stdlib ContextPath CArgument Value[takesCb4]($0) ContextPath Value[takesCb4] Path takesCb4 -[{ - "label": "apiCallResult => apiCallResult", - "kind": 12, - "tags": [], +[ + { "detail": "option => 'a", - "documentation": null, - "sortText": "A", "insertText": "${1:apiCallResult} => ${0:apiCallResult}", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 12, + "label": "apiCallResult => apiCallResult", + "sortText": "A", + "tags": [] + } +] Complete src/CompletionExpressions.res 239:12 posCursor:[239:12] posNoWhite:[239:11] Found expr:[239:3->239:13] @@ -1110,16 +1242,17 @@ Resolved opens 1 Stdlib ContextPath CArgument Value[takesCb5]($0) ContextPath Value[takesCb5] Path takesCb5 -[{ - "label": "apiCallResults => apiCallResults", - "kind": 12, - "tags": [], +[ + { "detail": "array> => 'a", - "documentation": null, - "sortText": "A", "insertText": "${1:apiCallResults} => ${0:apiCallResults}", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 12, + "label": "apiCallResults => apiCallResults", + "sortText": "A", + "tags": [] + } +] Complete src/CompletionExpressions.res 250:30 posCursor:[250:30] posNoWhite:[250:29] Found expr:[250:3->250:31] @@ -1130,16 +1263,17 @@ Resolved opens 1 Stdlib ContextPath CArgument Value[commitLocalUpdate](~updater) ContextPath Value[commitLocalUpdate] Path commitLocalUpdate -[{ - "label": "recordSourceSelectorProxy => recordSourceSelectorProxy", - "kind": 12, - "tags": [], +[ + { "detail": "RecordSourceSelectorProxy.t => unit", - "documentation": null, - "sortText": "A", "insertText": "${1:recordSourceSelectorProxy} => ${0:recordSourceSelectorProxy}", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 12, + "label": "recordSourceSelectorProxy => recordSourceSelectorProxy", + "sortText": "A", + "tags": [] + } +] Complete src/CompletionExpressions.res 257:25 posCursor:[257:25] posNoWhite:[257:24] Found expr:[257:3->257:26] @@ -1150,16 +1284,17 @@ Resolved opens 1 Stdlib ContextPath CArgument Value[fnTakingAsyncCallback]($0) ContextPath Value[fnTakingAsyncCallback] Path fnTakingAsyncCallback -[{ - "label": "async () => {}", - "kind": 12, - "tags": [], +[ + { "detail": "unit => promise", - "documentation": null, - "sortText": "A", "insertText": "async () => ${0:()}", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 12, + "label": "async () => {}", + "sortText": "A", + "tags": [] + } +] Complete src/CompletionExpressions.res 262:23 posCursor:[262:23] posNoWhite:[262:22] Found expr:[262:3->262:24] @@ -1169,16 +1304,17 @@ Resolved opens 1 Stdlib ContextPath CArgument Value[Belt, Array, map]($1) ContextPath Value[Belt, Array, map] Path Belt.Array.map -[{ - "label": "v => v", - "kind": 12, - "tags": [], +[ + { "detail": "'a => 'b", - "documentation": null, - "sortText": "A", "insertText": "${1:v} => ${0:v}", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 12, + "label": "v => v", + "sortText": "A", + "tags": [] + } +] Complete src/CompletionExpressions.res 271:15 posCursor:[271:15] posNoWhite:[271:14] Found expr:[271:3->271:16] @@ -1189,15 +1325,20 @@ Resolved opens 1 Stdlib ContextPath CArgument Value[takesExotic]($0) ContextPath Value[takesExotic] Path takesExotic -[{ - "label": "#\"some exotic\"", - "kind": 4, - "tags": [], +[ + { "detail": "#\"some exotic\"", - "documentation": {"kind": "markdown", "value": "```rescript\n#\"some exotic\"\n```\n\n```rescript\n[#\"some exotic\"]\n```"}, + "documentation": { + "kind": "markdown", + "value": "```rescript\n#\"some exotic\"\n```\n\n```rescript\n[#\"some exotic\"]\n```" + }, "insertText": "#\"some exotic\"", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 4, + "label": "#\"some exotic\"", + "tags": [] + } +] Complete src/CompletionExpressions.res 278:23 posCursor:[278:23] posNoWhite:[278:22] Found expr:[278:3->278:24] @@ -1208,31 +1349,44 @@ Resolved opens 1 Stdlib ContextPath CArgument Value[fnTakingPolyVariant]($0) ContextPath Value[fnTakingPolyVariant] Path fnTakingPolyVariant -[{ - "label": "#one", - "kind": 4, - "tags": [], +[ + { "detail": "#one", - "documentation": {"kind": "markdown", "value": "```rescript\n#one\n```\n\n```rescript\n[#one | #three(someRecord, bool) | #two(bool)]\n```"}, + "documentation": { + "kind": "markdown", + "value": "```rescript\n#one\n```\n\n```rescript\n[#one | #three(someRecord, bool) | #two(bool)]\n```" + }, "insertText": "#one", - "insertTextFormat": 2 - }, { - "label": "#three(_, _)", + "insertTextFormat": 2, "kind": 4, - "tags": [], + "label": "#one", + "tags": [] + }, + { "detail": "#three(someRecord, bool)", - "documentation": {"kind": "markdown", "value": "```rescript\n#three(someRecord, bool)\n```\n\n```rescript\n[#one | #three(someRecord, bool) | #two(bool)]\n```"}, + "documentation": { + "kind": "markdown", + "value": "```rescript\n#three(someRecord, bool)\n```\n\n```rescript\n[#one | #three(someRecord, bool) | #two(bool)]\n```" + }, "insertText": "#three(${1:_}, ${2:_})", - "insertTextFormat": 2 - }, { - "label": "#two(_)", + "insertTextFormat": 2, "kind": 4, - "tags": [], + "label": "#three(_, _)", + "tags": [] + }, + { "detail": "#two(bool)", - "documentation": {"kind": "markdown", "value": "```rescript\n#two(bool)\n```\n\n```rescript\n[#one | #three(someRecord, bool) | #two(bool)]\n```"}, + "documentation": { + "kind": "markdown", + "value": "```rescript\n#two(bool)\n```\n\n```rescript\n[#one | #three(someRecord, bool) | #two(bool)]\n```" + }, "insertText": "#two($0)", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 4, + "label": "#two(_)", + "tags": [] + } +] Complete src/CompletionExpressions.res 281:24 posCursor:[281:24] posNoWhite:[281:23] Found expr:[281:3->302:1] @@ -1243,31 +1397,44 @@ Resolved opens 1 Stdlib ContextPath CArgument Value[fnTakingPolyVariant]($0) ContextPath Value[fnTakingPolyVariant] Path fnTakingPolyVariant -[{ - "label": "#one", - "kind": 4, - "tags": [], +[ + { "detail": "#one", - "documentation": {"kind": "markdown", "value": "```rescript\n#one\n```\n\n```rescript\n[#one | #three(someRecord, bool) | #two(bool)]\n```"}, + "documentation": { + "kind": "markdown", + "value": "```rescript\n#one\n```\n\n```rescript\n[#one | #three(someRecord, bool) | #two(bool)]\n```" + }, "insertText": "one", - "insertTextFormat": 2 - }, { - "label": "#three(_, _)", + "insertTextFormat": 2, "kind": 4, - "tags": [], + "label": "#one", + "tags": [] + }, + { "detail": "#three(someRecord, bool)", - "documentation": {"kind": "markdown", "value": "```rescript\n#three(someRecord, bool)\n```\n\n```rescript\n[#one | #three(someRecord, bool) | #two(bool)]\n```"}, + "documentation": { + "kind": "markdown", + "value": "```rescript\n#three(someRecord, bool)\n```\n\n```rescript\n[#one | #three(someRecord, bool) | #two(bool)]\n```" + }, "insertText": "three(${1:_}, ${2:_})", - "insertTextFormat": 2 - }, { - "label": "#two(_)", + "insertTextFormat": 2, "kind": 4, - "tags": [], + "label": "#three(_, _)", + "tags": [] + }, + { "detail": "#two(bool)", - "documentation": {"kind": "markdown", "value": "```rescript\n#two(bool)\n```\n\n```rescript\n[#one | #three(someRecord, bool) | #two(bool)]\n```"}, + "documentation": { + "kind": "markdown", + "value": "```rescript\n#two(bool)\n```\n\n```rescript\n[#one | #three(someRecord, bool) | #two(bool)]\n```" + }, "insertText": "two($0)", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 4, + "label": "#two(_)", + "tags": [] + } +] Complete src/CompletionExpressions.res 284:25 posCursor:[284:25] posNoWhite:[284:24] Found expr:[284:3->284:26] @@ -1278,15 +1445,20 @@ Resolved opens 1 Stdlib ContextPath CArgument Value[fnTakingPolyVariant]($0) ContextPath Value[fnTakingPolyVariant] Path fnTakingPolyVariant -[{ - "label": "#one", - "kind": 4, - "tags": [], +[ + { "detail": "#one", - "documentation": {"kind": "markdown", "value": "```rescript\n#one\n```\n\n```rescript\n[#one | #three(someRecord, bool) | #two(bool)]\n```"}, + "documentation": { + "kind": "markdown", + "value": "```rescript\n#one\n```\n\n```rescript\n[#one | #three(someRecord, bool) | #two(bool)]\n```" + }, "insertText": "one", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 4, + "label": "#one", + "tags": [] + } +] Complete src/CompletionExpressions.res 287:24 posCursor:[287:24] posNoWhite:[287:23] Found expr:[287:3->287:25] @@ -1297,15 +1469,20 @@ Resolved opens 1 Stdlib ContextPath CArgument Value[fnTakingPolyVariant]($0) ContextPath Value[fnTakingPolyVariant] Path fnTakingPolyVariant -[{ - "label": "#one", - "kind": 4, - "tags": [], +[ + { "detail": "#one", - "documentation": {"kind": "markdown", "value": "```rescript\n#one\n```\n\n```rescript\n[#one | #three(someRecord, bool) | #two(bool)]\n```"}, + "documentation": { + "kind": "markdown", + "value": "```rescript\n#one\n```\n\n```rescript\n[#one | #three(someRecord, bool) | #two(bool)]\n```" + }, "insertText": "#one", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 4, + "label": "#one", + "tags": [] + } +] Complete src/CompletionExpressions.res 306:41 XXX Not found! @@ -1314,15 +1491,16 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Type[withIntLocal] Path withIntLocal -[{ - "label": "SuperInt.make()", - "kind": 12, - "tags": [], +[ + { "detail": "int => t", - "documentation": null, "insertText": "SuperInt.make($0)", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 12, + "label": "SuperInt.make()", + "tags": [] + } +] Complete src/CompletionExpressions.res 309:36 posCursor:[309:36] posNoWhite:[309:35] Found expr:[309:3->309:37] @@ -1333,15 +1511,16 @@ Resolved opens 1 Stdlib ContextPath CArgument Value[CompletionSupport, makeTestHidden]($0) ContextPath Value[CompletionSupport, makeTestHidden] Path CompletionSupport.makeTestHidden -[{ - "label": "CompletionSupport.TestHidden.make()", - "kind": 12, - "tags": [], +[ + { "detail": "int => t", - "documentation": null, "insertText": "CompletionSupport.TestHidden.make($0)", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 12, + "label": "CompletionSupport.TestHidden.make()", + "tags": [] + } +] Complete src/CompletionExpressions.res 313:36 posCursor:[313:36] posNoWhite:[313:35] Found expr:[313:3->313:37] @@ -1353,15 +1532,16 @@ Resolved opens 2 Stdlib CompletionSupport ContextPath CArgument Value[CompletionSupport, makeTestHidden]($0) ContextPath Value[CompletionSupport, makeTestHidden] Path CompletionSupport.makeTestHidden -[{ - "label": "TestHidden.make()", - "kind": 12, - "tags": [], +[ + { "detail": "int => t", - "documentation": null, "insertText": "TestHidden.make($0)", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 12, + "label": "TestHidden.make()", + "tags": [] + } +] Complete src/CompletionExpressions.res 321:11 posCursor:[321:11] posNoWhite:[321:10] Found expr:[321:3->321:12] @@ -1373,31 +1553,32 @@ Resolved opens 2 Stdlib CompletionSupport ContextPath CArgument Value[mkStuff]($0) ContextPath Value[mkStuff] Path mkStuff -[{ - "label": "//g", - "kind": 4, - "tags": [], +[ + { "detail": "Regular expression", - "documentation": null, "insertText": "/$0/g", - "insertTextFormat": 2 - }, { - "label": "RegExp.fromString()", - "kind": 12, - "tags": [], + "insertTextFormat": 2, + "kind": 4, + "label": "//g", + "tags": [] + }, + { "detail": "(string, ~flags: string=?) => t", - "documentation": null, "insertText": "RegExp.fromString($0)", - "insertTextFormat": 2 - }, { - "label": "RegExp.fromStringWithFlags()", + "insertTextFormat": 2, "kind": 12, - "tags": [], + "label": "RegExp.fromString()", + "tags": [] + }, + { "detail": "(string, ~flags: string) => t", - "documentation": null, "insertText": "RegExp.fromStringWithFlags($0)", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 12, + "label": "RegExp.fromStringWithFlags()", + "tags": [] + } +] Complete src/CompletionExpressions.res 352:24 posCursor:[352:24] posNoWhite:[352:23] Found expr:[352:3->352:25] @@ -1409,31 +1590,32 @@ Resolved opens 2 Stdlib CompletionSupport ContextPath CArgument Value[tArgCompletionTestFn]($0) ContextPath Value[tArgCompletionTestFn] Path tArgCompletionTestFn -[{ - "label": "Money.fromInt()", - "kind": 12, - "tags": [], +[ + { "detail": "int => t", - "documentation": null, "insertText": "Money.fromInt($0)", - "insertTextFormat": 2 - }, { - "label": "Money.make()", + "insertTextFormat": 2, "kind": 12, - "tags": [], + "label": "Money.fromInt()", + "tags": [] + }, + { "detail": "unit => t", - "documentation": null, "insertText": "Money.make($0)", - "insertTextFormat": 2 - }, { - "label": "Money.zero", + "insertTextFormat": 2, "kind": 12, - "tags": [], + "label": "Money.make()", + "tags": [] + }, + { "detail": "t", - "documentation": null, "insertText": "Money.zero", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 12, + "label": "Money.zero", + "tags": [] + } +] Complete src/CompletionExpressions.res 357:37 posCursor:[357:37] posNoWhite:[357:36] Found expr:[357:3->357:38] @@ -1445,31 +1627,32 @@ Resolved opens 2 Stdlib CompletionSupport ContextPath CArgument Value[labeledTArgCompletionTestFn](~tVal) ContextPath Value[labeledTArgCompletionTestFn] Path labeledTArgCompletionTestFn -[{ - "label": "Money.fromInt()", - "kind": 12, - "tags": [], +[ + { "detail": "int => t", - "documentation": null, "insertText": "Money.fromInt($0)", - "insertTextFormat": 2 - }, { - "label": "Money.make()", + "insertTextFormat": 2, "kind": 12, - "tags": [], + "label": "Money.fromInt()", + "tags": [] + }, + { "detail": "unit => t", - "documentation": null, "insertText": "Money.make($0)", - "insertTextFormat": 2 - }, { - "label": "Money.zero", + "insertTextFormat": 2, "kind": 12, - "tags": [], + "label": "Money.make()", + "tags": [] + }, + { "detail": "t", - "documentation": null, "insertText": "Money.zero", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 12, + "label": "Money.zero", + "tags": [] + } +] Complete src/CompletionExpressions.res 362:18 posCursor:[362:18] posNoWhite:[362:17] Found expr:[362:3->362:32] @@ -1488,13 +1671,18 @@ Path someTyp CPPipe pathFromEnv: found:true Path CompletionExpressions. Path -[{ - "label": "test", - "kind": 5, - "tags": [], +[ + { "detail": "bool", - "documentation": {"kind": "markdown", "value": "```rescript\ntest: bool\n```\n\n```rescript\ntype someTyp = {test: bool}\n```"} - }] + "documentation": { + "kind": "markdown", + "value": "```rescript\ntest: bool\n```\n\n```rescript\ntype someTyp = {test: bool}\n```" + }, + "kind": 5, + "label": "test", + "tags": [] + } +] Complete src/CompletionExpressions.res 380:22 posCursor:[380:22] posNoWhite:[380:18] Found expr:[380:13->386:2] @@ -1506,13 +1694,18 @@ Resolved opens 2 Stdlib CompletionSupport ContextPath CArgument Value[hook]($0) ContextPath Value[hook] Path hook -[{ - "label": "operator", - "kind": 5, - "tags": [], +[ + { "detail": "[#\"and\" | #or]", - "documentation": {"kind": "markdown", "value": "```rescript\noperator?: [#\"and\" | #or]\n```\n\n```rescript\ntype config = {includeName: bool, operator: option<[#\"and\" | #or]>, showMore: bool}\n```"} - }] + "documentation": { + "kind": "markdown", + "value": "```rescript\noperator?: [#\"and\" | #or]\n```\n\n```rescript\ntype config = {includeName: bool, operator: option<[#\"and\" | #or]>, showMore: bool}\n```" + }, + "kind": 5, + "label": "operator", + "tags": [] + } +] Complete src/CompletionExpressions.res 382:8 posCursor:[382:8] posNoWhite:[382:7] Found expr:[380:13->386:2] @@ -1524,13 +1717,18 @@ Resolved opens 2 Stdlib CompletionSupport ContextPath CArgument Value[hook]($0) ContextPath Value[hook] Path hook -[{ - "label": "operator", - "kind": 5, - "tags": [], +[ + { "detail": "[#\"and\" | #or]", - "documentation": {"kind": "markdown", "value": "```rescript\noperator?: [#\"and\" | #or]\n```\n\n```rescript\ntype config = {includeName: bool, operator: option<[#\"and\" | #or]>, showMore: bool}\n```"} - }] + "documentation": { + "kind": "markdown", + "value": "```rescript\noperator?: [#\"and\" | #or]\n```\n\n```rescript\ntype config = {includeName: bool, operator: option<[#\"and\" | #or]>, showMore: bool}\n```" + }, + "kind": 5, + "label": "operator", + "tags": [] + } +] Complete src/CompletionExpressions.res 388:18 posCursor:[388:18] posNoWhite:[388:17] Found expr:[388:3->388:24] @@ -1549,11 +1747,16 @@ Path someTyp CPPipe pathFromEnv: found:true Path CompletionExpressions. Path -[{ - "label": "test", - "kind": 5, - "tags": [], +[ + { "detail": "bool", - "documentation": {"kind": "markdown", "value": "```rescript\ntest: bool\n```\n\n```rescript\ntype someTyp = {test: bool}\n```"} - }] + "documentation": { + "kind": "markdown", + "value": "```rescript\ntest: bool\n```\n\n```rescript\ntype someTyp = {test: bool}\n```" + }, + "kind": 5, + "label": "test", + "tags": [] + } +] diff --git a/tests/analysis_tests/tests/src/expected/CompletionFromModule.res.txt b/tests/analysis_tests/tests/src/expected/CompletionFromModule.res.txt index 8cfb06f7ea8..738afd8d01f 100644 --- a/tests/analysis_tests/tests/src/expected/CompletionFromModule.res.txt +++ b/tests/analysis_tests/tests/src/expected/CompletionFromModule.res.txt @@ -13,25 +13,35 @@ Path n CPPipe pathFromEnv:SomeModule found:true Path SomeModule. Path -[{ - "label": "name", - "kind": 5, - "tags": [], +[ + { "detail": "string", - "documentation": {"kind": "markdown", "value": "```rescript\nname: string\n```\n\n```rescript\ntype t = {name: string}\n```"} - }, { - "label": "->SomeModule.getName", - "kind": 12, - "tags": [], + "documentation": { + "kind": "markdown", + "value": "```rescript\nname: string\n```\n\n```rescript\ntype t = {name: string}\n```" + }, + "kind": 5, + "label": "name", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 5, "line": 10 }, + "start": { "character": 4, "line": 10 } + } + } + ], "detail": "t => string", - "documentation": null, - "sortText": "getName", "insertText": "->SomeModule.getName", - "additionalTextEdits": [{ - "range": {"start": {"line": 10, "character": 4}, "end": {"line": 10, "character": 5}}, - "newText": "" - }] - }] + "kind": 12, + "label": "->SomeModule.getName", + "sortText": "getName", + "tags": [] + } +] Complete src/CompletionFromModule.res 30:6 posCursor:[30:6] posNoWhite:[30:5] Found expr:[30:3->30:6] @@ -49,61 +59,86 @@ CPPipe pathFromEnv:SomeOtherModule found:true Path SomeOtherModule. Path CompletionFromModule.SomeOtherModule. Path -[{ - "label": "nname", - "kind": 5, - "tags": [], +[ + { "detail": "string", - "documentation": {"kind": "markdown", "value": "```rescript\nnname: string\n```\n\n```rescript\ntype typeOutsideModule = {nname: string}\n```"} - }, { - "label": "->SomeOtherModule.getNName", - "kind": 12, - "tags": [], + "documentation": { + "kind": "markdown", + "value": "```rescript\nnname: string\n```\n\n```rescript\ntype typeOutsideModule = {nname: string}\n```" + }, + "kind": 5, + "label": "nname", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 6, "line": 30 }, + "start": { "character": 5, "line": 30 } + } + } + ], "detail": "t => string", - "documentation": null, - "sortText": "getNName", "insertText": "->SomeOtherModule.getNName", - "additionalTextEdits": [{ - "range": {"start": {"line": 30, "character": 5}, "end": {"line": 30, "character": 6}}, - "newText": "" - }] - }, { - "label": "->SomeOtherModule.getNName2", "kind": 12, - "tags": [], + "label": "->SomeOtherModule.getNName", + "sortText": "getNName", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 6, "line": 30 }, + "start": { "character": 5, "line": 30 } + } + } + ], "detail": "typeOutsideModule => string", - "documentation": null, - "sortText": "getNName2", "insertText": "->SomeOtherModule.getNName2", - "additionalTextEdits": [{ - "range": {"start": {"line": 30, "character": 5}, "end": {"line": 30, "character": 6}}, - "newText": "" - }] - }, { - "label": "->SomeOtherModule.getNName", "kind": 12, - "tags": [], + "label": "->SomeOtherModule.getNName2", + "sortText": "getNName2", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 6, "line": 30 }, + "start": { "character": 5, "line": 30 } + } + } + ], "detail": "t => string", - "documentation": null, - "sortText": "getNName", "insertText": "->SomeOtherModule.getNName", - "additionalTextEdits": [{ - "range": {"start": {"line": 30, "character": 5}, "end": {"line": 30, "character": 6}}, - "newText": "" - }] - }, { - "label": "->SomeOtherModule.getNName2", "kind": 12, - "tags": [], + "label": "->SomeOtherModule.getNName", + "sortText": "getNName", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 6, "line": 30 }, + "start": { "character": 5, "line": 30 } + } + } + ], "detail": "typeOutsideModule => string", - "documentation": null, - "sortText": "getNName2", "insertText": "->SomeOtherModule.getNName2", - "additionalTextEdits": [{ - "range": {"start": {"line": 30, "character": 5}, "end": {"line": 30, "character": 6}}, - "newText": "" - }] - }] + "kind": 12, + "label": "->SomeOtherModule.getNName2", + "sortText": "getNName2", + "tags": [] + } +] Complete src/CompletionFromModule.res 33:32 XXX Not found! @@ -112,13 +147,14 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Module[SomeOthe] Path SomeOthe -[{ - "label": "SomeOtherModule", - "kind": 9, - "tags": [], +[ + { "detail": "module SomeOtherModule", - "documentation": null - }] + "kind": 9, + "label": "SomeOtherModule", + "tags": [] + } +] Complete src/CompletionFromModule.res 38:8 posCursor:[38:8] posNoWhite:[38:7] Found expr:[38:3->0:-1] @@ -132,19 +168,20 @@ CPPipe pathFromEnv: found:true Path CompletionFromModule. Path CompletionFromModule.SomeOtherModule. Path -[{ - "label": "SomeOtherModule.getNName", - "kind": 12, - "tags": [], +[ + { "detail": "t => string", - "documentation": null - }, { - "label": "SomeOtherModule.getNName2", "kind": 12, - "tags": [], + "label": "SomeOtherModule.getNName", + "tags": [] + }, + { "detail": "typeOutsideModule => string", - "documentation": null - }] + "kind": 12, + "label": "SomeOtherModule.getNName2", + "tags": [] + } +] Complete src/CompletionFromModule.res 42:8 posCursor:[42:8] posNoWhite:[42:7] Found expr:[42:3->0:-1] @@ -159,17 +196,13 @@ CPPipe pathFromEnv: found:true Path CompletionFromModule. Path CompletionFromModule.SomeOtherModule. Path -[{ - "label": "getNName", +[ + { "detail": "t => string", "kind": 12, "label": "getNName", "tags": [] }, + { + "detail": "typeOutsideModule => string", "kind": 12, - "tags": [], - "detail": "t => string", - "documentation": null - }, { "label": "getNName2", - "kind": 12, - "tags": [], - "detail": "typeOutsideModule => string", - "documentation": null - }] + "tags": [] + } +] diff --git a/tests/analysis_tests/tests/src/expected/CompletionFromModule2.res.txt b/tests/analysis_tests/tests/src/expected/CompletionFromModule2.res.txt index eb647d43c57..790684f6236 100644 --- a/tests/analysis_tests/tests/src/expected/CompletionFromModule2.res.txt +++ b/tests/analysis_tests/tests/src/expected/CompletionFromModule2.res.txt @@ -13,25 +13,35 @@ Path CompletionFromModule.n CPPipe pathFromEnv:SomeModule found:true Path CompletionFromModule.SomeModule. Path -[{ - "label": "name", - "kind": 5, - "tags": [], +[ + { "detail": "string", - "documentation": {"kind": "markdown", "value": "```rescript\nname: string\n```\n\n```rescript\ntype t = {name: string}\n```"} - }, { - "label": "->CompletionFromModule.SomeModule.getName", - "kind": 12, - "tags": [], + "documentation": { + "kind": "markdown", + "value": "```rescript\nname: string\n```\n\n```rescript\ntype t = {name: string}\n```" + }, + "kind": 5, + "label": "name", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 26, "line": 2 }, + "start": { "character": 25, "line": 2 } + } + } + ], "detail": "t => string", - "documentation": null, - "sortText": "getName", "insertText": "->CompletionFromModule.SomeModule.getName", - "additionalTextEdits": [{ - "range": {"start": {"line": 2, "character": 25}, "end": {"line": 2, "character": 26}}, - "newText": "" - }] - }] + "kind": 12, + "label": "->CompletionFromModule.SomeModule.getName", + "sortText": "getName", + "tags": [] + } +] Complete src/CompletionFromModule2.res 5:27 posCursor:[5:27] posNoWhite:[5:26] Found expr:[5:3->5:27] @@ -49,61 +59,86 @@ CPPipe pathFromEnv:SomeOtherModule found:true Path CompletionFromModule.SomeOtherModule. Path CompletionFromModule.SomeOtherModule. Path -[{ - "label": "nname", - "kind": 5, - "tags": [], +[ + { "detail": "string", - "documentation": {"kind": "markdown", "value": "```rescript\nnname: string\n```\n\n```rescript\ntype typeOutsideModule = {nname: string}\n```"} - }, { - "label": "->CompletionFromModule.SomeOtherModule.getNName", - "kind": 12, - "tags": [], + "documentation": { + "kind": "markdown", + "value": "```rescript\nnname: string\n```\n\n```rescript\ntype typeOutsideModule = {nname: string}\n```" + }, + "kind": 5, + "label": "nname", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 27, "line": 5 }, + "start": { "character": 26, "line": 5 } + } + } + ], "detail": "t => string", - "documentation": null, - "sortText": "getNName", "insertText": "->CompletionFromModule.SomeOtherModule.getNName", - "additionalTextEdits": [{ - "range": {"start": {"line": 5, "character": 26}, "end": {"line": 5, "character": 27}}, - "newText": "" - }] - }, { - "label": "->CompletionFromModule.SomeOtherModule.getNName2", "kind": 12, - "tags": [], + "label": "->CompletionFromModule.SomeOtherModule.getNName", + "sortText": "getNName", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 27, "line": 5 }, + "start": { "character": 26, "line": 5 } + } + } + ], "detail": "typeOutsideModule => string", - "documentation": null, - "sortText": "getNName2", "insertText": "->CompletionFromModule.SomeOtherModule.getNName2", - "additionalTextEdits": [{ - "range": {"start": {"line": 5, "character": 26}, "end": {"line": 5, "character": 27}}, - "newText": "" - }] - }, { - "label": "->CompletionFromModule.SomeOtherModule.getNName", "kind": 12, - "tags": [], + "label": "->CompletionFromModule.SomeOtherModule.getNName2", + "sortText": "getNName2", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 27, "line": 5 }, + "start": { "character": 26, "line": 5 } + } + } + ], "detail": "t => string", - "documentation": null, - "sortText": "getNName", "insertText": "->CompletionFromModule.SomeOtherModule.getNName", - "additionalTextEdits": [{ - "range": {"start": {"line": 5, "character": 26}, "end": {"line": 5, "character": 27}}, - "newText": "" - }] - }, { - "label": "->CompletionFromModule.SomeOtherModule.getNName2", "kind": 12, - "tags": [], + "label": "->CompletionFromModule.SomeOtherModule.getNName", + "sortText": "getNName", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 27, "line": 5 }, + "start": { "character": 26, "line": 5 } + } + } + ], "detail": "typeOutsideModule => string", - "documentation": null, - "sortText": "getNName2", "insertText": "->CompletionFromModule.SomeOtherModule.getNName2", - "additionalTextEdits": [{ - "range": {"start": {"line": 5, "character": 26}, "end": {"line": 5, "character": 27}}, - "newText": "" - }] - }] + "kind": 12, + "label": "->CompletionFromModule.SomeOtherModule.getNName2", + "sortText": "getNName2", + "tags": [] + } +] Complete src/CompletionFromModule2.res 8:29 posCursor:[8:29] posNoWhite:[8:28] Found expr:[8:3->0:-1] @@ -117,19 +152,20 @@ CPPipe pathFromEnv: found:true Path CompletionFromModule. Path CompletionFromModule.SomeOtherModule. Path -[{ - "label": "CompletionFromModule.SomeOtherModule.getNName", - "kind": 12, - "tags": [], +[ + { "detail": "t => string", - "documentation": null - }, { - "label": "CompletionFromModule.SomeOtherModule.getNName2", "kind": 12, - "tags": [], + "label": "CompletionFromModule.SomeOtherModule.getNName", + "tags": [] + }, + { "detail": "typeOutsideModule => string", - "documentation": null - }] + "kind": 12, + "label": "CompletionFromModule.SomeOtherModule.getNName2", + "tags": [] + } +] Complete src/CompletionFromModule2.res 12:29 posCursor:[12:29] posNoWhite:[12:28] Found expr:[12:3->0:-1] @@ -144,17 +180,13 @@ CPPipe pathFromEnv: found:true Path CompletionFromModule. Path CompletionFromModule.SomeOtherModule. Path -[{ - "label": "getNName", +[ + { "detail": "t => string", "kind": 12, "label": "getNName", "tags": [] }, + { + "detail": "typeOutsideModule => string", "kind": 12, - "tags": [], - "detail": "t => string", - "documentation": null - }, { "label": "getNName2", - "kind": 12, - "tags": [], - "detail": "typeOutsideModule => string", - "documentation": null - }] + "tags": [] + } +] diff --git a/tests/analysis_tests/tests/src/expected/CompletionFunctionArguments.res.txt b/tests/analysis_tests/tests/src/expected/CompletionFunctionArguments.res.txt index 48c89535fbe..e5a13c3b6dc 100644 --- a/tests/analysis_tests/tests/src/expected/CompletionFunctionArguments.res.txt +++ b/tests/analysis_tests/tests/src/expected/CompletionFunctionArguments.res.txt @@ -7,19 +7,10 @@ Resolved opens 1 Stdlib ContextPath CArgument Value[someFn](~isOn) ContextPath Value[someFn] Path someFn -[{ - "label": "true", - "kind": 4, - "tags": [], - "detail": "bool", - "documentation": null - }, { - "label": "false", - "kind": 4, - "tags": [], - "detail": "bool", - "documentation": null - }] +[ + { "detail": "bool", "kind": 4, "label": "true", "tags": [] }, + { "detail": "bool", "kind": 4, "label": "false", "tags": [] } +] Complete src/CompletionFunctionArguments.res 13:25 posCursor:[13:25] posNoWhite:[13:24] Found expr:[13:11->13:26] @@ -30,26 +21,26 @@ Resolved opens 1 Stdlib ContextPath CArgument Value[someFn](~isOn) ContextPath Value[someFn] Path someFn -[{ - "label": "true", - "kind": 4, - "tags": [], +[ + { "detail": "bool", - "documentation": null, - "sortText": "A true" - }, { - "label": "tLocalVar", + "kind": 4, + "label": "true", + "sortText": "A true", + "tags": [] + }, + { "detail": "bool", "kind": 12, "label": "tLocalVar", "tags": [] }, + { + "detail": "'a => Type.t", + "documentation": { + "kind": "markdown", + "value": "\n`typeof(value)` exposes JavaScript's `typeof` operator and returns a `Type.t` enum.\nIt helps you inspect values that come from JavaScript APIs.\n\n## Examples\n\n```rescript\ntypeof(1) == #number\ntypeof(\"a\") == #string\n```\n" + }, "kind": 12, - "tags": [], - "detail": "bool", - "documentation": null - }, { "label": "typeof", - "kind": 12, - "tags": [], - "detail": "'a => Type.t", - "documentation": {"kind": "markdown", "value": "\n`typeof(value)` exposes JavaScript's `typeof` operator and returns a `Type.t` enum.\nIt helps you inspect values that come from JavaScript APIs.\n\n## Examples\n\n```rescript\ntypeof(1) == #number\ntypeof(\"a\") == #string\n```\n"} - }] + "tags": [] + } +] Complete src/CompletionFunctionArguments.res 16:25 posCursor:[16:25] posNoWhite:[16:24] Found expr:[16:11->16:26] @@ -60,19 +51,10 @@ Resolved opens 1 Stdlib ContextPath CArgument Value[someFn](~isOff) ContextPath Value[someFn] Path someFn -[{ - "label": "true", - "kind": 4, - "tags": [], - "detail": "bool", - "documentation": null - }, { - "label": "false", - "kind": 4, - "tags": [], - "detail": "bool", - "documentation": null - }] +[ + { "detail": "bool", "kind": 4, "label": "true", "tags": [] }, + { "detail": "bool", "kind": 4, "label": "false", "tags": [] } +] Complete src/CompletionFunctionArguments.res 21:27 posCursor:[21:27] posNoWhite:[21:26] Found expr:[19:8->25:1] @@ -87,19 +69,10 @@ Resolved opens 1 Stdlib ContextPath CArgument Value[someFn](~isOn) ContextPath Value[someFn] Path someFn -[{ - "label": "true", - "kind": 4, - "tags": [], - "detail": "bool", - "documentation": null - }, { - "label": "false", - "kind": 4, - "tags": [], - "detail": "bool", - "documentation": null - }] +[ + { "detail": "bool", "kind": 4, "label": "true", "tags": [] }, + { "detail": "bool", "kind": 4, "label": "false", "tags": [] } +] Complete src/CompletionFunctionArguments.res 34:24 posCursor:[34:24] posNoWhite:[34:23] Found expr:[34:11->34:25] @@ -110,13 +83,7 @@ Resolved opens 1 Stdlib ContextPath CArgument Value[someOtherFn]($0) ContextPath Value[someOtherFn] Path someOtherFn -[{ - "label": "false", - "kind": 4, - "tags": [], - "detail": "bool", - "documentation": null - }] +[ { "detail": "bool", "kind": 4, "label": "false", "tags": [] } ] Complete src/CompletionFunctionArguments.res 51:39 posCursor:[51:39] posNoWhite:[51:38] Found expr:[51:11->51:40] @@ -127,31 +94,44 @@ Resolved opens 1 Stdlib ContextPath CArgument Value[someFnTakingVariant](~config) ContextPath Value[someFnTakingVariant] Path someFnTakingVariant -[{ - "label": "One", - "kind": 4, - "tags": [], +[ + { "detail": "One", - "documentation": {"kind": "markdown", "value": "```rescript\nOne\n```\n\n```rescript\ntype someVariant = One | Two | Three(int, string)\n```"}, + "documentation": { + "kind": "markdown", + "value": "```rescript\nOne\n```\n\n```rescript\ntype someVariant = One | Two | Three(int, string)\n```" + }, "insertText": "One", - "insertTextFormat": 2 - }, { - "label": "Two", + "insertTextFormat": 2, "kind": 4, - "tags": [], + "label": "One", + "tags": [] + }, + { "detail": "Two", - "documentation": {"kind": "markdown", "value": "```rescript\nTwo\n```\n\n```rescript\ntype someVariant = One | Two | Three(int, string)\n```"}, + "documentation": { + "kind": "markdown", + "value": "```rescript\nTwo\n```\n\n```rescript\ntype someVariant = One | Two | Three(int, string)\n```" + }, "insertText": "Two", - "insertTextFormat": 2 - }, { - "label": "Three(_, _)", + "insertTextFormat": 2, "kind": 4, - "tags": [], + "label": "Two", + "tags": [] + }, + { "detail": "Three(int, string)", - "documentation": {"kind": "markdown", "value": "```rescript\nThree(int, string)\n```\n\n```rescript\ntype someVariant = One | Two | Three(int, string)\n```"}, + "documentation": { + "kind": "markdown", + "value": "```rescript\nThree(int, string)\n```\n\n```rescript\ntype someVariant = One | Two | Three(int, string)\n```" + }, "insertText": "Three(${1:_}, ${2:_})", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 4, + "label": "Three(_, _)", + "tags": [] + } +] Complete src/CompletionFunctionArguments.res 54:40 posCursor:[54:40] posNoWhite:[54:39] Found expr:[54:11->54:41] @@ -162,60 +142,50 @@ Resolved opens 1 Stdlib ContextPath CArgument Value[someFnTakingVariant](~config) ContextPath Value[someFnTakingVariant] Path someFnTakingVariant -[{ - "label": "One", - "kind": 4, - "tags": [], +[ + { "detail": "One", - "documentation": {"kind": "markdown", "value": "```rescript\nOne\n```\n\n```rescript\ntype someVariant = One | Two | Three(int, string)\n```"}, - "sortText": "A One", + "documentation": { + "kind": "markdown", + "value": "```rescript\nOne\n```\n\n```rescript\ntype someVariant = One | Two | Three(int, string)\n```" + }, "insertText": "One", - "insertTextFormat": 2 - }, { - "label": "OIncludeMeInCompletions", - "kind": 9, - "tags": [], + "insertTextFormat": 2, + "kind": 4, + "label": "One", + "sortText": "A One", + "tags": [] + }, + { "detail": "module OIncludeMeInCompletions", - "documentation": null - }, { - "label": "Option", - "kind": 9, - "tags": [], - "detail": "module Option", - "documentation": null - }, { - "label": "Ordering", - "kind": 9, - "tags": [], - "detail": "module Ordering", - "documentation": null - }, { - "label": "Object", "kind": 9, - "tags": [], - "detail": "module Object", - "documentation": null - }, { - "label": "Obj", - "kind": 9, - "tags": [], - "detail": "module Obj", - "documentation": null, + "label": "OIncludeMeInCompletions", + "tags": [] + }, + { "detail": "module Option", "kind": 9, "label": "Option", "tags": [] }, + { "detail": "module Ordering", "kind": 9, "label": "Ordering", "tags": [] }, + { "detail": "module Object", "kind": 9, "label": "Object", "tags": [] }, + { "data": { "modulePath": "Obj", "filePath": "src/CompletionFunctionArguments.res" - } - }, { - "label": "Objects", + }, + "detail": "module Obj", "kind": 9, - "tags": [], - "detail": "module Objects", - "documentation": null, + "label": "Obj", + "tags": [] + }, + { "data": { "modulePath": "Objects", "filePath": "src/CompletionFunctionArguments.res" - } - }] + }, + "detail": "module Objects", + "kind": 9, + "label": "Objects", + "tags": [] + } +] Complete src/CompletionFunctionArguments.res 57:33 posCursor:[57:33] posNoWhite:[57:32] Found expr:[57:11->57:34] @@ -226,15 +196,20 @@ Resolved opens 1 Stdlib ContextPath CArgument Value[someFnTakingVariant]($0) ContextPath Value[someFnTakingVariant] Path someFnTakingVariant -[{ - "label": "Some(_)", - "kind": 12, - "tags": [], +[ + { "detail": "someVariant", - "documentation": {"kind": "markdown", "value": "```rescript\ntype someVariant = One | Two | Three(int, string)\n```"}, + "documentation": { + "kind": "markdown", + "value": "```rescript\ntype someVariant = One | Two | Three(int, string)\n```" + }, "insertText": "Some($0)", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 12, + "label": "Some(_)", + "tags": [] + } +] Complete src/CompletionFunctionArguments.res 60:44 posCursor:[60:44] posNoWhite:[60:43] Found expr:[60:11->60:45] @@ -245,60 +220,50 @@ Resolved opens 1 Stdlib ContextPath CArgument Value[someFnTakingVariant](~configOpt2) ContextPath Value[someFnTakingVariant] Path someFnTakingVariant -[{ - "label": "One", - "kind": 4, - "tags": [], +[ + { "detail": "One", - "documentation": {"kind": "markdown", "value": "```rescript\nOne\n```\n\n```rescript\ntype someVariant = One | Two | Three(int, string)\n```"}, - "sortText": "A One", + "documentation": { + "kind": "markdown", + "value": "```rescript\nOne\n```\n\n```rescript\ntype someVariant = One | Two | Three(int, string)\n```" + }, "insertText": "One", - "insertTextFormat": 2 - }, { - "label": "OIncludeMeInCompletions", - "kind": 9, - "tags": [], + "insertTextFormat": 2, + "kind": 4, + "label": "One", + "sortText": "A One", + "tags": [] + }, + { "detail": "module OIncludeMeInCompletions", - "documentation": null - }, { - "label": "Option", - "kind": 9, - "tags": [], - "detail": "module Option", - "documentation": null - }, { - "label": "Ordering", "kind": 9, - "tags": [], - "detail": "module Ordering", - "documentation": null - }, { - "label": "Object", - "kind": 9, - "tags": [], - "detail": "module Object", - "documentation": null - }, { - "label": "Obj", - "kind": 9, - "tags": [], - "detail": "module Obj", - "documentation": null, + "label": "OIncludeMeInCompletions", + "tags": [] + }, + { "detail": "module Option", "kind": 9, "label": "Option", "tags": [] }, + { "detail": "module Ordering", "kind": 9, "label": "Ordering", "tags": [] }, + { "detail": "module Object", "kind": 9, "label": "Object", "tags": [] }, + { "data": { "modulePath": "Obj", "filePath": "src/CompletionFunctionArguments.res" - } - }, { - "label": "Objects", + }, + "detail": "module Obj", "kind": 9, - "tags": [], - "detail": "module Objects", - "documentation": null, + "label": "Obj", + "tags": [] + }, + { "data": { "modulePath": "Objects", "filePath": "src/CompletionFunctionArguments.res" - } - }] + }, + "detail": "module Objects", + "kind": 9, + "label": "Objects", + "tags": [] + } +] Complete src/CompletionFunctionArguments.res 63:23 posCursor:[63:23] posNoWhite:[63:22] Found expr:[63:11->63:24] @@ -309,19 +274,10 @@ Resolved opens 1 Stdlib ContextPath CArgument Value[someOtherFn]($0) ContextPath Value[someOtherFn] Path someOtherFn -[{ - "label": "true", - "kind": 4, - "tags": [], - "detail": "bool", - "documentation": null - }, { - "label": "false", - "kind": 4, - "tags": [], - "detail": "bool", - "documentation": null - }] +[ + { "detail": "bool", "kind": 4, "label": "true", "tags": [] }, + { "detail": "bool", "kind": 4, "label": "false", "tags": [] } +] Complete src/CompletionFunctionArguments.res 66:28 posCursor:[66:28] posNoWhite:[66:27] Found expr:[66:11->66:30] @@ -332,19 +288,10 @@ Resolved opens 1 Stdlib ContextPath CArgument Value[someOtherFn]($2) ContextPath Value[someOtherFn] Path someOtherFn -[{ - "label": "true", - "kind": 4, - "tags": [], - "detail": "bool", - "documentation": null - }, { - "label": "false", - "kind": 4, - "tags": [], - "detail": "bool", - "documentation": null - }] +[ + { "detail": "bool", "kind": 4, "label": "true", "tags": [] }, + { "detail": "bool", "kind": 4, "label": "false", "tags": [] } +] Complete src/CompletionFunctionArguments.res 69:30 posCursor:[69:30] posNoWhite:[69:29] Found expr:[69:11->69:31] @@ -354,26 +301,26 @@ Resolved opens 1 Stdlib ContextPath CArgument Value[someOtherFn]($2) ContextPath Value[someOtherFn] Path someOtherFn -[{ - "label": "true", - "kind": 4, - "tags": [], +[ + { "detail": "bool", - "documentation": null, - "sortText": "A true" - }, { - "label": "tLocalVar", + "kind": 4, + "label": "true", + "sortText": "A true", + "tags": [] + }, + { "detail": "bool", "kind": 12, "label": "tLocalVar", "tags": [] }, + { + "detail": "'a => Type.t", + "documentation": { + "kind": "markdown", + "value": "\n`typeof(value)` exposes JavaScript's `typeof` operator and returns a `Type.t` enum.\nIt helps you inspect values that come from JavaScript APIs.\n\n## Examples\n\n```rescript\ntypeof(1) == #number\ntypeof(\"a\") == #string\n```\n" + }, "kind": 12, - "tags": [], - "detail": "bool", - "documentation": null - }, { "label": "typeof", - "kind": 12, - "tags": [], - "detail": "'a => Type.t", - "documentation": {"kind": "markdown", "value": "\n`typeof(value)` exposes JavaScript's `typeof` operator and returns a `Type.t` enum.\nIt helps you inspect values that come from JavaScript APIs.\n\n## Examples\n\n```rescript\ntypeof(1) == #number\ntypeof(\"a\") == #string\n```\n"} - }] + "tags": [] + } +] Complete src/CompletionFunctionArguments.res 76:25 posCursor:[76:25] posNoWhite:[76:24] Found expr:[76:11->76:26] @@ -384,15 +331,16 @@ Resolved opens 1 Stdlib ContextPath CArgument Value[fnTakingTuple]($0) ContextPath Value[fnTakingTuple] Path fnTakingTuple -[{ - "label": "(_, _, _)", - "kind": 12, - "tags": [], +[ + { "detail": "(int, int, float)", - "documentation": null, "insertText": "(${1:_}, ${2:_}, ${3:_})", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 12, + "label": "(_, _, _)", + "tags": [] + } +] Complete src/CompletionFunctionArguments.res 89:27 posCursor:[89:27] posNoWhite:[89:26] Found expr:[89:11->89:29] @@ -403,25 +351,38 @@ Resolved opens 1 Stdlib ContextPath CArgument Value[fnTakingRecord]($0) ContextPath Value[fnTakingRecord] Path fnTakingRecord -[{ - "label": "age", - "kind": 5, - "tags": [], +[ + { "detail": "int", - "documentation": {"kind": "markdown", "value": "```rescript\nage: int\n```\n\n```rescript\ntype someRecord = {age: int, offline: bool, online: option}\n```"} - }, { - "label": "offline", + "documentation": { + "kind": "markdown", + "value": "```rescript\nage: int\n```\n\n```rescript\ntype someRecord = {age: int, offline: bool, online: option}\n```" + }, "kind": 5, - "tags": [], + "label": "age", + "tags": [] + }, + { "detail": "bool", - "documentation": {"kind": "markdown", "value": "```rescript\noffline: bool\n```\n\n```rescript\ntype someRecord = {age: int, offline: bool, online: option}\n```"} - }, { - "label": "online", + "documentation": { + "kind": "markdown", + "value": "```rescript\noffline: bool\n```\n\n```rescript\ntype someRecord = {age: int, offline: bool, online: option}\n```" + }, "kind": 5, - "tags": [], + "label": "offline", + "tags": [] + }, + { "detail": "option", - "documentation": {"kind": "markdown", "value": "```rescript\nonline: option\n```\n\n```rescript\ntype someRecord = {age: int, offline: bool, online: option}\n```"} - }] + "documentation": { + "kind": "markdown", + "value": "```rescript\nonline: option\n```\n\n```rescript\ntype someRecord = {age: int, offline: bool, online: option}\n```" + }, + "kind": 5, + "label": "online", + "tags": [] + } +] Complete src/CompletionFunctionArguments.res 109:29 posCursor:[109:29] posNoWhite:[109:28] Found expr:[105:2->114:4] @@ -439,13 +400,14 @@ Path thisGetsBrokenLoc CPPipe pathFromEnv:JsxEvent.Mouse found:false Path JsxEvent.Mouse.a Path a -[{ - "label": "JsxEvent.Mouse.altKey", - "kind": 12, - "tags": [], +[ + { "detail": "t => bool", - "documentation": null - }] + "kind": 12, + "label": "JsxEvent.Mouse.altKey", + "tags": [] + } +] Complete src/CompletionFunctionArguments.res 111:27 posCursor:[111:27] posNoWhite:[111:26] Found expr:[105:2->114:4] @@ -463,13 +425,14 @@ Path reassignedWorks CPPipe pathFromEnv:JsxEvent.Mouse found:false Path JsxEvent.Mouse.a Path a -[{ - "label": "JsxEvent.Mouse.altKey", - "kind": 12, - "tags": [], +[ + { "detail": "t => bool", - "documentation": null - }] + "kind": 12, + "label": "JsxEvent.Mouse.altKey", + "tags": [] + } +] Complete src/CompletionFunctionArguments.res 121:57 posCursor:[121:57] posNoWhite:[121:56] Found expr:[121:3->121:73] @@ -485,11 +448,12 @@ Path fineModuleVal CPPipe pathFromEnv:FineModule found:true Path FineModule. Path -[{ - "label": "FineModule.setToFalse", - "kind": 12, - "tags": [], +[ + { "detail": "t => t", - "documentation": null - }] + "kind": 12, + "label": "FineModule.setToFalse", + "tags": [] + } +] diff --git a/tests/analysis_tests/tests/src/expected/CompletionInferValues.res.txt b/tests/analysis_tests/tests/src/expected/CompletionInferValues.res.txt index 5d72fc9174d..881ae2ea386 100644 --- a/tests/analysis_tests/tests/src/expected/CompletionInferValues.res.txt +++ b/tests/analysis_tests/tests/src/expected/CompletionInferValues.res.txt @@ -11,67 +11,112 @@ Path x ContextPath int Path Stdlib.Int.t Path t -[{ - "label": "Int.toStringWithRadix", - "kind": 12, - "tags": [1], +[ + { + "deprecated": true, "detail": "(int, ~radix: int) => string", - "documentation": {"kind": "markdown", "value": "Deprecated: Use `toString` instead\n\n\n`toStringWithRadix(n, ~radix)` return a `string` representing the given value.\n`~radix` specifies the radix base to use for the formatted number.\nSee [`Number.toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toString)\non MDN.\n\n## Examples\n\n```rescript\nInt.toStringWithRadix(6, ~radix=2) // \"110\"\nInt.toStringWithRadix(373592855, ~radix=16) // \"16449317\"\nInt.toStringWithRadix(123456, ~radix=36) // \"2n9c\"\n```\n\n## Exceptions\n\n`RangeError`: if `radix` is less than 2 or greater than 36.\n"} - }, { - "label": "Int.toExponentialWithPrecision", + "documentation": { + "kind": "markdown", + "value": "Deprecated: Use `toString` instead\n\n\n`toStringWithRadix(n, ~radix)` return a `string` representing the given value.\n`~radix` specifies the radix base to use for the formatted number.\nSee [`Number.toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toString)\non MDN.\n\n## Examples\n\n```rescript\nInt.toStringWithRadix(6, ~radix=2) // \"110\"\nInt.toStringWithRadix(373592855, ~radix=16) // \"16449317\"\nInt.toStringWithRadix(123456, ~radix=36) // \"2n9c\"\n```\n\n## Exceptions\n\n`RangeError`: if `radix` is less than 2 or greater than 36.\n" + }, "kind": 12, - "tags": [1], + "label": "Int.toStringWithRadix", + "tags": [ 1 ] + }, + { + "deprecated": true, "detail": "(int, ~digits: int) => string", - "documentation": {"kind": "markdown", "value": "Deprecated: Use `toExponential` instead\n\n\n`toExponential(n, ~digits)` return a `string` representing the given value in\nexponential notation. `digits` specifies how many digits should appear after\nthe decimal point. See [`Number.toExponential`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toExponential)\non MDN.\n\n## Examples\n\n```rescript\nInt.toExponentialWithPrecision(77, ~digits=2) // \"7.70e+1\"\nInt.toExponentialWithPrecision(5678, ~digits=2) // \"5.68e+3\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` less than 0 or greater than 10.\n"} - }, { - "label": "Int.toFixedWithPrecision", + "documentation": { + "kind": "markdown", + "value": "Deprecated: Use `toExponential` instead\n\n\n`toExponential(n, ~digits)` return a `string` representing the given value in\nexponential notation. `digits` specifies how many digits should appear after\nthe decimal point. See [`Number.toExponential`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toExponential)\non MDN.\n\n## Examples\n\n```rescript\nInt.toExponentialWithPrecision(77, ~digits=2) // \"7.70e+1\"\nInt.toExponentialWithPrecision(5678, ~digits=2) // \"5.68e+3\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` less than 0 or greater than 10.\n" + }, "kind": 12, - "tags": [1], + "label": "Int.toExponentialWithPrecision", + "tags": [ 1 ] + }, + { + "deprecated": true, "detail": "(int, ~digits: int) => string", - "documentation": {"kind": "markdown", "value": "Deprecated: Use `toFixed` instead\n\n\n`toFixedWithPrecision(n, ~digits)` return a `string` representing the given\nvalue using fixed-point notation. `digits` specifies how many digits should\nappear after the decimal point. See [`Number.toFixed`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toFixed)\non MDN.\n\n## Examples\n\n```rescript\nInt.toFixedWithPrecision(300, ~digits=4) // \"300.0000\"\nInt.toFixedWithPrecision(300, ~digits=1) // \"300.0\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` is less than 0 or larger than 100.\n"} - }, { - "label": "Int.toPrecisionWithPrecision", + "documentation": { + "kind": "markdown", + "value": "Deprecated: Use `toFixed` instead\n\n\n`toFixedWithPrecision(n, ~digits)` return a `string` representing the given\nvalue using fixed-point notation. `digits` specifies how many digits should\nappear after the decimal point. See [`Number.toFixed`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toFixed)\non MDN.\n\n## Examples\n\n```rescript\nInt.toFixedWithPrecision(300, ~digits=4) // \"300.0000\"\nInt.toFixedWithPrecision(300, ~digits=1) // \"300.0\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` is less than 0 or larger than 100.\n" + }, "kind": 12, - "tags": [1], + "label": "Int.toFixedWithPrecision", + "tags": [ 1 ] + }, + { + "deprecated": true, "detail": "(int, ~digits: int) => string", - "documentation": {"kind": "markdown", "value": "Deprecated: Use `toPrecision` instead\n\n\n`toPrecisionWithPrecision(n, ~digits)` return a `string` representing the giver value with\nprecision. `digits` specifies the number of significant digits. See [`Number.toPrecision`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toPrecision) on MDN.\n\n## Examples\n\n```rescript\nInt.toPrecisionWithPrecision(100, ~digits=2) // \"1.0e+2\"\nInt.toPrecisionWithPrecision(1, ~digits=2) // \"1.0\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` is not between 1 and 100 (inclusive).\n Implementations are allowed to support larger and smaller values as well.\n ECMA-262 only requires a precision of up to 21 significant digits.\n"} - }, { - "label": "Int.toPrecision", + "documentation": { + "kind": "markdown", + "value": "Deprecated: Use `toPrecision` instead\n\n\n`toPrecisionWithPrecision(n, ~digits)` return a `string` representing the giver value with\nprecision. `digits` specifies the number of significant digits. See [`Number.toPrecision`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toPrecision) on MDN.\n\n## Examples\n\n```rescript\nInt.toPrecisionWithPrecision(100, ~digits=2) // \"1.0e+2\"\nInt.toPrecisionWithPrecision(1, ~digits=2) // \"1.0\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` is not between 1 and 100 (inclusive).\n Implementations are allowed to support larger and smaller values as well.\n ECMA-262 only requires a precision of up to 21 significant digits.\n" + }, "kind": 12, - "tags": [], + "label": "Int.toPrecisionWithPrecision", + "tags": [ 1 ] + }, + { "detail": "(int, ~digits: int=?) => string", - "documentation": {"kind": "markdown", "value": "\n`toPrecision(n, ~digits=?)` return a `string` representing the giver value with\nprecision. `digits` specifies the number of significant digits. See [`Number.toPrecision`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toPrecision) on MDN.\n\n## Examples\n\n```rescript\nInt.toPrecision(100) // \"100\"\nInt.toPrecision(1) // \"1\"\nInt.toPrecision(100, ~digits=2) // \"1.0e+2\"\nInt.toPrecision(1, ~digits=2) // \"1.0\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` is not between 1 and 100 (inclusive).\n Implementations are allowed to support larger and smaller values as well.\n ECMA-262 only requires a precision of up to 21 significant digits.\n"} - }, { - "label": "Int.toString", + "documentation": { + "kind": "markdown", + "value": "\n`toPrecision(n, ~digits=?)` return a `string` representing the giver value with\nprecision. `digits` specifies the number of significant digits. See [`Number.toPrecision`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toPrecision) on MDN.\n\n## Examples\n\n```rescript\nInt.toPrecision(100) // \"100\"\nInt.toPrecision(1) // \"1\"\nInt.toPrecision(100, ~digits=2) // \"1.0e+2\"\nInt.toPrecision(1, ~digits=2) // \"1.0\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` is not between 1 and 100 (inclusive).\n Implementations are allowed to support larger and smaller values as well.\n ECMA-262 only requires a precision of up to 21 significant digits.\n" + }, "kind": 12, - "tags": [], + "label": "Int.toPrecision", + "tags": [] + }, + { "detail": "(int, ~radix: int=?) => string", - "documentation": {"kind": "markdown", "value": "\n`toString(n, ~radix=?)` return a `string` representing the given value.\n`~radix` specifies the radix base to use for the formatted number.\nSee [`Number.toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toString)\non MDN.\n\n## Examples\n\n```rescript\nInt.toString(1000) // \"1000\"\nInt.toString(-1000) // \"-1000\"\nInt.toString(6, ~radix=2) // \"110\"\nInt.toString(373592855, ~radix=16) // \"16449317\"\nInt.toString(123456, ~radix=36) // \"2n9c\"\n```\n\n## Exceptions\n\n`RangeError`: if `radix` is less than 2 or greater than 36.\n"} - }, { - "label": "Int.toFloat", + "documentation": { + "kind": "markdown", + "value": "\n`toString(n, ~radix=?)` return a `string` representing the given value.\n`~radix` specifies the radix base to use for the formatted number.\nSee [`Number.toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toString)\non MDN.\n\n## Examples\n\n```rescript\nInt.toString(1000) // \"1000\"\nInt.toString(-1000) // \"-1000\"\nInt.toString(6, ~radix=2) // \"110\"\nInt.toString(373592855, ~radix=16) // \"16449317\"\nInt.toString(123456, ~radix=36) // \"2n9c\"\n```\n\n## Exceptions\n\n`RangeError`: if `radix` is less than 2 or greater than 36.\n" + }, "kind": 12, - "tags": [], + "label": "Int.toString", + "tags": [] + }, + { "detail": "int => float", - "documentation": {"kind": "markdown", "value": "\n`toFloat(n)` return a `float` representing the given value.\n\n## Examples\n\n```rescript\nInt.toFloat(100) == 100.0\nInt.toFloat(2) == 2.0\n```\n"} - }, { - "label": "Int.toLocaleString", + "documentation": { + "kind": "markdown", + "value": "\n`toFloat(n)` return a `float` representing the given value.\n\n## Examples\n\n```rescript\nInt.toFloat(100) == 100.0\nInt.toFloat(2) == 2.0\n```\n" + }, "kind": 12, - "tags": [], + "label": "Int.toFloat", + "tags": [] + }, + { "detail": "int => string", - "documentation": {"kind": "markdown", "value": "\n`toLocaleString(n)` return a `string` with language-sensitive representing the\ngiven value. See [`Number.toLocaleString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toLocaleString) on MDN.\n\n## Examples\n\n```rescript\n// If the application uses English as the default language\nInt.toLocaleString(1000) // \"1,000\"\n\n// If the application uses Portuguese Brazil as the default language\nInt.toLocaleString(1000) // \"1.000\"\n```\n"} - }, { - "label": "Int.toExponential", + "documentation": { + "kind": "markdown", + "value": "\n`toLocaleString(n)` return a `string` with language-sensitive representing the\ngiven value. See [`Number.toLocaleString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toLocaleString) on MDN.\n\n## Examples\n\n```rescript\n// If the application uses English as the default language\nInt.toLocaleString(1000) // \"1,000\"\n\n// If the application uses Portuguese Brazil as the default language\nInt.toLocaleString(1000) // \"1.000\"\n```\n" + }, "kind": 12, - "tags": [], + "label": "Int.toLocaleString", + "tags": [] + }, + { "detail": "(int, ~digits: int=?) => string", - "documentation": {"kind": "markdown", "value": "\n`toExponential(n, ~digits=?)` return a `string` representing the given value in\nexponential notation. `digits` specifies how many digits should appear after\nthe decimal point. See [`Number.toExponential`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toExponential)\n\n## Examples\n\n```rescript\nInt.toExponential(1000) // \"1e+3\"\nInt.toExponential(-1000) // \"-1e+3\"\nInt.toExponential(77, ~digits=2) // \"7.70e+1\"\nInt.toExponential(5678, ~digits=2) // \"5.68e+3\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` less than 0 or greater than 10.\n"} - }, { - "label": "Int.toFixed", + "documentation": { + "kind": "markdown", + "value": "\n`toExponential(n, ~digits=?)` return a `string` representing the given value in\nexponential notation. `digits` specifies how many digits should appear after\nthe decimal point. See [`Number.toExponential`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toExponential)\n\n## Examples\n\n```rescript\nInt.toExponential(1000) // \"1e+3\"\nInt.toExponential(-1000) // \"-1e+3\"\nInt.toExponential(77, ~digits=2) // \"7.70e+1\"\nInt.toExponential(5678, ~digits=2) // \"5.68e+3\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` less than 0 or greater than 10.\n" + }, "kind": 12, - "tags": [], + "label": "Int.toExponential", + "tags": [] + }, + { "detail": "(int, ~digits: int=?) => string", - "documentation": {"kind": "markdown", "value": "\n`toFixed(n, ~digits=?)` return a `string` representing the given\nvalue using fixed-point notation. `digits` specifies how many digits should\nappear after the decimal point. See [`Number.toFixed`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toFixed)\non MDN.\n\n## Examples\n\n```rescript\nInt.toFixed(123456) // \"123456.00\"\nInt.toFixed(10) // \"10.00\"\nInt.toFixed(300, ~digits=4) // \"300.0000\"\nInt.toFixed(300, ~digits=1) // \"300.0\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` is less than 0 or larger than 100.\n"} - }] + "documentation": { + "kind": "markdown", + "value": "\n`toFixed(n, ~digits=?)` return a `string` representing the given\nvalue using fixed-point notation. `digits` specifies how many digits should\nappear after the decimal point. See [`Number.toFixed`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toFixed)\non MDN.\n\n## Examples\n\n```rescript\nInt.toFixed(123456) // \"123456.00\"\nInt.toFixed(10) // \"10.00\"\nInt.toFixed(300, ~digits=4) // \"300.0000\"\nInt.toFixed(300, ~digits=1) // \"300.0\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` is less than 0 or larger than 100.\n" + }, + "kind": 12, + "label": "Int.toFixed", + "tags": [] + } +] Complete src/CompletionInferValues.res 18:30 posCursor:[18:30] posNoWhite:[18:29] Found expr:[18:28->18:30] @@ -94,19 +139,28 @@ Path getSomeRecord CPPipe pathFromEnv: found:true Path CompletionInferValues. Path -[{ - "label": "name", - "kind": 5, - "tags": [], +[ + { "detail": "string", - "documentation": {"kind": "markdown", "value": "```rescript\nname: string\n```\n\n```rescript\ntype someRecord = {name: string, age: int}\n```"} - }, { - "label": "age", + "documentation": { + "kind": "markdown", + "value": "```rescript\nname: string\n```\n\n```rescript\ntype someRecord = {name: string, age: int}\n```" + }, "kind": 5, - "tags": [], + "label": "name", + "tags": [] + }, + { "detail": "int", - "documentation": {"kind": "markdown", "value": "```rescript\nage: int\n```\n\n```rescript\ntype someRecord = {name: string, age: int}\n```"} - }] + "documentation": { + "kind": "markdown", + "value": "```rescript\nage: int\n```\n\n```rescript\ntype someRecord = {name: string, age: int}\n```" + }, + "kind": 5, + "label": "age", + "tags": [] + } +] Complete src/CompletionInferValues.res 21:53 posCursor:[21:53] posNoWhite:[21:52] Found expr:[21:45->21:53] @@ -133,19 +187,28 @@ Path getSomeRecord CPPipe pathFromEnv: found:true Path CompletionInferValues. Path -[{ - "label": "name", - "kind": 5, - "tags": [], +[ + { "detail": "string", - "documentation": {"kind": "markdown", "value": "```rescript\nname: string\n```\n\n```rescript\ntype someRecord = {name: string, age: int}\n```"} - }, { - "label": "age", + "documentation": { + "kind": "markdown", + "value": "```rescript\nname: string\n```\n\n```rescript\ntype someRecord = {name: string, age: int}\n```" + }, "kind": 5, - "tags": [], + "label": "name", + "tags": [] + }, + { "detail": "int", - "documentation": {"kind": "markdown", "value": "```rescript\nage: int\n```\n\n```rescript\ntype someRecord = {name: string, age: int}\n```"} - }] + "documentation": { + "kind": "markdown", + "value": "```rescript\nage: int\n```\n\n```rescript\ntype someRecord = {name: string, age: int}\n```" + }, + "kind": 5, + "label": "age", + "tags": [] + } +] Complete src/CompletionInferValues.res 24:63 posCursor:[24:63] posNoWhite:[24:62] Found expr:[24:3->24:64] @@ -175,19 +238,28 @@ Path someFnWithCallback CPPipe pathFromEnv: found:true Path CompletionInferValues. Path -[{ - "label": "name", - "kind": 5, - "tags": [], +[ + { "detail": "string", - "documentation": {"kind": "markdown", "value": "```rescript\nname: string\n```\n\n```rescript\ntype someRecord = {name: string, age: int}\n```"} - }, { - "label": "age", + "documentation": { + "kind": "markdown", + "value": "```rescript\nname: string\n```\n\n```rescript\ntype someRecord = {name: string, age: int}\n```" + }, "kind": 5, - "tags": [], + "label": "name", + "tags": [] + }, + { "detail": "int", - "documentation": {"kind": "markdown", "value": "```rescript\nage: int\n```\n\n```rescript\ntype someRecord = {name: string, age: int}\n```"} - }] + "documentation": { + "kind": "markdown", + "value": "```rescript\nage: int\n```\n\n```rescript\ntype someRecord = {name: string, age: int}\n```" + }, + "kind": 5, + "label": "age", + "tags": [] + } +] Complete src/CompletionInferValues.res 27:90 posCursor:[27:90] posNoWhite:[27:89] Found expr:[27:39->27:91] @@ -221,19 +293,28 @@ Path someFnWithCallback CPPipe pathFromEnv: found:true Path CompletionInferValues. Path -[{ - "label": "name", - "kind": 5, - "tags": [], +[ + { "detail": "string", - "documentation": {"kind": "markdown", "value": "```rescript\nname: string\n```\n\n```rescript\ntype someRecord = {name: string, age: int}\n```"} - }, { - "label": "age", + "documentation": { + "kind": "markdown", + "value": "```rescript\nname: string\n```\n\n```rescript\ntype someRecord = {name: string, age: int}\n```" + }, "kind": 5, - "tags": [], + "label": "name", + "tags": [] + }, + { "detail": "int", - "documentation": {"kind": "markdown", "value": "```rescript\nage: int\n```\n\n```rescript\ntype someRecord = {name: string, age: int}\n```"} - }] + "documentation": { + "kind": "markdown", + "value": "```rescript\nage: int\n```\n\n```rescript\ntype someRecord = {name: string, age: int}\n```" + }, + "kind": 5, + "label": "age", + "tags": [] + } +] Complete src/CompletionInferValues.res 30:36 posCursor:[30:36] posNoWhite:[30:35] Found expr:[30:3->30:39] @@ -253,13 +334,14 @@ Path reactEventFn CPPipe pathFromEnv:ReactEvent.Mouse found:false Path ReactEvent.Mouse.pr Path pr -[{ - "label": "ReactEvent.Mouse.preventDefault", - "kind": 12, - "tags": [], +[ + { "detail": "t => unit", - "documentation": null - }] + "kind": 12, + "label": "ReactEvent.Mouse.preventDefault", + "tags": [] + } +] Complete src/CompletionInferValues.res 41:50 posCursor:[41:50] posNoWhite:[41:49] Found expr:[41:11->41:56] @@ -279,13 +361,14 @@ Path JsxDOM.domProps CPPipe pathFromEnv:JsxEvent.Mouse found:false Path JsxEvent.Mouse.pr Path pr -[{ - "label": "JsxEvent.Mouse.preventDefault", - "kind": 12, - "tags": [], +[ + { "detail": "t => unit", - "documentation": null - }] + "kind": 12, + "label": "JsxEvent.Mouse.preventDefault", + "tags": [] + } +] Complete src/CompletionInferValues.res 44:50 posCursor:[44:50] posNoWhite:[44:49] Found expr:[44:11->44:56] @@ -304,13 +387,14 @@ Path Div.make CPPipe pathFromEnv:JsxEvent.Mouse found:false Path JsxEvent.Mouse.pr Path pr -[{ - "label": "JsxEvent.Mouse.preventDefault", - "kind": 12, - "tags": [], +[ + { "detail": "t => unit", - "documentation": null - }] + "kind": 12, + "label": "JsxEvent.Mouse.preventDefault", + "tags": [] + } +] Complete src/CompletionInferValues.res 47:87 posCursor:[47:87] posNoWhite:[47:86] Found expr:[47:11->47:93] @@ -329,67 +413,112 @@ ContextPath Value[JsxEvent, Mouse, button] Path JsxEvent.Mouse.button Path Stdlib.Int.t Path t -[{ - "label": "Int.toStringWithRadix", - "kind": 12, - "tags": [1], +[ + { + "deprecated": true, "detail": "(int, ~radix: int) => string", - "documentation": {"kind": "markdown", "value": "Deprecated: Use `toString` instead\n\n\n`toStringWithRadix(n, ~radix)` return a `string` representing the given value.\n`~radix` specifies the radix base to use for the formatted number.\nSee [`Number.toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toString)\non MDN.\n\n## Examples\n\n```rescript\nInt.toStringWithRadix(6, ~radix=2) // \"110\"\nInt.toStringWithRadix(373592855, ~radix=16) // \"16449317\"\nInt.toStringWithRadix(123456, ~radix=36) // \"2n9c\"\n```\n\n## Exceptions\n\n`RangeError`: if `radix` is less than 2 or greater than 36.\n"} - }, { - "label": "Int.toExponentialWithPrecision", + "documentation": { + "kind": "markdown", + "value": "Deprecated: Use `toString` instead\n\n\n`toStringWithRadix(n, ~radix)` return a `string` representing the given value.\n`~radix` specifies the radix base to use for the formatted number.\nSee [`Number.toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toString)\non MDN.\n\n## Examples\n\n```rescript\nInt.toStringWithRadix(6, ~radix=2) // \"110\"\nInt.toStringWithRadix(373592855, ~radix=16) // \"16449317\"\nInt.toStringWithRadix(123456, ~radix=36) // \"2n9c\"\n```\n\n## Exceptions\n\n`RangeError`: if `radix` is less than 2 or greater than 36.\n" + }, "kind": 12, - "tags": [1], + "label": "Int.toStringWithRadix", + "tags": [ 1 ] + }, + { + "deprecated": true, "detail": "(int, ~digits: int) => string", - "documentation": {"kind": "markdown", "value": "Deprecated: Use `toExponential` instead\n\n\n`toExponential(n, ~digits)` return a `string` representing the given value in\nexponential notation. `digits` specifies how many digits should appear after\nthe decimal point. See [`Number.toExponential`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toExponential)\non MDN.\n\n## Examples\n\n```rescript\nInt.toExponentialWithPrecision(77, ~digits=2) // \"7.70e+1\"\nInt.toExponentialWithPrecision(5678, ~digits=2) // \"5.68e+3\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` less than 0 or greater than 10.\n"} - }, { - "label": "Int.toFixedWithPrecision", + "documentation": { + "kind": "markdown", + "value": "Deprecated: Use `toExponential` instead\n\n\n`toExponential(n, ~digits)` return a `string` representing the given value in\nexponential notation. `digits` specifies how many digits should appear after\nthe decimal point. See [`Number.toExponential`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toExponential)\non MDN.\n\n## Examples\n\n```rescript\nInt.toExponentialWithPrecision(77, ~digits=2) // \"7.70e+1\"\nInt.toExponentialWithPrecision(5678, ~digits=2) // \"5.68e+3\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` less than 0 or greater than 10.\n" + }, "kind": 12, - "tags": [1], + "label": "Int.toExponentialWithPrecision", + "tags": [ 1 ] + }, + { + "deprecated": true, "detail": "(int, ~digits: int) => string", - "documentation": {"kind": "markdown", "value": "Deprecated: Use `toFixed` instead\n\n\n`toFixedWithPrecision(n, ~digits)` return a `string` representing the given\nvalue using fixed-point notation. `digits` specifies how many digits should\nappear after the decimal point. See [`Number.toFixed`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toFixed)\non MDN.\n\n## Examples\n\n```rescript\nInt.toFixedWithPrecision(300, ~digits=4) // \"300.0000\"\nInt.toFixedWithPrecision(300, ~digits=1) // \"300.0\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` is less than 0 or larger than 100.\n"} - }, { - "label": "Int.toPrecisionWithPrecision", + "documentation": { + "kind": "markdown", + "value": "Deprecated: Use `toFixed` instead\n\n\n`toFixedWithPrecision(n, ~digits)` return a `string` representing the given\nvalue using fixed-point notation. `digits` specifies how many digits should\nappear after the decimal point. See [`Number.toFixed`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toFixed)\non MDN.\n\n## Examples\n\n```rescript\nInt.toFixedWithPrecision(300, ~digits=4) // \"300.0000\"\nInt.toFixedWithPrecision(300, ~digits=1) // \"300.0\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` is less than 0 or larger than 100.\n" + }, "kind": 12, - "tags": [1], + "label": "Int.toFixedWithPrecision", + "tags": [ 1 ] + }, + { + "deprecated": true, "detail": "(int, ~digits: int) => string", - "documentation": {"kind": "markdown", "value": "Deprecated: Use `toPrecision` instead\n\n\n`toPrecisionWithPrecision(n, ~digits)` return a `string` representing the giver value with\nprecision. `digits` specifies the number of significant digits. See [`Number.toPrecision`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toPrecision) on MDN.\n\n## Examples\n\n```rescript\nInt.toPrecisionWithPrecision(100, ~digits=2) // \"1.0e+2\"\nInt.toPrecisionWithPrecision(1, ~digits=2) // \"1.0\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` is not between 1 and 100 (inclusive).\n Implementations are allowed to support larger and smaller values as well.\n ECMA-262 only requires a precision of up to 21 significant digits.\n"} - }, { - "label": "Int.toPrecision", + "documentation": { + "kind": "markdown", + "value": "Deprecated: Use `toPrecision` instead\n\n\n`toPrecisionWithPrecision(n, ~digits)` return a `string` representing the giver value with\nprecision. `digits` specifies the number of significant digits. See [`Number.toPrecision`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toPrecision) on MDN.\n\n## Examples\n\n```rescript\nInt.toPrecisionWithPrecision(100, ~digits=2) // \"1.0e+2\"\nInt.toPrecisionWithPrecision(1, ~digits=2) // \"1.0\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` is not between 1 and 100 (inclusive).\n Implementations are allowed to support larger and smaller values as well.\n ECMA-262 only requires a precision of up to 21 significant digits.\n" + }, "kind": 12, - "tags": [], + "label": "Int.toPrecisionWithPrecision", + "tags": [ 1 ] + }, + { "detail": "(int, ~digits: int=?) => string", - "documentation": {"kind": "markdown", "value": "\n`toPrecision(n, ~digits=?)` return a `string` representing the giver value with\nprecision. `digits` specifies the number of significant digits. See [`Number.toPrecision`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toPrecision) on MDN.\n\n## Examples\n\n```rescript\nInt.toPrecision(100) // \"100\"\nInt.toPrecision(1) // \"1\"\nInt.toPrecision(100, ~digits=2) // \"1.0e+2\"\nInt.toPrecision(1, ~digits=2) // \"1.0\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` is not between 1 and 100 (inclusive).\n Implementations are allowed to support larger and smaller values as well.\n ECMA-262 only requires a precision of up to 21 significant digits.\n"} - }, { - "label": "Int.toString", + "documentation": { + "kind": "markdown", + "value": "\n`toPrecision(n, ~digits=?)` return a `string` representing the giver value with\nprecision. `digits` specifies the number of significant digits. See [`Number.toPrecision`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toPrecision) on MDN.\n\n## Examples\n\n```rescript\nInt.toPrecision(100) // \"100\"\nInt.toPrecision(1) // \"1\"\nInt.toPrecision(100, ~digits=2) // \"1.0e+2\"\nInt.toPrecision(1, ~digits=2) // \"1.0\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` is not between 1 and 100 (inclusive).\n Implementations are allowed to support larger and smaller values as well.\n ECMA-262 only requires a precision of up to 21 significant digits.\n" + }, "kind": 12, - "tags": [], + "label": "Int.toPrecision", + "tags": [] + }, + { "detail": "(int, ~radix: int=?) => string", - "documentation": {"kind": "markdown", "value": "\n`toString(n, ~radix=?)` return a `string` representing the given value.\n`~radix` specifies the radix base to use for the formatted number.\nSee [`Number.toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toString)\non MDN.\n\n## Examples\n\n```rescript\nInt.toString(1000) // \"1000\"\nInt.toString(-1000) // \"-1000\"\nInt.toString(6, ~radix=2) // \"110\"\nInt.toString(373592855, ~radix=16) // \"16449317\"\nInt.toString(123456, ~radix=36) // \"2n9c\"\n```\n\n## Exceptions\n\n`RangeError`: if `radix` is less than 2 or greater than 36.\n"} - }, { - "label": "Int.toFloat", + "documentation": { + "kind": "markdown", + "value": "\n`toString(n, ~radix=?)` return a `string` representing the given value.\n`~radix` specifies the radix base to use for the formatted number.\nSee [`Number.toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toString)\non MDN.\n\n## Examples\n\n```rescript\nInt.toString(1000) // \"1000\"\nInt.toString(-1000) // \"-1000\"\nInt.toString(6, ~radix=2) // \"110\"\nInt.toString(373592855, ~radix=16) // \"16449317\"\nInt.toString(123456, ~radix=36) // \"2n9c\"\n```\n\n## Exceptions\n\n`RangeError`: if `radix` is less than 2 or greater than 36.\n" + }, "kind": 12, - "tags": [], + "label": "Int.toString", + "tags": [] + }, + { "detail": "int => float", - "documentation": {"kind": "markdown", "value": "\n`toFloat(n)` return a `float` representing the given value.\n\n## Examples\n\n```rescript\nInt.toFloat(100) == 100.0\nInt.toFloat(2) == 2.0\n```\n"} - }, { - "label": "Int.toLocaleString", + "documentation": { + "kind": "markdown", + "value": "\n`toFloat(n)` return a `float` representing the given value.\n\n## Examples\n\n```rescript\nInt.toFloat(100) == 100.0\nInt.toFloat(2) == 2.0\n```\n" + }, "kind": 12, - "tags": [], + "label": "Int.toFloat", + "tags": [] + }, + { "detail": "int => string", - "documentation": {"kind": "markdown", "value": "\n`toLocaleString(n)` return a `string` with language-sensitive representing the\ngiven value. See [`Number.toLocaleString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toLocaleString) on MDN.\n\n## Examples\n\n```rescript\n// If the application uses English as the default language\nInt.toLocaleString(1000) // \"1,000\"\n\n// If the application uses Portuguese Brazil as the default language\nInt.toLocaleString(1000) // \"1.000\"\n```\n"} - }, { - "label": "Int.toExponential", + "documentation": { + "kind": "markdown", + "value": "\n`toLocaleString(n)` return a `string` with language-sensitive representing the\ngiven value. See [`Number.toLocaleString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toLocaleString) on MDN.\n\n## Examples\n\n```rescript\n// If the application uses English as the default language\nInt.toLocaleString(1000) // \"1,000\"\n\n// If the application uses Portuguese Brazil as the default language\nInt.toLocaleString(1000) // \"1.000\"\n```\n" + }, "kind": 12, - "tags": [], + "label": "Int.toLocaleString", + "tags": [] + }, + { "detail": "(int, ~digits: int=?) => string", - "documentation": {"kind": "markdown", "value": "\n`toExponential(n, ~digits=?)` return a `string` representing the given value in\nexponential notation. `digits` specifies how many digits should appear after\nthe decimal point. See [`Number.toExponential`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toExponential)\n\n## Examples\n\n```rescript\nInt.toExponential(1000) // \"1e+3\"\nInt.toExponential(-1000) // \"-1e+3\"\nInt.toExponential(77, ~digits=2) // \"7.70e+1\"\nInt.toExponential(5678, ~digits=2) // \"5.68e+3\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` less than 0 or greater than 10.\n"} - }, { - "label": "Int.toFixed", + "documentation": { + "kind": "markdown", + "value": "\n`toExponential(n, ~digits=?)` return a `string` representing the given value in\nexponential notation. `digits` specifies how many digits should appear after\nthe decimal point. See [`Number.toExponential`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toExponential)\n\n## Examples\n\n```rescript\nInt.toExponential(1000) // \"1e+3\"\nInt.toExponential(-1000) // \"-1e+3\"\nInt.toExponential(77, ~digits=2) // \"7.70e+1\"\nInt.toExponential(5678, ~digits=2) // \"5.68e+3\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` less than 0 or greater than 10.\n" + }, "kind": 12, - "tags": [], + "label": "Int.toExponential", + "tags": [] + }, + { "detail": "(int, ~digits: int=?) => string", - "documentation": {"kind": "markdown", "value": "\n`toFixed(n, ~digits=?)` return a `string` representing the given\nvalue using fixed-point notation. `digits` specifies how many digits should\nappear after the decimal point. See [`Number.toFixed`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toFixed)\non MDN.\n\n## Examples\n\n```rescript\nInt.toFixed(123456) // \"123456.00\"\nInt.toFixed(10) // \"10.00\"\nInt.toFixed(300, ~digits=4) // \"300.0000\"\nInt.toFixed(300, ~digits=1) // \"300.0\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` is less than 0 or larger than 100.\n"} - }] + "documentation": { + "kind": "markdown", + "value": "\n`toFixed(n, ~digits=?)` return a `string` representing the given\nvalue using fixed-point notation. `digits` specifies how many digits should\nappear after the decimal point. See [`Number.toFixed`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toFixed)\non MDN.\n\n## Examples\n\n```rescript\nInt.toFixed(123456) // \"123456.00\"\nInt.toFixed(10) // \"10.00\"\nInt.toFixed(300, ~digits=4) // \"300.0000\"\nInt.toFixed(300, ~digits=1) // \"300.0\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` is less than 0 or larger than 100.\n" + }, + "kind": 12, + "label": "Int.toFixed", + "tags": [] + } +] Complete src/CompletionInferValues.res 50:103 posCursor:[50:103] posNoWhite:[50:102] Found expr:[50:11->50:109] @@ -426,19 +555,28 @@ Path String.split Path Stdlib.Array.ma Path ArrayUtils.ma Path ma -[{ - "label": "Array.map", - "kind": 12, - "tags": [], +[ + { "detail": "(array<'a>, 'a => 'b) => array<'b>", - "documentation": {"kind": "markdown", "value": "\n`map(array, fn)` returns a new array with all elements from `array`, each element transformed using the provided `fn`.\n\nSee [`Array.map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map) on MDN.\n\n## Examples\n\n```rescript\nlet array = [\"Hello\", \"Hi\", \"Good bye\"]\nlet mappedArray = array->Array.map(greeting => greeting ++ \" to you\")\n\nmappedArray == [\"Hello to you\", \"Hi to you\", \"Good bye to you\"]\n```\n"} - }, { - "label": "Array.mapWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`map(array, fn)` returns a new array with all elements from `array`, each element transformed using the provided `fn`.\n\nSee [`Array.map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map) on MDN.\n\n## Examples\n\n```rescript\nlet array = [\"Hello\", \"Hi\", \"Good bye\"]\nlet mappedArray = array->Array.map(greeting => greeting ++ \" to you\")\n\nmappedArray == [\"Hello to you\", \"Hi to you\", \"Good bye to you\"]\n```\n" + }, "kind": 12, - "tags": [], + "label": "Array.map", + "tags": [] + }, + { "detail": "(array<'a>, ('a, int) => 'b) => array<'b>", - "documentation": {"kind": "markdown", "value": "\n`mapWithIndex(array, fn)` returns a new array with all elements from `array`, each element transformed using the provided `fn`.\n\nSee [`Array.map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map) on MDN.\n\n## Examples\n\n```rescript\nlet array = [\"Hello\", \"Hi\", \"Good bye\"]\nlet mappedArray =\n array->Array.mapWithIndex((greeting, index) => greeting ++ \" at position \" ++ Int.toString(index))\n\nmappedArray == [\"Hello at position 0\", \"Hi at position 1\", \"Good bye at position 2\"]\n```\n"} - }] + "documentation": { + "kind": "markdown", + "value": "\n`mapWithIndex(array, fn)` returns a new array with all elements from `array`, each element transformed using the provided `fn`.\n\nSee [`Array.map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map) on MDN.\n\n## Examples\n\n```rescript\nlet array = [\"Hello\", \"Hi\", \"Good bye\"]\nlet mappedArray =\n array->Array.mapWithIndex((greeting, index) => greeting ++ \" at position \" ++ Int.toString(index))\n\nmappedArray == [\"Hello at position 0\", \"Hi at position 1\", \"Good bye at position 2\"]\n```\n" + }, + "kind": 12, + "label": "Array.mapWithIndex", + "tags": [] + } +] Complete src/CompletionInferValues.res 75:78 posCursor:[75:78] posNoWhite:[75:77] Found expr:[75:70->75:78] @@ -465,19 +603,28 @@ Path someRecordWithNestedStuff CPPipe pathFromEnv: found:true Path CompletionInferValues. Path -[{ - "label": "name", - "kind": 5, - "tags": [], +[ + { "detail": "string", - "documentation": {"kind": "markdown", "value": "```rescript\nname: string\n```\n\n```rescript\ntype someRecord = {name: string, age: int}\n```"} - }, { - "label": "age", + "documentation": { + "kind": "markdown", + "value": "```rescript\nname: string\n```\n\n```rescript\ntype someRecord = {name: string, age: int}\n```" + }, "kind": 5, - "tags": [], + "label": "name", + "tags": [] + }, + { "detail": "int", - "documentation": {"kind": "markdown", "value": "```rescript\nage: int\n```\n\n```rescript\ntype someRecord = {name: string, age: int}\n```"} - }] + "documentation": { + "kind": "markdown", + "value": "```rescript\nage: int\n```\n\n```rescript\ntype someRecord = {name: string, age: int}\n```" + }, + "kind": 5, + "label": "age", + "tags": [] + } +] Complete src/CompletionInferValues.res 79:86 posCursor:[79:86] posNoWhite:[79:85] Found expr:[79:78->79:86] @@ -504,13 +651,18 @@ Path someRecordWithNestedStuff CPPipe pathFromEnv: found:true Path CompletionInferValues. Path -[{ - "label": "someRecord", - "kind": 5, - "tags": [], +[ + { "detail": "someRecord", - "documentation": {"kind": "markdown", "value": "```rescript\nsomeRecord: someRecord\n```\n\n```rescript\ntype someNestedRecord = {someRecord: someRecord}\n```"} - }] + "documentation": { + "kind": "markdown", + "value": "```rescript\nsomeRecord: someRecord\n```\n\n```rescript\ntype someNestedRecord = {someRecord: someRecord}\n```" + }, + "kind": 5, + "label": "someRecord", + "tags": [] + } +] Complete src/CompletionInferValues.res 83:103 posCursor:[83:103] posNoWhite:[83:102] Found expr:[83:92->83:103] @@ -537,19 +689,28 @@ Path someRecordWithNestedStuff CPPipe pathFromEnv: found:true Path CompletionInferValues. Path -[{ - "label": "name", - "kind": 5, - "tags": [], +[ + { "detail": "string", - "documentation": {"kind": "markdown", "value": "```rescript\nname: string\n```\n\n```rescript\ntype someRecord = {name: string, age: int}\n```"} - }, { - "label": "age", + "documentation": { + "kind": "markdown", + "value": "```rescript\nname: string\n```\n\n```rescript\ntype someRecord = {name: string, age: int}\n```" + }, "kind": 5, - "tags": [], + "label": "name", + "tags": [] + }, + { "detail": "int", - "documentation": {"kind": "markdown", "value": "```rescript\nage: int\n```\n\n```rescript\ntype someRecord = {name: string, age: int}\n```"} - }] + "documentation": { + "kind": "markdown", + "value": "```rescript\nage: int\n```\n\n```rescript\ntype someRecord = {name: string, age: int}\n```" + }, + "kind": 5, + "label": "age", + "tags": [] + } +] Complete src/CompletionInferValues.res 87:81 posCursor:[87:81] posNoWhite:[87:80] Found expr:[87:69->87:81] @@ -566,19 +727,29 @@ ContextPath Type[someRecordWithNestedStuff] Path someRecordWithNestedStuff Path Stdlib.String.slic Path slic -[{ - "label": "String.slice", - "kind": 12, - "tags": [], +[ + { "detail": "(string, ~start: int, ~end: int=?) => string", - "documentation": {"kind": "markdown", "value": "\n`slice(str, ~start, ~end)` returns the substring of `str` starting at\ncharacter `start` up to but not including `end`.\n- If either `start` or `end` is negative, then it is evaluated as\n `length(str - start)` or `length(str - end)`.\n- If `end` is greater than the length of `str`, then it is treated as\n `length(str)`.\n- If `start` is greater than `end`, slice returns the empty string.\n See [`String.slice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/slice) on MDN.\n\n## Examples\n\n```rescript\nString.slice(\"abcdefg\", ~start=2, ~end=5) == \"cde\"\nString.slice(\"abcdefg\", ~start=2, ~end=9) == \"cdefg\"\nString.slice(\"abcdefg\", ~start=-4, ~end=-2) == \"de\"\nString.slice(\"abcdefg\", ~start=5, ~end=1) == \"\"\nString.slice(\"abcdefg\", ~start=2) == \"cdefg\"\nString.slice(\"Hello World\", ~start=6) == \"World\"\n```\n"} - }, { - "label": "String.sliceToEnd", + "documentation": { + "kind": "markdown", + "value": "\n`slice(str, ~start, ~end)` returns the substring of `str` starting at\ncharacter `start` up to but not including `end`.\n- If either `start` or `end` is negative, then it is evaluated as\n `length(str - start)` or `length(str - end)`.\n- If `end` is greater than the length of `str`, then it is treated as\n `length(str)`.\n- If `start` is greater than `end`, slice returns the empty string.\n See [`String.slice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/slice) on MDN.\n\n## Examples\n\n```rescript\nString.slice(\"abcdefg\", ~start=2, ~end=5) == \"cde\"\nString.slice(\"abcdefg\", ~start=2, ~end=9) == \"cdefg\"\nString.slice(\"abcdefg\", ~start=-4, ~end=-2) == \"de\"\nString.slice(\"abcdefg\", ~start=5, ~end=1) == \"\"\nString.slice(\"abcdefg\", ~start=2) == \"cdefg\"\nString.slice(\"Hello World\", ~start=6) == \"World\"\n```\n" + }, "kind": 12, - "tags": [1], + "label": "String.slice", + "tags": [] + }, + { + "deprecated": true, "detail": "(string, ~start: int) => string", - "documentation": {"kind": "markdown", "value": "Deprecated: Use `slice` instead\n\n\n`sliceToEnd(str, ~start)` returns the substring of `str` starting at character\n`start` to the end of the string.\n- If `start` is negative, then it is evaluated as `length(str - start)`.\n- If `start` is greater than the length of `str`, then sliceToEnd returns the empty string.\n See [`String.slice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/slice) on MDN.\n\n## Examples\n\n```rescript\nString.sliceToEnd(\"abcdefg\", ~start=4) == \"efg\"\nString.sliceToEnd(\"abcdefg\", ~start=-2) == \"fg\"\nString.sliceToEnd(\"abcdefg\", ~start=7) == \"\"\n```\n"} - }] + "documentation": { + "kind": "markdown", + "value": "Deprecated: Use `slice` instead\n\n\n`sliceToEnd(str, ~start)` returns the substring of `str` starting at character\n`start` to the end of the string.\n- If `start` is negative, then it is evaluated as `length(str - start)`.\n- If `start` is greater than the length of `str`, then sliceToEnd returns the empty string.\n See [`String.slice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/slice) on MDN.\n\n## Examples\n\n```rescript\nString.sliceToEnd(\"abcdefg\", ~start=4) == \"efg\"\nString.sliceToEnd(\"abcdefg\", ~start=-2) == \"fg\"\nString.sliceToEnd(\"abcdefg\", ~start=7) == \"\"\n```\n" + }, + "kind": 12, + "label": "String.sliceToEnd", + "tags": [ 1 ] + } +] Complete src/CompletionInferValues.res 91:82 posCursor:[91:82] posNoWhite:[91:81] Found expr:[91:70->91:82] @@ -595,19 +766,29 @@ ContextPath Type[someRecordWithNestedStuff] Path someRecordWithNestedStuff Path Stdlib.Int.toS Path toS -[{ - "label": "Int.toStringWithRadix", - "kind": 12, - "tags": [1], +[ + { + "deprecated": true, "detail": "(int, ~radix: int) => string", - "documentation": {"kind": "markdown", "value": "Deprecated: Use `toString` instead\n\n\n`toStringWithRadix(n, ~radix)` return a `string` representing the given value.\n`~radix` specifies the radix base to use for the formatted number.\nSee [`Number.toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toString)\non MDN.\n\n## Examples\n\n```rescript\nInt.toStringWithRadix(6, ~radix=2) // \"110\"\nInt.toStringWithRadix(373592855, ~radix=16) // \"16449317\"\nInt.toStringWithRadix(123456, ~radix=36) // \"2n9c\"\n```\n\n## Exceptions\n\n`RangeError`: if `radix` is less than 2 or greater than 36.\n"} - }, { - "label": "Int.toString", + "documentation": { + "kind": "markdown", + "value": "Deprecated: Use `toString` instead\n\n\n`toStringWithRadix(n, ~radix)` return a `string` representing the given value.\n`~radix` specifies the radix base to use for the formatted number.\nSee [`Number.toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toString)\non MDN.\n\n## Examples\n\n```rescript\nInt.toStringWithRadix(6, ~radix=2) // \"110\"\nInt.toStringWithRadix(373592855, ~radix=16) // \"16449317\"\nInt.toStringWithRadix(123456, ~radix=36) // \"2n9c\"\n```\n\n## Exceptions\n\n`RangeError`: if `radix` is less than 2 or greater than 36.\n" + }, "kind": 12, - "tags": [], + "label": "Int.toStringWithRadix", + "tags": [ 1 ] + }, + { "detail": "(int, ~radix: int=?) => string", - "documentation": {"kind": "markdown", "value": "\n`toString(n, ~radix=?)` return a `string` representing the given value.\n`~radix` specifies the radix base to use for the formatted number.\nSee [`Number.toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toString)\non MDN.\n\n## Examples\n\n```rescript\nInt.toString(1000) // \"1000\"\nInt.toString(-1000) // \"-1000\"\nInt.toString(6, ~radix=2) // \"110\"\nInt.toString(373592855, ~radix=16) // \"16449317\"\nInt.toString(123456, ~radix=36) // \"2n9c\"\n```\n\n## Exceptions\n\n`RangeError`: if `radix` is less than 2 or greater than 36.\n"} - }] + "documentation": { + "kind": "markdown", + "value": "\n`toString(n, ~radix=?)` return a `string` representing the given value.\n`~radix` specifies the radix base to use for the formatted number.\nSee [`Number.toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toString)\non MDN.\n\n## Examples\n\n```rescript\nInt.toString(1000) // \"1000\"\nInt.toString(-1000) // \"-1000\"\nInt.toString(6, ~radix=2) // \"110\"\nInt.toString(373592855, ~radix=16) // \"16449317\"\nInt.toString(123456, ~radix=36) // \"2n9c\"\n```\n\n## Exceptions\n\n`RangeError`: if `radix` is less than 2 or greater than 36.\n" + }, + "kind": 12, + "label": "Int.toString", + "tags": [] + } +] Complete src/CompletionInferValues.res 95:109 posCursor:[95:109] posNoWhite:[95:108] Found expr:[95:97->95:109] @@ -627,19 +808,29 @@ ContextPath Type[otherNestedRecord] Path otherNestedRecord Path Stdlib.Int.toS Path toS -[{ - "label": "Int.toStringWithRadix", - "kind": 12, - "tags": [1], +[ + { + "deprecated": true, "detail": "(int, ~radix: int) => string", - "documentation": {"kind": "markdown", "value": "Deprecated: Use `toString` instead\n\n\n`toStringWithRadix(n, ~radix)` return a `string` representing the given value.\n`~radix` specifies the radix base to use for the formatted number.\nSee [`Number.toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toString)\non MDN.\n\n## Examples\n\n```rescript\nInt.toStringWithRadix(6, ~radix=2) // \"110\"\nInt.toStringWithRadix(373592855, ~radix=16) // \"16449317\"\nInt.toStringWithRadix(123456, ~radix=36) // \"2n9c\"\n```\n\n## Exceptions\n\n`RangeError`: if `radix` is less than 2 or greater than 36.\n"} - }, { - "label": "Int.toString", + "documentation": { + "kind": "markdown", + "value": "Deprecated: Use `toString` instead\n\n\n`toStringWithRadix(n, ~radix)` return a `string` representing the given value.\n`~radix` specifies the radix base to use for the formatted number.\nSee [`Number.toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toString)\non MDN.\n\n## Examples\n\n```rescript\nInt.toStringWithRadix(6, ~radix=2) // \"110\"\nInt.toStringWithRadix(373592855, ~radix=16) // \"16449317\"\nInt.toStringWithRadix(123456, ~radix=36) // \"2n9c\"\n```\n\n## Exceptions\n\n`RangeError`: if `radix` is less than 2 or greater than 36.\n" + }, "kind": 12, - "tags": [], + "label": "Int.toStringWithRadix", + "tags": [ 1 ] + }, + { "detail": "(int, ~radix: int=?) => string", - "documentation": {"kind": "markdown", "value": "\n`toString(n, ~radix=?)` return a `string` representing the given value.\n`~radix` specifies the radix base to use for the formatted number.\nSee [`Number.toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toString)\non MDN.\n\n## Examples\n\n```rescript\nInt.toString(1000) // \"1000\"\nInt.toString(-1000) // \"-1000\"\nInt.toString(6, ~radix=2) // \"110\"\nInt.toString(373592855, ~radix=16) // \"16449317\"\nInt.toString(123456, ~radix=36) // \"2n9c\"\n```\n\n## Exceptions\n\n`RangeError`: if `radix` is less than 2 or greater than 36.\n"} - }] + "documentation": { + "kind": "markdown", + "value": "\n`toString(n, ~radix=?)` return a `string` representing the given value.\n`~radix` specifies the radix base to use for the formatted number.\nSee [`Number.toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toString)\non MDN.\n\n## Examples\n\n```rescript\nInt.toString(1000) // \"1000\"\nInt.toString(-1000) // \"-1000\"\nInt.toString(6, ~radix=2) // \"110\"\nInt.toString(373592855, ~radix=16) // \"16449317\"\nInt.toString(123456, ~radix=36) // \"2n9c\"\n```\n\n## Exceptions\n\n`RangeError`: if `radix` is less than 2 or greater than 36.\n" + }, + "kind": 12, + "label": "Int.toString", + "tags": [] + } +] Complete src/CompletionInferValues.res 99:102 posCursor:[99:102] posNoWhite:[99:101] Found expr:[99:57->99:102] @@ -660,19 +851,29 @@ ContextPath Type[otherNestedRecord] Path otherNestedRecord Path Stdlib.Int.toS Path toS -[{ - "label": "Int.toStringWithRadix", - "kind": 12, - "tags": [1], +[ + { + "deprecated": true, "detail": "(int, ~radix: int) => string", - "documentation": {"kind": "markdown", "value": "Deprecated: Use `toString` instead\n\n\n`toStringWithRadix(n, ~radix)` return a `string` representing the given value.\n`~radix` specifies the radix base to use for the formatted number.\nSee [`Number.toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toString)\non MDN.\n\n## Examples\n\n```rescript\nInt.toStringWithRadix(6, ~radix=2) // \"110\"\nInt.toStringWithRadix(373592855, ~radix=16) // \"16449317\"\nInt.toStringWithRadix(123456, ~radix=36) // \"2n9c\"\n```\n\n## Exceptions\n\n`RangeError`: if `radix` is less than 2 or greater than 36.\n"} - }, { - "label": "Int.toString", + "documentation": { + "kind": "markdown", + "value": "Deprecated: Use `toString` instead\n\n\n`toStringWithRadix(n, ~radix)` return a `string` representing the given value.\n`~radix` specifies the radix base to use for the formatted number.\nSee [`Number.toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toString)\non MDN.\n\n## Examples\n\n```rescript\nInt.toStringWithRadix(6, ~radix=2) // \"110\"\nInt.toStringWithRadix(373592855, ~radix=16) // \"16449317\"\nInt.toStringWithRadix(123456, ~radix=36) // \"2n9c\"\n```\n\n## Exceptions\n\n`RangeError`: if `radix` is less than 2 or greater than 36.\n" + }, "kind": 12, - "tags": [], + "label": "Int.toStringWithRadix", + "tags": [ 1 ] + }, + { "detail": "(int, ~radix: int=?) => string", - "documentation": {"kind": "markdown", "value": "\n`toString(n, ~radix=?)` return a `string` representing the given value.\n`~radix` specifies the radix base to use for the formatted number.\nSee [`Number.toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toString)\non MDN.\n\n## Examples\n\n```rescript\nInt.toString(1000) // \"1000\"\nInt.toString(-1000) // \"-1000\"\nInt.toString(6, ~radix=2) // \"110\"\nInt.toString(373592855, ~radix=16) // \"16449317\"\nInt.toString(123456, ~radix=36) // \"2n9c\"\n```\n\n## Exceptions\n\n`RangeError`: if `radix` is less than 2 or greater than 36.\n"} - }] + "documentation": { + "kind": "markdown", + "value": "\n`toString(n, ~radix=?)` return a `string` representing the given value.\n`~radix` specifies the radix base to use for the formatted number.\nSee [`Number.toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toString)\non MDN.\n\n## Examples\n\n```rescript\nInt.toString(1000) // \"1000\"\nInt.toString(-1000) // \"-1000\"\nInt.toString(6, ~radix=2) // \"110\"\nInt.toString(373592855, ~radix=16) // \"16449317\"\nInt.toString(123456, ~radix=36) // \"2n9c\"\n```\n\n## Exceptions\n\n`RangeError`: if `radix` is less than 2 or greater than 36.\n" + }, + "kind": 12, + "label": "Int.toString", + "tags": [] + } +] Complete src/CompletionInferValues.res 103:88 posCursor:[103:88] posNoWhite:[103:87] Found expr:[103:79->103:88] @@ -689,19 +890,29 @@ ContextPath Type[otherNestedRecord] Path otherNestedRecord Path Stdlib.String.slic Path slic -[{ - "label": "String.slice", - "kind": 12, - "tags": [], +[ + { "detail": "(string, ~start: int, ~end: int=?) => string", - "documentation": {"kind": "markdown", "value": "\n`slice(str, ~start, ~end)` returns the substring of `str` starting at\ncharacter `start` up to but not including `end`.\n- If either `start` or `end` is negative, then it is evaluated as\n `length(str - start)` or `length(str - end)`.\n- If `end` is greater than the length of `str`, then it is treated as\n `length(str)`.\n- If `start` is greater than `end`, slice returns the empty string.\n See [`String.slice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/slice) on MDN.\n\n## Examples\n\n```rescript\nString.slice(\"abcdefg\", ~start=2, ~end=5) == \"cde\"\nString.slice(\"abcdefg\", ~start=2, ~end=9) == \"cdefg\"\nString.slice(\"abcdefg\", ~start=-4, ~end=-2) == \"de\"\nString.slice(\"abcdefg\", ~start=5, ~end=1) == \"\"\nString.slice(\"abcdefg\", ~start=2) == \"cdefg\"\nString.slice(\"Hello World\", ~start=6) == \"World\"\n```\n"} - }, { - "label": "String.sliceToEnd", + "documentation": { + "kind": "markdown", + "value": "\n`slice(str, ~start, ~end)` returns the substring of `str` starting at\ncharacter `start` up to but not including `end`.\n- If either `start` or `end` is negative, then it is evaluated as\n `length(str - start)` or `length(str - end)`.\n- If `end` is greater than the length of `str`, then it is treated as\n `length(str)`.\n- If `start` is greater than `end`, slice returns the empty string.\n See [`String.slice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/slice) on MDN.\n\n## Examples\n\n```rescript\nString.slice(\"abcdefg\", ~start=2, ~end=5) == \"cde\"\nString.slice(\"abcdefg\", ~start=2, ~end=9) == \"cdefg\"\nString.slice(\"abcdefg\", ~start=-4, ~end=-2) == \"de\"\nString.slice(\"abcdefg\", ~start=5, ~end=1) == \"\"\nString.slice(\"abcdefg\", ~start=2) == \"cdefg\"\nString.slice(\"Hello World\", ~start=6) == \"World\"\n```\n" + }, "kind": 12, - "tags": [1], + "label": "String.slice", + "tags": [] + }, + { + "deprecated": true, "detail": "(string, ~start: int) => string", - "documentation": {"kind": "markdown", "value": "Deprecated: Use `slice` instead\n\n\n`sliceToEnd(str, ~start)` returns the substring of `str` starting at character\n`start` to the end of the string.\n- If `start` is negative, then it is evaluated as `length(str - start)`.\n- If `start` is greater than the length of `str`, then sliceToEnd returns the empty string.\n See [`String.slice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/slice) on MDN.\n\n## Examples\n\n```rescript\nString.sliceToEnd(\"abcdefg\", ~start=4) == \"efg\"\nString.sliceToEnd(\"abcdefg\", ~start=-2) == \"fg\"\nString.sliceToEnd(\"abcdefg\", ~start=7) == \"\"\n```\n"} - }] + "documentation": { + "kind": "markdown", + "value": "Deprecated: Use `slice` instead\n\n\n`sliceToEnd(str, ~start)` returns the substring of `str` starting at character\n`start` to the end of the string.\n- If `start` is negative, then it is evaluated as `length(str - start)`.\n- If `start` is greater than the length of `str`, then sliceToEnd returns the empty string.\n See [`String.slice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/slice) on MDN.\n\n## Examples\n\n```rescript\nString.sliceToEnd(\"abcdefg\", ~start=4) == \"efg\"\nString.sliceToEnd(\"abcdefg\", ~start=-2) == \"fg\"\nString.sliceToEnd(\"abcdefg\", ~start=7) == \"\"\n```\n" + }, + "kind": 12, + "label": "String.sliceToEnd", + "tags": [ 1 ] + } +] Complete src/CompletionInferValues.res 107:89 posCursor:[107:89] posNoWhite:[107:88] Found expr:[107:80->107:89] @@ -718,19 +929,29 @@ ContextPath Type[otherNestedRecord] Path otherNestedRecord Path Stdlib.String.slic Path slic -[{ - "label": "String.slice", - "kind": 12, - "tags": [], +[ + { "detail": "(string, ~start: int, ~end: int=?) => string", - "documentation": {"kind": "markdown", "value": "\n`slice(str, ~start, ~end)` returns the substring of `str` starting at\ncharacter `start` up to but not including `end`.\n- If either `start` or `end` is negative, then it is evaluated as\n `length(str - start)` or `length(str - end)`.\n- If `end` is greater than the length of `str`, then it is treated as\n `length(str)`.\n- If `start` is greater than `end`, slice returns the empty string.\n See [`String.slice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/slice) on MDN.\n\n## Examples\n\n```rescript\nString.slice(\"abcdefg\", ~start=2, ~end=5) == \"cde\"\nString.slice(\"abcdefg\", ~start=2, ~end=9) == \"cdefg\"\nString.slice(\"abcdefg\", ~start=-4, ~end=-2) == \"de\"\nString.slice(\"abcdefg\", ~start=5, ~end=1) == \"\"\nString.slice(\"abcdefg\", ~start=2) == \"cdefg\"\nString.slice(\"Hello World\", ~start=6) == \"World\"\n```\n"} - }, { - "label": "String.sliceToEnd", + "documentation": { + "kind": "markdown", + "value": "\n`slice(str, ~start, ~end)` returns the substring of `str` starting at\ncharacter `start` up to but not including `end`.\n- If either `start` or `end` is negative, then it is evaluated as\n `length(str - start)` or `length(str - end)`.\n- If `end` is greater than the length of `str`, then it is treated as\n `length(str)`.\n- If `start` is greater than `end`, slice returns the empty string.\n See [`String.slice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/slice) on MDN.\n\n## Examples\n\n```rescript\nString.slice(\"abcdefg\", ~start=2, ~end=5) == \"cde\"\nString.slice(\"abcdefg\", ~start=2, ~end=9) == \"cdefg\"\nString.slice(\"abcdefg\", ~start=-4, ~end=-2) == \"de\"\nString.slice(\"abcdefg\", ~start=5, ~end=1) == \"\"\nString.slice(\"abcdefg\", ~start=2) == \"cdefg\"\nString.slice(\"Hello World\", ~start=6) == \"World\"\n```\n" + }, "kind": 12, - "tags": [1], + "label": "String.slice", + "tags": [] + }, + { + "deprecated": true, "detail": "(string, ~start: int) => string", - "documentation": {"kind": "markdown", "value": "Deprecated: Use `slice` instead\n\n\n`sliceToEnd(str, ~start)` returns the substring of `str` starting at character\n`start` to the end of the string.\n- If `start` is negative, then it is evaluated as `length(str - start)`.\n- If `start` is greater than the length of `str`, then sliceToEnd returns the empty string.\n See [`String.slice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/slice) on MDN.\n\n## Examples\n\n```rescript\nString.sliceToEnd(\"abcdefg\", ~start=4) == \"efg\"\nString.sliceToEnd(\"abcdefg\", ~start=-2) == \"fg\"\nString.sliceToEnd(\"abcdefg\", ~start=7) == \"\"\n```\n"} - }] + "documentation": { + "kind": "markdown", + "value": "Deprecated: Use `slice` instead\n\n\n`sliceToEnd(str, ~start)` returns the substring of `str` starting at character\n`start` to the end of the string.\n- If `start` is negative, then it is evaluated as `length(str - start)`.\n- If `start` is greater than the length of `str`, then sliceToEnd returns the empty string.\n See [`String.slice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/slice) on MDN.\n\n## Examples\n\n```rescript\nString.sliceToEnd(\"abcdefg\", ~start=4) == \"efg\"\nString.sliceToEnd(\"abcdefg\", ~start=-2) == \"fg\"\nString.sliceToEnd(\"abcdefg\", ~start=7) == \"\"\n```\n" + }, + "kind": 12, + "label": "String.sliceToEnd", + "tags": [ 1 ] + } +] Complete src/CompletionInferValues.res 111:80 posCursor:[111:80] posNoWhite:[111:79] Found expr:[111:70->111:80] @@ -747,19 +968,29 @@ ContextPath Type[otherNestedRecord] Path otherNestedRecord Path Stdlib.String.slic Path slic -[{ - "label": "String.slice", - "kind": 12, - "tags": [], +[ + { "detail": "(string, ~start: int, ~end: int=?) => string", - "documentation": {"kind": "markdown", "value": "\n`slice(str, ~start, ~end)` returns the substring of `str` starting at\ncharacter `start` up to but not including `end`.\n- If either `start` or `end` is negative, then it is evaluated as\n `length(str - start)` or `length(str - end)`.\n- If `end` is greater than the length of `str`, then it is treated as\n `length(str)`.\n- If `start` is greater than `end`, slice returns the empty string.\n See [`String.slice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/slice) on MDN.\n\n## Examples\n\n```rescript\nString.slice(\"abcdefg\", ~start=2, ~end=5) == \"cde\"\nString.slice(\"abcdefg\", ~start=2, ~end=9) == \"cdefg\"\nString.slice(\"abcdefg\", ~start=-4, ~end=-2) == \"de\"\nString.slice(\"abcdefg\", ~start=5, ~end=1) == \"\"\nString.slice(\"abcdefg\", ~start=2) == \"cdefg\"\nString.slice(\"Hello World\", ~start=6) == \"World\"\n```\n"} - }, { - "label": "String.sliceToEnd", + "documentation": { + "kind": "markdown", + "value": "\n`slice(str, ~start, ~end)` returns the substring of `str` starting at\ncharacter `start` up to but not including `end`.\n- If either `start` or `end` is negative, then it is evaluated as\n `length(str - start)` or `length(str - end)`.\n- If `end` is greater than the length of `str`, then it is treated as\n `length(str)`.\n- If `start` is greater than `end`, slice returns the empty string.\n See [`String.slice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/slice) on MDN.\n\n## Examples\n\n```rescript\nString.slice(\"abcdefg\", ~start=2, ~end=5) == \"cde\"\nString.slice(\"abcdefg\", ~start=2, ~end=9) == \"cdefg\"\nString.slice(\"abcdefg\", ~start=-4, ~end=-2) == \"de\"\nString.slice(\"abcdefg\", ~start=5, ~end=1) == \"\"\nString.slice(\"abcdefg\", ~start=2) == \"cdefg\"\nString.slice(\"Hello World\", ~start=6) == \"World\"\n```\n" + }, "kind": 12, - "tags": [1], + "label": "String.slice", + "tags": [] + }, + { + "deprecated": true, "detail": "(string, ~start: int) => string", - "documentation": {"kind": "markdown", "value": "Deprecated: Use `slice` instead\n\n\n`sliceToEnd(str, ~start)` returns the substring of `str` starting at character\n`start` to the end of the string.\n- If `start` is negative, then it is evaluated as `length(str - start)`.\n- If `start` is greater than the length of `str`, then sliceToEnd returns the empty string.\n See [`String.slice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/slice) on MDN.\n\n## Examples\n\n```rescript\nString.sliceToEnd(\"abcdefg\", ~start=4) == \"efg\"\nString.sliceToEnd(\"abcdefg\", ~start=-2) == \"fg\"\nString.sliceToEnd(\"abcdefg\", ~start=7) == \"\"\n```\n"} - }] + "documentation": { + "kind": "markdown", + "value": "Deprecated: Use `slice` instead\n\n\n`sliceToEnd(str, ~start)` returns the substring of `str` starting at character\n`start` to the end of the string.\n- If `start` is negative, then it is evaluated as `length(str - start)`.\n- If `start` is greater than the length of `str`, then sliceToEnd returns the empty string.\n See [`String.slice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/slice) on MDN.\n\n## Examples\n\n```rescript\nString.sliceToEnd(\"abcdefg\", ~start=4) == \"efg\"\nString.sliceToEnd(\"abcdefg\", ~start=-2) == \"fg\"\nString.sliceToEnd(\"abcdefg\", ~start=7) == \"\"\n```\n" + }, + "kind": 12, + "label": "String.sliceToEnd", + "tags": [ 1 ] + } +] Complete src/CompletionInferValues.res 115:53 posCursor:[115:53] posNoWhite:[115:52] Found expr:[115:46->115:53] @@ -774,19 +1005,29 @@ Path x ContextPath int Path Stdlib.Int.toSt Path toSt -[{ - "label": "Int.toStringWithRadix", - "kind": 12, - "tags": [1], +[ + { + "deprecated": true, "detail": "(int, ~radix: int) => string", - "documentation": {"kind": "markdown", "value": "Deprecated: Use `toString` instead\n\n\n`toStringWithRadix(n, ~radix)` return a `string` representing the given value.\n`~radix` specifies the radix base to use for the formatted number.\nSee [`Number.toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toString)\non MDN.\n\n## Examples\n\n```rescript\nInt.toStringWithRadix(6, ~radix=2) // \"110\"\nInt.toStringWithRadix(373592855, ~radix=16) // \"16449317\"\nInt.toStringWithRadix(123456, ~radix=36) // \"2n9c\"\n```\n\n## Exceptions\n\n`RangeError`: if `radix` is less than 2 or greater than 36.\n"} - }, { - "label": "Int.toString", + "documentation": { + "kind": "markdown", + "value": "Deprecated: Use `toString` instead\n\n\n`toStringWithRadix(n, ~radix)` return a `string` representing the given value.\n`~radix` specifies the radix base to use for the formatted number.\nSee [`Number.toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toString)\non MDN.\n\n## Examples\n\n```rescript\nInt.toStringWithRadix(6, ~radix=2) // \"110\"\nInt.toStringWithRadix(373592855, ~radix=16) // \"16449317\"\nInt.toStringWithRadix(123456, ~radix=36) // \"2n9c\"\n```\n\n## Exceptions\n\n`RangeError`: if `radix` is less than 2 or greater than 36.\n" + }, "kind": 12, - "tags": [], + "label": "Int.toStringWithRadix", + "tags": [ 1 ] + }, + { "detail": "(int, ~radix: int=?) => string", - "documentation": {"kind": "markdown", "value": "\n`toString(n, ~radix=?)` return a `string` representing the given value.\n`~radix` specifies the radix base to use for the formatted number.\nSee [`Number.toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toString)\non MDN.\n\n## Examples\n\n```rescript\nInt.toString(1000) // \"1000\"\nInt.toString(-1000) // \"-1000\"\nInt.toString(6, ~radix=2) // \"110\"\nInt.toString(373592855, ~radix=16) // \"16449317\"\nInt.toString(123456, ~radix=36) // \"2n9c\"\n```\n\n## Exceptions\n\n`RangeError`: if `radix` is less than 2 or greater than 36.\n"} - }] + "documentation": { + "kind": "markdown", + "value": "\n`toString(n, ~radix=?)` return a `string` representing the given value.\n`~radix` specifies the radix base to use for the formatted number.\nSee [`Number.toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toString)\non MDN.\n\n## Examples\n\n```rescript\nInt.toString(1000) // \"1000\"\nInt.toString(-1000) // \"-1000\"\nInt.toString(6, ~radix=2) // \"110\"\nInt.toString(373592855, ~radix=16) // \"16449317\"\nInt.toString(123456, ~radix=36) // \"2n9c\"\n```\n\n## Exceptions\n\n`RangeError`: if `radix` is less than 2 or greater than 36.\n" + }, + "kind": 12, + "label": "Int.toString", + "tags": [] + } +] Complete src/CompletionInferValues.res 123:26 posCursor:[123:26] posNoWhite:[123:25] Found expr:[123:3->123:37] @@ -801,19 +1042,28 @@ ContextPath CArgument CArgument Value[fnWithRecordCallback]($0)($0) ContextPath CArgument Value[fnWithRecordCallback]($0) ContextPath Value[fnWithRecordCallback] Path fnWithRecordCallback -[{ - "label": "name", - "kind": 5, - "tags": [], +[ + { "detail": "string", - "documentation": {"kind": "markdown", "value": "```rescript\nname: string\n```\n\n```rescript\ntype someRecord = {name: string, age: int}\n```"} - }, { - "label": "age", + "documentation": { + "kind": "markdown", + "value": "```rescript\nname: string\n```\n\n```rescript\ntype someRecord = {name: string, age: int}\n```" + }, "kind": 5, - "tags": [], + "label": "name", + "tags": [] + }, + { "detail": "int", - "documentation": {"kind": "markdown", "value": "```rescript\nage: int\n```\n\n```rescript\ntype someRecord = {name: string, age: int}\n```"} - }] + "documentation": { + "kind": "markdown", + "value": "```rescript\nage: int\n```\n\n```rescript\ntype someRecord = {name: string, age: int}\n```" + }, + "kind": 5, + "label": "age", + "tags": [] + } +] Complete src/CompletionInferValues.res 130:30 posCursor:[130:30] posNoWhite:[130:29] Found expr:[130:3->130:33] @@ -835,19 +1085,20 @@ Path fn2 CPPipe pathFromEnv:ReactDOM.Client.Root found:false Path ReactDOM.Client.Root. Path -[{ - "label": "ReactDOM.Client.Root.unmount", - "kind": 12, - "tags": [], +[ + { "detail": "(t, unit) => unit", - "documentation": null - }, { - "label": "ReactDOM.Client.Root.render", "kind": 12, - "tags": [], + "label": "ReactDOM.Client.Root.unmount", + "tags": [] + }, + { "detail": "(t, React.element) => unit", - "documentation": null - }] + "kind": 12, + "label": "ReactDOM.Client.Root.render", + "tags": [] + } +] Complete src/CompletionInferValues.res 139:30 posCursor:[139:30] posNoWhite:[139:29] Found expr:[139:3->139:33] @@ -869,19 +1120,20 @@ Path fn3 CPPipe pathFromEnv:CompletionSupport.Test found:false Path CompletionSupport.Test. Path -[{ - "label": "CompletionSupport.Test.add", - "kind": 12, - "tags": [], +[ + { "detail": "t => int", - "documentation": null - }, { - "label": "CompletionSupport.Test.addSelf", "kind": 12, - "tags": [], + "label": "CompletionSupport.Test.add", + "tags": [] + }, + { "detail": "t => t", - "documentation": null - }] + "kind": 12, + "label": "CompletionSupport.Test.addSelf", + "tags": [] + } +] Complete src/CompletionInferValues.res 143:47 XXX Not found! @@ -891,16 +1143,17 @@ Resolved opens 1 Stdlib ContextPath Value[Belt, Int, toString](Nolabel) ContextPath Value[Belt, Int, toString] Path Belt.Int.toString -[{ - "label": "\"\"", - "kind": 12, - "tags": [], +[ + { "detail": "string", - "documentation": null, - "sortText": "A", "insertText": "\"$0\"", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 12, + "label": "\"\"", + "sortText": "A", + "tags": [] + } +] Complete src/CompletionInferValues.res 147:66 XXX Not found! @@ -910,16 +1163,17 @@ Resolved opens 1 Stdlib ContextPath Value[String, split](Nolabel, Nolabel) ContextPath Value[String, split] Path String.split -[{ - "label": "[]", - "kind": 12, - "tags": [], +[ + { "detail": "string", - "documentation": null, - "sortText": "A", "insertText": "[$0]", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 12, + "label": "[]", + "sortText": "A", + "tags": [] + } +] Complete src/CompletionInferValues.res 151:105 posCursor:[151:105] posNoWhite:[151:104] Found expr:[151:18->151:110] @@ -949,13 +1203,18 @@ Path CompletionSupport2.makeRenderer CPPipe pathFromEnv:CompletionSupport.Nested found:false Path CompletionSupport.Nested. Path -[{ - "label": "root", - "kind": 5, - "tags": [], +[ + { "detail": "ReactDOM.Client.Root.t", - "documentation": {"kind": "markdown", "value": "```rescript\nroot: ReactDOM.Client.Root.t\n```\n\n```rescript\ntype config = {root: ReactDOM.Client.Root.t}\n```"} - }] + "documentation": { + "kind": "markdown", + "value": "```rescript\nroot: ReactDOM.Client.Root.t\n```\n\n```rescript\ntype config = {root: ReactDOM.Client.Root.t}\n```" + }, + "kind": 5, + "label": "root", + "tags": [] + } +] Complete src/CompletionInferValues.res 155:110 posCursor:[155:110] posNoWhite:[155:109] Found expr:[155:18->155:115] @@ -977,19 +1236,20 @@ Path CompletionSupport2.makeRenderer CPPipe pathFromEnv:ReactDOM.Client.Root found:false Path ReactDOM.Client.Root. Path -[{ - "label": "ReactDOM.Client.Root.unmount", - "kind": 12, - "tags": [], +[ + { "detail": "(t, unit) => unit", - "documentation": null - }, { - "label": "ReactDOM.Client.Root.render", "kind": 12, - "tags": [], + "label": "ReactDOM.Client.Root.unmount", + "tags": [] + }, + { "detail": "(t, React.element) => unit", - "documentation": null - }] + "kind": 12, + "label": "ReactDOM.Client.Root.render", + "tags": [] + } +] Hover src/CompletionInferValues.res 160:27 Nothing at that position. Now trying to use completion. @@ -1004,5 +1264,5 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Value[res] Path res -{"contents": {"kind": "markdown", "value": "```rescript\nint\n```"}} +{ "contents": { "kind": "markdown", "value": "```rescript\nint\n```" } } diff --git a/tests/analysis_tests/tests/src/expected/CompletionJsx.res.txt b/tests/analysis_tests/tests/src/expected/CompletionJsx.res.txt index a866ce1ee3e..4a660c15557 100644 --- a/tests/analysis_tests/tests/src/expected/CompletionJsx.res.txt +++ b/tests/analysis_tests/tests/src/expected/CompletionJsx.res.txt @@ -8,19 +8,28 @@ ContextPath Value[someString] Path someString Path Stdlib.String.st Path st -[{ - "label": "String.startsWith", - "kind": 12, - "tags": [], +[ + { "detail": "(string, string) => bool", - "documentation": {"kind": "markdown", "value": "\n`startsWith(str, substr)` returns `true` if the `str` starts with `substr`,\n`false` otherwise.\nSee [`String.startsWith`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/startsWith) on MDN.\n\n## Examples\n\n```rescript\nString.startsWith(\"BuckleScript\", \"Buckle\") == true\nString.startsWith(\"BuckleScript\", \"\") == true\nString.startsWith(\"JavaScript\", \"Buckle\") == false\n```\n"} - }, { - "label": "String.startsWithFrom", + "documentation": { + "kind": "markdown", + "value": "\n`startsWith(str, substr)` returns `true` if the `str` starts with `substr`,\n`false` otherwise.\nSee [`String.startsWith`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/startsWith) on MDN.\n\n## Examples\n\n```rescript\nString.startsWith(\"BuckleScript\", \"Buckle\") == true\nString.startsWith(\"BuckleScript\", \"\") == true\nString.startsWith(\"JavaScript\", \"Buckle\") == false\n```\n" + }, "kind": 12, - "tags": [], + "label": "String.startsWith", + "tags": [] + }, + { "detail": "(string, string, int) => bool", - "documentation": {"kind": "markdown", "value": "\n`startsWithFrom(str, substr, n)` returns `true` if the `str` starts\nwith `substr` starting at position `n`, `false` otherwise. If `n` is negative,\nthe search starts at the beginning of `str`.\nSee [`String.startsWith`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/startsWith) on MDN.\n\n## Examples\n\n```rescript\nString.startsWithFrom(\"BuckleScript\", \"kle\", 3) == true\nString.startsWithFrom(\"BuckleScript\", \"\", 3) == true\nString.startsWithFrom(\"JavaScript\", \"Buckle\", 2) == false\n```\n"} - }] + "documentation": { + "kind": "markdown", + "value": "\n`startsWithFrom(str, substr, n)` returns `true` if the `str` starts\nwith `substr` starting at position `n`, `false` otherwise. If `n` is negative,\nthe search starts at the beginning of `str`.\nSee [`String.startsWith`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/startsWith) on MDN.\n\n## Examples\n\n```rescript\nString.startsWithFrom(\"BuckleScript\", \"kle\", 3) == true\nString.startsWithFrom(\"BuckleScript\", \"\", 3) == true\nString.startsWithFrom(\"JavaScript\", \"Buckle\", 2) == false\n```\n" + }, + "kind": 12, + "label": "String.startsWithFrom", + "tags": [] + } +] Complete src/CompletionJsx.res 13:21 posCursor:[13:21] posNoWhite:[13:20] Found expr:[8:13->33:3] @@ -38,27 +47,40 @@ ContextPath Value[someString] Path someString Path Stdlib.String.st Path st -[{ - "label": "React.string", - "kind": 12, - "tags": [], +[ + { "detail": "string", - "documentation": {"kind": "markdown", "value": "Turns `string` into a JSX element so it can be used inside of JSX."}, - "sortText": "A", - "insertTextFormat": 2 - }, { - "label": "String.startsWith", + "documentation": { + "kind": "markdown", + "value": "Turns `string` into a JSX element so it can be used inside of JSX." + }, + "insertTextFormat": 2, "kind": 12, - "tags": [], + "label": "React.string", + "sortText": "A", + "tags": [] + }, + { "detail": "(string, string) => bool", - "documentation": {"kind": "markdown", "value": "\n`startsWith(str, substr)` returns `true` if the `str` starts with `substr`,\n`false` otherwise.\nSee [`String.startsWith`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/startsWith) on MDN.\n\n## Examples\n\n```rescript\nString.startsWith(\"BuckleScript\", \"Buckle\") == true\nString.startsWith(\"BuckleScript\", \"\") == true\nString.startsWith(\"JavaScript\", \"Buckle\") == false\n```\n"} - }, { - "label": "String.startsWithFrom", + "documentation": { + "kind": "markdown", + "value": "\n`startsWith(str, substr)` returns `true` if the `str` starts with `substr`,\n`false` otherwise.\nSee [`String.startsWith`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/startsWith) on MDN.\n\n## Examples\n\n```rescript\nString.startsWith(\"BuckleScript\", \"Buckle\") == true\nString.startsWith(\"BuckleScript\", \"\") == true\nString.startsWith(\"JavaScript\", \"Buckle\") == false\n```\n" + }, "kind": 12, - "tags": [], + "label": "String.startsWith", + "tags": [] + }, + { "detail": "(string, string, int) => bool", - "documentation": {"kind": "markdown", "value": "\n`startsWithFrom(str, substr, n)` returns `true` if the `str` starts\nwith `substr` starting at position `n`, `false` otherwise. If `n` is negative,\nthe search starts at the beginning of `str`.\nSee [`String.startsWith`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/startsWith) on MDN.\n\n## Examples\n\n```rescript\nString.startsWithFrom(\"BuckleScript\", \"kle\", 3) == true\nString.startsWithFrom(\"BuckleScript\", \"\", 3) == true\nString.startsWithFrom(\"JavaScript\", \"Buckle\", 2) == false\n```\n"} - }] + "documentation": { + "kind": "markdown", + "value": "\n`startsWithFrom(str, substr, n)` returns `true` if the `str` starts\nwith `substr` starting at position `n`, `false` otherwise. If `n` is negative,\nthe search starts at the beginning of `str`.\nSee [`String.startsWith`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/startsWith) on MDN.\n\n## Examples\n\n```rescript\nString.startsWithFrom(\"BuckleScript\", \"kle\", 3) == true\nString.startsWithFrom(\"BuckleScript\", \"\", 3) == true\nString.startsWithFrom(\"JavaScript\", \"Buckle\", 2) == false\n```\n" + }, + "kind": 12, + "label": "String.startsWithFrom", + "tags": [] + } +] Complete src/CompletionJsx.res 18:24 posCursor:[18:24] posNoWhite:[18:23] Found expr:[8:13->33:3] @@ -77,27 +99,40 @@ ContextPath Value[someString] Path someString Path Stdlib.String.st Path st -[{ - "label": "React.string", - "kind": 12, - "tags": [], +[ + { "detail": "string", - "documentation": {"kind": "markdown", "value": "Turns `string` into a JSX element so it can be used inside of JSX."}, - "sortText": "A", - "insertTextFormat": 2 - }, { - "label": "String.startsWith", + "documentation": { + "kind": "markdown", + "value": "Turns `string` into a JSX element so it can be used inside of JSX." + }, + "insertTextFormat": 2, "kind": 12, - "tags": [], + "label": "React.string", + "sortText": "A", + "tags": [] + }, + { "detail": "(string, string) => bool", - "documentation": {"kind": "markdown", "value": "\n`startsWith(str, substr)` returns `true` if the `str` starts with `substr`,\n`false` otherwise.\nSee [`String.startsWith`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/startsWith) on MDN.\n\n## Examples\n\n```rescript\nString.startsWith(\"BuckleScript\", \"Buckle\") == true\nString.startsWith(\"BuckleScript\", \"\") == true\nString.startsWith(\"JavaScript\", \"Buckle\") == false\n```\n"} - }, { - "label": "String.startsWithFrom", + "documentation": { + "kind": "markdown", + "value": "\n`startsWith(str, substr)` returns `true` if the `str` starts with `substr`,\n`false` otherwise.\nSee [`String.startsWith`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/startsWith) on MDN.\n\n## Examples\n\n```rescript\nString.startsWith(\"BuckleScript\", \"Buckle\") == true\nString.startsWith(\"BuckleScript\", \"\") == true\nString.startsWith(\"JavaScript\", \"Buckle\") == false\n```\n" + }, "kind": 12, - "tags": [], + "label": "String.startsWith", + "tags": [] + }, + { "detail": "(string, string, int) => bool", - "documentation": {"kind": "markdown", "value": "\n`startsWithFrom(str, substr, n)` returns `true` if the `str` starts\nwith `substr` starting at position `n`, `false` otherwise. If `n` is negative,\nthe search starts at the beginning of `str`.\nSee [`String.startsWith`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/startsWith) on MDN.\n\n## Examples\n\n```rescript\nString.startsWithFrom(\"BuckleScript\", \"kle\", 3) == true\nString.startsWithFrom(\"BuckleScript\", \"\", 3) == true\nString.startsWithFrom(\"JavaScript\", \"Buckle\", 2) == false\n```\n"} - }] + "documentation": { + "kind": "markdown", + "value": "\n`startsWithFrom(str, substr, n)` returns `true` if the `str` starts\nwith `substr` starting at position `n`, `false` otherwise. If `n` is negative,\nthe search starts at the beginning of `str`.\nSee [`String.startsWith`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/startsWith) on MDN.\n\n## Examples\n\n```rescript\nString.startsWithFrom(\"BuckleScript\", \"kle\", 3) == true\nString.startsWithFrom(\"BuckleScript\", \"\", 3) == true\nString.startsWithFrom(\"JavaScript\", \"Buckle\", 2) == false\n```\n" + }, + "kind": 12, + "label": "String.startsWithFrom", + "tags": [] + } +] Complete src/CompletionJsx.res 20:27 posCursor:[20:27] posNoWhite:[20:26] Found expr:[8:13->33:3] @@ -115,27 +150,40 @@ ContextPath string->st <> ContextPath string Path Stdlib.String.st Path st -[{ - "label": "React.string", - "kind": 12, - "tags": [], +[ + { "detail": "string", - "documentation": {"kind": "markdown", "value": "Turns `string` into a JSX element so it can be used inside of JSX."}, - "sortText": "A", - "insertTextFormat": 2 - }, { - "label": "String.startsWith", + "documentation": { + "kind": "markdown", + "value": "Turns `string` into a JSX element so it can be used inside of JSX." + }, + "insertTextFormat": 2, "kind": 12, - "tags": [], + "label": "React.string", + "sortText": "A", + "tags": [] + }, + { "detail": "(string, string) => bool", - "documentation": {"kind": "markdown", "value": "\n`startsWith(str, substr)` returns `true` if the `str` starts with `substr`,\n`false` otherwise.\nSee [`String.startsWith`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/startsWith) on MDN.\n\n## Examples\n\n```rescript\nString.startsWith(\"BuckleScript\", \"Buckle\") == true\nString.startsWith(\"BuckleScript\", \"\") == true\nString.startsWith(\"JavaScript\", \"Buckle\") == false\n```\n"} - }, { - "label": "String.startsWithFrom", + "documentation": { + "kind": "markdown", + "value": "\n`startsWith(str, substr)` returns `true` if the `str` starts with `substr`,\n`false` otherwise.\nSee [`String.startsWith`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/startsWith) on MDN.\n\n## Examples\n\n```rescript\nString.startsWith(\"BuckleScript\", \"Buckle\") == true\nString.startsWith(\"BuckleScript\", \"\") == true\nString.startsWith(\"JavaScript\", \"Buckle\") == false\n```\n" + }, "kind": 12, - "tags": [], + "label": "String.startsWith", + "tags": [] + }, + { "detail": "(string, string, int) => bool", - "documentation": {"kind": "markdown", "value": "\n`startsWithFrom(str, substr, n)` returns `true` if the `str` starts\nwith `substr` starting at position `n`, `false` otherwise. If `n` is negative,\nthe search starts at the beginning of `str`.\nSee [`String.startsWith`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/startsWith) on MDN.\n\n## Examples\n\n```rescript\nString.startsWithFrom(\"BuckleScript\", \"kle\", 3) == true\nString.startsWithFrom(\"BuckleScript\", \"\", 3) == true\nString.startsWithFrom(\"JavaScript\", \"Buckle\", 2) == false\n```\n"} - }] + "documentation": { + "kind": "markdown", + "value": "\n`startsWithFrom(str, substr, n)` returns `true` if the `str` starts\nwith `substr` starting at position `n`, `false` otherwise. If `n` is negative,\nthe search starts at the beginning of `str`.\nSee [`String.startsWith`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/startsWith) on MDN.\n\n## Examples\n\n```rescript\nString.startsWithFrom(\"BuckleScript\", \"kle\", 3) == true\nString.startsWithFrom(\"BuckleScript\", \"\", 3) == true\nString.startsWithFrom(\"JavaScript\", \"Buckle\", 2) == false\n```\n" + }, + "kind": 12, + "label": "String.startsWithFrom", + "tags": [] + } +] Complete src/CompletionJsx.res 22:40 posCursor:[22:40] posNoWhite:[22:39] Found expr:[8:13->33:3] @@ -155,27 +203,40 @@ ContextPath Value[String, trim] Path String.trim Path Stdlib.String.st Path st -[{ - "label": "React.string", - "kind": 12, - "tags": [], +[ + { "detail": "string", - "documentation": {"kind": "markdown", "value": "Turns `string` into a JSX element so it can be used inside of JSX."}, - "sortText": "A", - "insertTextFormat": 2 - }, { - "label": "String.startsWith", + "documentation": { + "kind": "markdown", + "value": "Turns `string` into a JSX element so it can be used inside of JSX." + }, + "insertTextFormat": 2, "kind": 12, - "tags": [], + "label": "React.string", + "sortText": "A", + "tags": [] + }, + { "detail": "(string, string) => bool", - "documentation": {"kind": "markdown", "value": "\n`startsWith(str, substr)` returns `true` if the `str` starts with `substr`,\n`false` otherwise.\nSee [`String.startsWith`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/startsWith) on MDN.\n\n## Examples\n\n```rescript\nString.startsWith(\"BuckleScript\", \"Buckle\") == true\nString.startsWith(\"BuckleScript\", \"\") == true\nString.startsWith(\"JavaScript\", \"Buckle\") == false\n```\n"} - }, { - "label": "String.startsWithFrom", + "documentation": { + "kind": "markdown", + "value": "\n`startsWith(str, substr)` returns `true` if the `str` starts with `substr`,\n`false` otherwise.\nSee [`String.startsWith`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/startsWith) on MDN.\n\n## Examples\n\n```rescript\nString.startsWith(\"BuckleScript\", \"Buckle\") == true\nString.startsWith(\"BuckleScript\", \"\") == true\nString.startsWith(\"JavaScript\", \"Buckle\") == false\n```\n" + }, "kind": 12, - "tags": [], + "label": "String.startsWith", + "tags": [] + }, + { "detail": "(string, string, int) => bool", - "documentation": {"kind": "markdown", "value": "\n`startsWithFrom(str, substr, n)` returns `true` if the `str` starts\nwith `substr` starting at position `n`, `false` otherwise. If `n` is negative,\nthe search starts at the beginning of `str`.\nSee [`String.startsWith`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/startsWith) on MDN.\n\n## Examples\n\n```rescript\nString.startsWithFrom(\"BuckleScript\", \"kle\", 3) == true\nString.startsWithFrom(\"BuckleScript\", \"\", 3) == true\nString.startsWithFrom(\"JavaScript\", \"Buckle\", 2) == false\n```\n"} - }] + "documentation": { + "kind": "markdown", + "value": "\n`startsWithFrom(str, substr, n)` returns `true` if the `str` starts\nwith `substr` starting at position `n`, `false` otherwise. If `n` is negative,\nthe search starts at the beginning of `str`.\nSee [`String.startsWith`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/startsWith) on MDN.\n\n## Examples\n\n```rescript\nString.startsWithFrom(\"BuckleScript\", \"kle\", 3) == true\nString.startsWithFrom(\"BuckleScript\", \"\", 3) == true\nString.startsWithFrom(\"JavaScript\", \"Buckle\", 2) == false\n```\n" + }, + "kind": 12, + "label": "String.startsWithFrom", + "tags": [] + } +] Complete src/CompletionJsx.res 24:19 posCursor:[24:19] posNoWhite:[24:18] Found expr:[8:13->33:3] @@ -194,159 +255,257 @@ ContextPath Value[someInt] Path someInt Path Stdlib.Int. Path -[{ - "label": "React.int", - "kind": 12, - "tags": [], +[ + { "detail": "int", - "documentation": {"kind": "markdown", "value": "Turns `int` into a JSX element so it can be used inside of JSX."}, - "sortText": "A", - "insertTextFormat": 2 - }, { - "label": "Int.equal", + "documentation": { + "kind": "markdown", + "value": "Turns `int` into a JSX element so it can be used inside of JSX." + }, + "insertTextFormat": 2, "kind": 12, - "tags": [], + "label": "React.int", + "sortText": "A", + "tags": [] + }, + { "detail": "(int, int) => bool", - "documentation": null - }, { - "label": "Int.toStringWithRadix", "kind": 12, - "tags": [1], + "label": "Int.equal", + "tags": [] + }, + { + "deprecated": true, "detail": "(int, ~radix: int) => string", - "documentation": {"kind": "markdown", "value": "Deprecated: Use `toString` instead\n\n\n`toStringWithRadix(n, ~radix)` return a `string` representing the given value.\n`~radix` specifies the radix base to use for the formatted number.\nSee [`Number.toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toString)\non MDN.\n\n## Examples\n\n```rescript\nInt.toStringWithRadix(6, ~radix=2) // \"110\"\nInt.toStringWithRadix(373592855, ~radix=16) // \"16449317\"\nInt.toStringWithRadix(123456, ~radix=36) // \"2n9c\"\n```\n\n## Exceptions\n\n`RangeError`: if `radix` is less than 2 or greater than 36.\n"} - }, { - "label": "Int.toExponentialWithPrecision", + "documentation": { + "kind": "markdown", + "value": "Deprecated: Use `toString` instead\n\n\n`toStringWithRadix(n, ~radix)` return a `string` representing the given value.\n`~radix` specifies the radix base to use for the formatted number.\nSee [`Number.toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toString)\non MDN.\n\n## Examples\n\n```rescript\nInt.toStringWithRadix(6, ~radix=2) // \"110\"\nInt.toStringWithRadix(373592855, ~radix=16) // \"16449317\"\nInt.toStringWithRadix(123456, ~radix=36) // \"2n9c\"\n```\n\n## Exceptions\n\n`RangeError`: if `radix` is less than 2 or greater than 36.\n" + }, "kind": 12, - "tags": [1], + "label": "Int.toStringWithRadix", + "tags": [ 1 ] + }, + { + "deprecated": true, "detail": "(int, ~digits: int) => string", - "documentation": {"kind": "markdown", "value": "Deprecated: Use `toExponential` instead\n\n\n`toExponential(n, ~digits)` return a `string` representing the given value in\nexponential notation. `digits` specifies how many digits should appear after\nthe decimal point. See [`Number.toExponential`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toExponential)\non MDN.\n\n## Examples\n\n```rescript\nInt.toExponentialWithPrecision(77, ~digits=2) // \"7.70e+1\"\nInt.toExponentialWithPrecision(5678, ~digits=2) // \"5.68e+3\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` less than 0 or greater than 10.\n"} - }, { - "label": "Int.bitwiseXor", + "documentation": { + "kind": "markdown", + "value": "Deprecated: Use `toExponential` instead\n\n\n`toExponential(n, ~digits)` return a `string` representing the given value in\nexponential notation. `digits` specifies how many digits should appear after\nthe decimal point. See [`Number.toExponential`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toExponential)\non MDN.\n\n## Examples\n\n```rescript\nInt.toExponentialWithPrecision(77, ~digits=2) // \"7.70e+1\"\nInt.toExponentialWithPrecision(5678, ~digits=2) // \"5.68e+3\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` less than 0 or greater than 10.\n" + }, "kind": 12, - "tags": [], + "label": "Int.toExponentialWithPrecision", + "tags": [ 1 ] + }, + { "detail": "(int, int) => int", - "documentation": {"kind": "markdown", "value": "\n`bigwiseXor(n1, n2)` calculates the bitwise XOR of two integers.\n\n## Examples\n\n```rescript\nInt.bitwiseXor(7, 4) == 3\n```\n"} - }, { - "label": "Int.clamp", + "documentation": { + "kind": "markdown", + "value": "\n`bigwiseXor(n1, n2)` calculates the bitwise XOR of two integers.\n\n## Examples\n\n```rescript\nInt.bitwiseXor(7, 4) == 3\n```\n" + }, "kind": 12, - "tags": [], + "label": "Int.bitwiseXor", + "tags": [] + }, + { "detail": "(~min: int=?, ~max: int=?, int) => int", - "documentation": {"kind": "markdown", "value": "\n`clamp(~min=?, ~max=?, value)` returns `value`, optionally bounded by `min` and `max`.\n\nif `max` \\< `min` returns `min`.\n\n## Examples\n\n```rescript\nInt.clamp(42) == 42\nInt.clamp(42, ~min=50) == 50\nInt.clamp(42, ~max=40) == 40\nInt.clamp(42, ~min=50, ~max=40) == 50\n```\n"} - }, { - "label": "Int.toFixedWithPrecision", + "documentation": { + "kind": "markdown", + "value": "\n`clamp(~min=?, ~max=?, value)` returns `value`, optionally bounded by `min` and `max`.\n\nif `max` \\< `min` returns `min`.\n\n## Examples\n\n```rescript\nInt.clamp(42) == 42\nInt.clamp(42, ~min=50) == 50\nInt.clamp(42, ~max=40) == 40\nInt.clamp(42, ~min=50, ~max=40) == 50\n```\n" + }, "kind": 12, - "tags": [1], + "label": "Int.clamp", + "tags": [] + }, + { + "deprecated": true, "detail": "(int, ~digits: int) => string", - "documentation": {"kind": "markdown", "value": "Deprecated: Use `toFixed` instead\n\n\n`toFixedWithPrecision(n, ~digits)` return a `string` representing the given\nvalue using fixed-point notation. `digits` specifies how many digits should\nappear after the decimal point. See [`Number.toFixed`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toFixed)\non MDN.\n\n## Examples\n\n```rescript\nInt.toFixedWithPrecision(300, ~digits=4) // \"300.0000\"\nInt.toFixedWithPrecision(300, ~digits=1) // \"300.0\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` is less than 0 or larger than 100.\n"} - }, { - "label": "Int.toPrecisionWithPrecision", + "documentation": { + "kind": "markdown", + "value": "Deprecated: Use `toFixed` instead\n\n\n`toFixedWithPrecision(n, ~digits)` return a `string` representing the given\nvalue using fixed-point notation. `digits` specifies how many digits should\nappear after the decimal point. See [`Number.toFixed`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toFixed)\non MDN.\n\n## Examples\n\n```rescript\nInt.toFixedWithPrecision(300, ~digits=4) // \"300.0000\"\nInt.toFixedWithPrecision(300, ~digits=1) // \"300.0\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` is less than 0 or larger than 100.\n" + }, "kind": 12, - "tags": [1], + "label": "Int.toFixedWithPrecision", + "tags": [ 1 ] + }, + { + "deprecated": true, "detail": "(int, ~digits: int) => string", - "documentation": {"kind": "markdown", "value": "Deprecated: Use `toPrecision` instead\n\n\n`toPrecisionWithPrecision(n, ~digits)` return a `string` representing the giver value with\nprecision. `digits` specifies the number of significant digits. See [`Number.toPrecision`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toPrecision) on MDN.\n\n## Examples\n\n```rescript\nInt.toPrecisionWithPrecision(100, ~digits=2) // \"1.0e+2\"\nInt.toPrecisionWithPrecision(1, ~digits=2) // \"1.0\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` is not between 1 and 100 (inclusive).\n Implementations are allowed to support larger and smaller values as well.\n ECMA-262 only requires a precision of up to 21 significant digits.\n"} - }, { - "label": "Int.bitwiseAnd", + "documentation": { + "kind": "markdown", + "value": "Deprecated: Use `toPrecision` instead\n\n\n`toPrecisionWithPrecision(n, ~digits)` return a `string` representing the giver value with\nprecision. `digits` specifies the number of significant digits. See [`Number.toPrecision`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toPrecision) on MDN.\n\n## Examples\n\n```rescript\nInt.toPrecisionWithPrecision(100, ~digits=2) // \"1.0e+2\"\nInt.toPrecisionWithPrecision(1, ~digits=2) // \"1.0\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` is not between 1 and 100 (inclusive).\n Implementations are allowed to support larger and smaller values as well.\n ECMA-262 only requires a precision of up to 21 significant digits.\n" + }, "kind": 12, - "tags": [], + "label": "Int.toPrecisionWithPrecision", + "tags": [ 1 ] + }, + { "detail": "(int, int) => int", - "documentation": {"kind": "markdown", "value": "\n`bitwiseAnd(n1, n2)` calculates the bitwise AND of two integers.\n\n## Examples\n\n```rescript\nInt.bitwiseAnd(7, 4) == 4\n```\n"} - }, { - "label": "Int.shiftRight", + "documentation": { + "kind": "markdown", + "value": "\n`bitwiseAnd(n1, n2)` calculates the bitwise AND of two integers.\n\n## Examples\n\n```rescript\nInt.bitwiseAnd(7, 4) == 4\n```\n" + }, "kind": 12, - "tags": [], + "label": "Int.bitwiseAnd", + "tags": [] + }, + { "detail": "(int, int) => int", - "documentation": {"kind": "markdown", "value": "\n`shiftRight(n, length)` calculates the shifted value of an integer `n` by `length` bits to the right.\n\nAlso known as \"arithmetic right shift\" operation.\n\n## Examples\n\n```rescript\nInt.shiftRight(8, 1) == 4\n```\n"} - }, { - "label": "Int.compare", + "documentation": { + "kind": "markdown", + "value": "\n`shiftRight(n, length)` calculates the shifted value of an integer `n` by `length` bits to the right.\n\nAlso known as \"arithmetic right shift\" operation.\n\n## Examples\n\n```rescript\nInt.shiftRight(8, 1) == 4\n```\n" + }, "kind": 12, - "tags": [], + "label": "Int.shiftRight", + "tags": [] + }, + { "detail": "(int, int) => Ordering.t", - "documentation": null - }, { - "label": "Int.ignore", "kind": 12, - "tags": [], + "label": "Int.compare", + "tags": [] + }, + { "detail": "int => unit", - "documentation": {"kind": "markdown", "value": "\n `ignore(int)` ignores the provided int and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further.\n"} - }, { - "label": "Int.bitwiseOr", + "documentation": { + "kind": "markdown", + "value": "\n `ignore(int)` ignores the provided int and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further.\n" + }, "kind": 12, - "tags": [], + "label": "Int.ignore", + "tags": [] + }, + { "detail": "(int, int) => int", - "documentation": {"kind": "markdown", "value": "\n`bitwiseOr(n1, n2)` calculates the bitwise OR of two integers.\n\n## Examples\n\n```rescript\nInt.bitwiseOr(7, 4) == 7\n```\n"} - }, { - "label": "Int.toPrecision", + "documentation": { + "kind": "markdown", + "value": "\n`bitwiseOr(n1, n2)` calculates the bitwise OR of two integers.\n\n## Examples\n\n```rescript\nInt.bitwiseOr(7, 4) == 7\n```\n" + }, "kind": 12, - "tags": [], + "label": "Int.bitwiseOr", + "tags": [] + }, + { "detail": "(int, ~digits: int=?) => string", - "documentation": {"kind": "markdown", "value": "\n`toPrecision(n, ~digits=?)` return a `string` representing the giver value with\nprecision. `digits` specifies the number of significant digits. See [`Number.toPrecision`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toPrecision) on MDN.\n\n## Examples\n\n```rescript\nInt.toPrecision(100) // \"100\"\nInt.toPrecision(1) // \"1\"\nInt.toPrecision(100, ~digits=2) // \"1.0e+2\"\nInt.toPrecision(1, ~digits=2) // \"1.0\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` is not between 1 and 100 (inclusive).\n Implementations are allowed to support larger and smaller values as well.\n ECMA-262 only requires a precision of up to 21 significant digits.\n"} - }, { - "label": "Int.range", + "documentation": { + "kind": "markdown", + "value": "\n`toPrecision(n, ~digits=?)` return a `string` representing the giver value with\nprecision. `digits` specifies the number of significant digits. See [`Number.toPrecision`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toPrecision) on MDN.\n\n## Examples\n\n```rescript\nInt.toPrecision(100) // \"100\"\nInt.toPrecision(1) // \"1\"\nInt.toPrecision(100, ~digits=2) // \"1.0e+2\"\nInt.toPrecision(1, ~digits=2) // \"1.0\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` is not between 1 and 100 (inclusive).\n Implementations are allowed to support larger and smaller values as well.\n ECMA-262 only requires a precision of up to 21 significant digits.\n" + }, "kind": 12, - "tags": [], + "label": "Int.toPrecision", + "tags": [] + }, + { "detail": "(int, int, ~options: rangeOptions=?) => array", - "documentation": {"kind": "markdown", "value": "\n`range(start, end, ~options=?)` returns an int array of the sequence of integers in the\nrange `[start, end)`. That is, including `start` but excluding `end`.\n\nIf `step` is not set and `start < end`, the sequence will be increasing in steps of 1.\n\nIf `step` is not set and `start > end`, the sequence will be decreasing in steps of -1.\n\nIf `step` is set, the sequence will increase or decrease by that amount for each\nstep. If `start < end` and `step` is negative, or vice versa, an empty array is\nreturned since the sequence would otherwise never reach or exceed the end value\nand hence be infinite. If `step` is `0` and `start !=` end, a `RangeError` is\nthrown as the sequence would never reach or exceed the end value and hence be\ninfinite.\n\nIf `inclusive` is set to `true`, the sequence will include `end` if `step` is\nset such that the sequence includes it.\n\n## Examples\n\n```rescript\nInt.range(3, 6) == [3, 4, 5]\nInt.range(-3, -1) == [-3, -2]\nInt.range(3, 1) == [3, 2]\nInt.range(3, 7, ~options={step: 2}) == [3, 5]\nInt.range(3, 7, ~options={step: 2, inclusive: true}) == [3, 5, 7]\nInt.range(3, 6, ~options={step: -2}) // RangeError\n```\n\n## Exceptions\n\n- Raises `RangeError` if `step == 0 && start != end`.\n"} - }, { - "label": "Int.toString", + "documentation": { + "kind": "markdown", + "value": "\n`range(start, end, ~options=?)` returns an int array of the sequence of integers in the\nrange `[start, end)`. That is, including `start` but excluding `end`.\n\nIf `step` is not set and `start < end`, the sequence will be increasing in steps of 1.\n\nIf `step` is not set and `start > end`, the sequence will be decreasing in steps of -1.\n\nIf `step` is set, the sequence will increase or decrease by that amount for each\nstep. If `start < end` and `step` is negative, or vice versa, an empty array is\nreturned since the sequence would otherwise never reach or exceed the end value\nand hence be infinite. If `step` is `0` and `start !=` end, a `RangeError` is\nthrown as the sequence would never reach or exceed the end value and hence be\ninfinite.\n\nIf `inclusive` is set to `true`, the sequence will include `end` if `step` is\nset such that the sequence includes it.\n\n## Examples\n\n```rescript\nInt.range(3, 6) == [3, 4, 5]\nInt.range(-3, -1) == [-3, -2]\nInt.range(3, 1) == [3, 2]\nInt.range(3, 7, ~options={step: 2}) == [3, 5]\nInt.range(3, 7, ~options={step: 2, inclusive: true}) == [3, 5, 7]\nInt.range(3, 6, ~options={step: -2}) // RangeError\n```\n\n## Exceptions\n\n- Raises `RangeError` if `step == 0 && start != end`.\n" + }, "kind": 12, - "tags": [], + "label": "Int.range", + "tags": [] + }, + { "detail": "(int, ~radix: int=?) => string", - "documentation": {"kind": "markdown", "value": "\n`toString(n, ~radix=?)` return a `string` representing the given value.\n`~radix` specifies the radix base to use for the formatted number.\nSee [`Number.toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toString)\non MDN.\n\n## Examples\n\n```rescript\nInt.toString(1000) // \"1000\"\nInt.toString(-1000) // \"-1000\"\nInt.toString(6, ~radix=2) // \"110\"\nInt.toString(373592855, ~radix=16) // \"16449317\"\nInt.toString(123456, ~radix=36) // \"2n9c\"\n```\n\n## Exceptions\n\n`RangeError`: if `radix` is less than 2 or greater than 36.\n"} - }, { - "label": "Int.shiftLeft", + "documentation": { + "kind": "markdown", + "value": "\n`toString(n, ~radix=?)` return a `string` representing the given value.\n`~radix` specifies the radix base to use for the formatted number.\nSee [`Number.toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toString)\non MDN.\n\n## Examples\n\n```rescript\nInt.toString(1000) // \"1000\"\nInt.toString(-1000) // \"-1000\"\nInt.toString(6, ~radix=2) // \"110\"\nInt.toString(373592855, ~radix=16) // \"16449317\"\nInt.toString(123456, ~radix=36) // \"2n9c\"\n```\n\n## Exceptions\n\n`RangeError`: if `radix` is less than 2 or greater than 36.\n" + }, "kind": 12, - "tags": [], + "label": "Int.toString", + "tags": [] + }, + { "detail": "(int, int) => int", - "documentation": {"kind": "markdown", "value": "\n`shiftLeft(n, length)` calculates the shifted value of an integer `n` by `length` bits to the left.\n\n## Examples\n\n```rescript\nInt.shiftLeft(4, 1) == 8\n```\n"} - }, { - "label": "Int.toFloat", + "documentation": { + "kind": "markdown", + "value": "\n`shiftLeft(n, length)` calculates the shifted value of an integer `n` by `length` bits to the left.\n\n## Examples\n\n```rescript\nInt.shiftLeft(4, 1) == 8\n```\n" + }, "kind": 12, - "tags": [], + "label": "Int.shiftLeft", + "tags": [] + }, + { "detail": "int => float", - "documentation": {"kind": "markdown", "value": "\n`toFloat(n)` return a `float` representing the given value.\n\n## Examples\n\n```rescript\nInt.toFloat(100) == 100.0\nInt.toFloat(2) == 2.0\n```\n"} - }, { - "label": "Int.mod", + "documentation": { + "kind": "markdown", + "value": "\n`toFloat(n)` return a `float` representing the given value.\n\n## Examples\n\n```rescript\nInt.toFloat(100) == 100.0\nInt.toFloat(2) == 2.0\n```\n" + }, "kind": 12, - "tags": [], + "label": "Int.toFloat", + "tags": [] + }, + { "detail": "(int, int) => int", - "documentation": {"kind": "markdown", "value": "\n`mod(n1, n2)` calculates the modulo (remainder after division) of two integers.\n\n## Examples\n\n```rescript\nInt.mod(7, 4) == 3\n```\n"} - }, { - "label": "Int.rangeWithOptions", + "documentation": { + "kind": "markdown", + "value": "\n`mod(n1, n2)` calculates the modulo (remainder after division) of two integers.\n\n## Examples\n\n```rescript\nInt.mod(7, 4) == 3\n```\n" + }, "kind": 12, - "tags": [1], + "label": "Int.mod", + "tags": [] + }, + { + "deprecated": true, "detail": "(int, int, rangeOptions) => array", - "documentation": {"kind": "markdown", "value": "Deprecated: Use `range` instead\n\n\n`rangeWithOptions(start, end, options)` is like `range`, but with `step` and\n`inclusive` options configurable.\n\nIf `step` is set, the sequence will increase or decrease by that amount for each\nstep. If `start < end` and `step` is negative, or vice versa, an empty array is\nreturned since the sequence would otherwise never reach or exceed the end value\nand hence be infinite. If `step` is `0` and `start !=` end, a `RangeError` is\nraised as the sequence would never reach or exceed the end value and hence be\ninfinite.\n\nIf `inclusive` is set to `true`, the sequence will include `end` if `step` is\nset such that the sequence includes it.\n\n## Examples\n\n```rescript\nInt.rangeWithOptions(3, 7, {step: 2}) == [3, 5]\nInt.rangeWithOptions(3, 7, {step: 2, inclusive: true}) == [3, 5, 7]\nInt.rangeWithOptions(3, 6, {step: -2}) // RangeError\n```\n\n## Exceptions\n\n- Raises `RangeError` if `step == 0 && start != end`.\n"} - }, { - "label": "Int.shiftRightUnsigned", + "documentation": { + "kind": "markdown", + "value": "Deprecated: Use `range` instead\n\n\n`rangeWithOptions(start, end, options)` is like `range`, but with `step` and\n`inclusive` options configurable.\n\nIf `step` is set, the sequence will increase or decrease by that amount for each\nstep. If `start < end` and `step` is negative, or vice versa, an empty array is\nreturned since the sequence would otherwise never reach or exceed the end value\nand hence be infinite. If `step` is `0` and `start !=` end, a `RangeError` is\nraised as the sequence would never reach or exceed the end value and hence be\ninfinite.\n\nIf `inclusive` is set to `true`, the sequence will include `end` if `step` is\nset such that the sequence includes it.\n\n## Examples\n\n```rescript\nInt.rangeWithOptions(3, 7, {step: 2}) == [3, 5]\nInt.rangeWithOptions(3, 7, {step: 2, inclusive: true}) == [3, 5, 7]\nInt.rangeWithOptions(3, 6, {step: -2}) // RangeError\n```\n\n## Exceptions\n\n- Raises `RangeError` if `step == 0 && start != end`.\n" + }, "kind": 12, - "tags": [], + "label": "Int.rangeWithOptions", + "tags": [ 1 ] + }, + { "detail": "(int, int) => int", - "documentation": {"kind": "markdown", "value": "\n`shiftRightUnsigned(n, length)` calculates the shifted value of an integer `n` by `length` bits to the right.\nExcess bits shifted off to the right are discarded, and zero bits are shifted in from the left.\n\nAlso known as \"zero-filling right shift\" operation.\n\n## Examples\n\n```rescript\nInt.shiftRightUnsigned(4, 1) == 2\n```\n"} - }, { - "label": "Int.toLocaleString", + "documentation": { + "kind": "markdown", + "value": "\n`shiftRightUnsigned(n, length)` calculates the shifted value of an integer `n` by `length` bits to the right.\nExcess bits shifted off to the right are discarded, and zero bits are shifted in from the left.\n\nAlso known as \"zero-filling right shift\" operation.\n\n## Examples\n\n```rescript\nInt.shiftRightUnsigned(4, 1) == 2\n```\n" + }, "kind": 12, - "tags": [], + "label": "Int.shiftRightUnsigned", + "tags": [] + }, + { "detail": "int => string", - "documentation": {"kind": "markdown", "value": "\n`toLocaleString(n)` return a `string` with language-sensitive representing the\ngiven value. See [`Number.toLocaleString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toLocaleString) on MDN.\n\n## Examples\n\n```rescript\n// If the application uses English as the default language\nInt.toLocaleString(1000) // \"1,000\"\n\n// If the application uses Portuguese Brazil as the default language\nInt.toLocaleString(1000) // \"1.000\"\n```\n"} - }, { - "label": "Int.bitwiseNot", + "documentation": { + "kind": "markdown", + "value": "\n`toLocaleString(n)` return a `string` with language-sensitive representing the\ngiven value. See [`Number.toLocaleString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toLocaleString) on MDN.\n\n## Examples\n\n```rescript\n// If the application uses English as the default language\nInt.toLocaleString(1000) // \"1,000\"\n\n// If the application uses Portuguese Brazil as the default language\nInt.toLocaleString(1000) // \"1.000\"\n```\n" + }, "kind": 12, - "tags": [], + "label": "Int.toLocaleString", + "tags": [] + }, + { "detail": "int => int", - "documentation": {"kind": "markdown", "value": "\n`bitwiseNot(n)` calculates the bitwise NOT of an integer.\n\n## Examples\n\n```rescript\nInt.bitwiseNot(2) == -3\n```\n"} - }, { - "label": "Int.toExponential", + "documentation": { + "kind": "markdown", + "value": "\n`bitwiseNot(n)` calculates the bitwise NOT of an integer.\n\n## Examples\n\n```rescript\nInt.bitwiseNot(2) == -3\n```\n" + }, "kind": 12, - "tags": [], + "label": "Int.bitwiseNot", + "tags": [] + }, + { "detail": "(int, ~digits: int=?) => string", - "documentation": {"kind": "markdown", "value": "\n`toExponential(n, ~digits=?)` return a `string` representing the given value in\nexponential notation. `digits` specifies how many digits should appear after\nthe decimal point. See [`Number.toExponential`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toExponential)\n\n## Examples\n\n```rescript\nInt.toExponential(1000) // \"1e+3\"\nInt.toExponential(-1000) // \"-1e+3\"\nInt.toExponential(77, ~digits=2) // \"7.70e+1\"\nInt.toExponential(5678, ~digits=2) // \"5.68e+3\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` less than 0 or greater than 10.\n"} - }, { - "label": "Int.toFixed", + "documentation": { + "kind": "markdown", + "value": "\n`toExponential(n, ~digits=?)` return a `string` representing the given value in\nexponential notation. `digits` specifies how many digits should appear after\nthe decimal point. See [`Number.toExponential`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toExponential)\n\n## Examples\n\n```rescript\nInt.toExponential(1000) // \"1e+3\"\nInt.toExponential(-1000) // \"-1e+3\"\nInt.toExponential(77, ~digits=2) // \"7.70e+1\"\nInt.toExponential(5678, ~digits=2) // \"5.68e+3\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` less than 0 or greater than 10.\n" + }, "kind": 12, - "tags": [], + "label": "Int.toExponential", + "tags": [] + }, + { "detail": "(int, ~digits: int=?) => string", - "documentation": {"kind": "markdown", "value": "\n`toFixed(n, ~digits=?)` return a `string` representing the given\nvalue using fixed-point notation. `digits` specifies how many digits should\nappear after the decimal point. See [`Number.toFixed`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toFixed)\non MDN.\n\n## Examples\n\n```rescript\nInt.toFixed(123456) // \"123456.00\"\nInt.toFixed(10) // \"10.00\"\nInt.toFixed(300, ~digits=4) // \"300.0000\"\nInt.toFixed(300, ~digits=1) // \"300.0\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` is less than 0 or larger than 100.\n"} - }] + "documentation": { + "kind": "markdown", + "value": "\n`toFixed(n, ~digits=?)` return a `string` representing the given\nvalue using fixed-point notation. `digits` specifies how many digits should\nappear after the decimal point. See [`Number.toFixed`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toFixed)\non MDN.\n\n## Examples\n\n```rescript\nInt.toFixed(123456) // \"123456.00\"\nInt.toFixed(10) // \"10.00\"\nInt.toFixed(300, ~digits=4) // \"300.0000\"\nInt.toFixed(300, ~digits=1) // \"300.0\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` is less than 0 or larger than 100.\n" + }, + "kind": 12, + "label": "Int.toFixed", + "tags": [] + } +] Complete src/CompletionJsx.res 26:14 posCursor:[26:14] posNoWhite:[26:13] Found expr:[8:13->33:3] @@ -364,159 +523,257 @@ ContextPath int-> <> ContextPath int Path Stdlib.Int. Path -[{ - "label": "React.int", - "kind": 12, - "tags": [], +[ + { "detail": "int", - "documentation": {"kind": "markdown", "value": "Turns `int` into a JSX element so it can be used inside of JSX."}, - "sortText": "A", - "insertTextFormat": 2 - }, { - "label": "Int.equal", + "documentation": { + "kind": "markdown", + "value": "Turns `int` into a JSX element so it can be used inside of JSX." + }, + "insertTextFormat": 2, "kind": 12, - "tags": [], + "label": "React.int", + "sortText": "A", + "tags": [] + }, + { "detail": "(int, int) => bool", - "documentation": null - }, { - "label": "Int.toStringWithRadix", "kind": 12, - "tags": [1], + "label": "Int.equal", + "tags": [] + }, + { + "deprecated": true, "detail": "(int, ~radix: int) => string", - "documentation": {"kind": "markdown", "value": "Deprecated: Use `toString` instead\n\n\n`toStringWithRadix(n, ~radix)` return a `string` representing the given value.\n`~radix` specifies the radix base to use for the formatted number.\nSee [`Number.toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toString)\non MDN.\n\n## Examples\n\n```rescript\nInt.toStringWithRadix(6, ~radix=2) // \"110\"\nInt.toStringWithRadix(373592855, ~radix=16) // \"16449317\"\nInt.toStringWithRadix(123456, ~radix=36) // \"2n9c\"\n```\n\n## Exceptions\n\n`RangeError`: if `radix` is less than 2 or greater than 36.\n"} - }, { - "label": "Int.toExponentialWithPrecision", + "documentation": { + "kind": "markdown", + "value": "Deprecated: Use `toString` instead\n\n\n`toStringWithRadix(n, ~radix)` return a `string` representing the given value.\n`~radix` specifies the radix base to use for the formatted number.\nSee [`Number.toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toString)\non MDN.\n\n## Examples\n\n```rescript\nInt.toStringWithRadix(6, ~radix=2) // \"110\"\nInt.toStringWithRadix(373592855, ~radix=16) // \"16449317\"\nInt.toStringWithRadix(123456, ~radix=36) // \"2n9c\"\n```\n\n## Exceptions\n\n`RangeError`: if `radix` is less than 2 or greater than 36.\n" + }, "kind": 12, - "tags": [1], + "label": "Int.toStringWithRadix", + "tags": [ 1 ] + }, + { + "deprecated": true, "detail": "(int, ~digits: int) => string", - "documentation": {"kind": "markdown", "value": "Deprecated: Use `toExponential` instead\n\n\n`toExponential(n, ~digits)` return a `string` representing the given value in\nexponential notation. `digits` specifies how many digits should appear after\nthe decimal point. See [`Number.toExponential`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toExponential)\non MDN.\n\n## Examples\n\n```rescript\nInt.toExponentialWithPrecision(77, ~digits=2) // \"7.70e+1\"\nInt.toExponentialWithPrecision(5678, ~digits=2) // \"5.68e+3\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` less than 0 or greater than 10.\n"} - }, { - "label": "Int.bitwiseXor", + "documentation": { + "kind": "markdown", + "value": "Deprecated: Use `toExponential` instead\n\n\n`toExponential(n, ~digits)` return a `string` representing the given value in\nexponential notation. `digits` specifies how many digits should appear after\nthe decimal point. See [`Number.toExponential`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toExponential)\non MDN.\n\n## Examples\n\n```rescript\nInt.toExponentialWithPrecision(77, ~digits=2) // \"7.70e+1\"\nInt.toExponentialWithPrecision(5678, ~digits=2) // \"5.68e+3\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` less than 0 or greater than 10.\n" + }, "kind": 12, - "tags": [], + "label": "Int.toExponentialWithPrecision", + "tags": [ 1 ] + }, + { "detail": "(int, int) => int", - "documentation": {"kind": "markdown", "value": "\n`bigwiseXor(n1, n2)` calculates the bitwise XOR of two integers.\n\n## Examples\n\n```rescript\nInt.bitwiseXor(7, 4) == 3\n```\n"} - }, { - "label": "Int.clamp", + "documentation": { + "kind": "markdown", + "value": "\n`bigwiseXor(n1, n2)` calculates the bitwise XOR of two integers.\n\n## Examples\n\n```rescript\nInt.bitwiseXor(7, 4) == 3\n```\n" + }, "kind": 12, - "tags": [], + "label": "Int.bitwiseXor", + "tags": [] + }, + { "detail": "(~min: int=?, ~max: int=?, int) => int", - "documentation": {"kind": "markdown", "value": "\n`clamp(~min=?, ~max=?, value)` returns `value`, optionally bounded by `min` and `max`.\n\nif `max` \\< `min` returns `min`.\n\n## Examples\n\n```rescript\nInt.clamp(42) == 42\nInt.clamp(42, ~min=50) == 50\nInt.clamp(42, ~max=40) == 40\nInt.clamp(42, ~min=50, ~max=40) == 50\n```\n"} - }, { - "label": "Int.toFixedWithPrecision", + "documentation": { + "kind": "markdown", + "value": "\n`clamp(~min=?, ~max=?, value)` returns `value`, optionally bounded by `min` and `max`.\n\nif `max` \\< `min` returns `min`.\n\n## Examples\n\n```rescript\nInt.clamp(42) == 42\nInt.clamp(42, ~min=50) == 50\nInt.clamp(42, ~max=40) == 40\nInt.clamp(42, ~min=50, ~max=40) == 50\n```\n" + }, "kind": 12, - "tags": [1], + "label": "Int.clamp", + "tags": [] + }, + { + "deprecated": true, "detail": "(int, ~digits: int) => string", - "documentation": {"kind": "markdown", "value": "Deprecated: Use `toFixed` instead\n\n\n`toFixedWithPrecision(n, ~digits)` return a `string` representing the given\nvalue using fixed-point notation. `digits` specifies how many digits should\nappear after the decimal point. See [`Number.toFixed`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toFixed)\non MDN.\n\n## Examples\n\n```rescript\nInt.toFixedWithPrecision(300, ~digits=4) // \"300.0000\"\nInt.toFixedWithPrecision(300, ~digits=1) // \"300.0\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` is less than 0 or larger than 100.\n"} - }, { - "label": "Int.toPrecisionWithPrecision", + "documentation": { + "kind": "markdown", + "value": "Deprecated: Use `toFixed` instead\n\n\n`toFixedWithPrecision(n, ~digits)` return a `string` representing the given\nvalue using fixed-point notation. `digits` specifies how many digits should\nappear after the decimal point. See [`Number.toFixed`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toFixed)\non MDN.\n\n## Examples\n\n```rescript\nInt.toFixedWithPrecision(300, ~digits=4) // \"300.0000\"\nInt.toFixedWithPrecision(300, ~digits=1) // \"300.0\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` is less than 0 or larger than 100.\n" + }, "kind": 12, - "tags": [1], + "label": "Int.toFixedWithPrecision", + "tags": [ 1 ] + }, + { + "deprecated": true, "detail": "(int, ~digits: int) => string", - "documentation": {"kind": "markdown", "value": "Deprecated: Use `toPrecision` instead\n\n\n`toPrecisionWithPrecision(n, ~digits)` return a `string` representing the giver value with\nprecision. `digits` specifies the number of significant digits. See [`Number.toPrecision`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toPrecision) on MDN.\n\n## Examples\n\n```rescript\nInt.toPrecisionWithPrecision(100, ~digits=2) // \"1.0e+2\"\nInt.toPrecisionWithPrecision(1, ~digits=2) // \"1.0\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` is not between 1 and 100 (inclusive).\n Implementations are allowed to support larger and smaller values as well.\n ECMA-262 only requires a precision of up to 21 significant digits.\n"} - }, { - "label": "Int.bitwiseAnd", + "documentation": { + "kind": "markdown", + "value": "Deprecated: Use `toPrecision` instead\n\n\n`toPrecisionWithPrecision(n, ~digits)` return a `string` representing the giver value with\nprecision. `digits` specifies the number of significant digits. See [`Number.toPrecision`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toPrecision) on MDN.\n\n## Examples\n\n```rescript\nInt.toPrecisionWithPrecision(100, ~digits=2) // \"1.0e+2\"\nInt.toPrecisionWithPrecision(1, ~digits=2) // \"1.0\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` is not between 1 and 100 (inclusive).\n Implementations are allowed to support larger and smaller values as well.\n ECMA-262 only requires a precision of up to 21 significant digits.\n" + }, "kind": 12, - "tags": [], + "label": "Int.toPrecisionWithPrecision", + "tags": [ 1 ] + }, + { "detail": "(int, int) => int", - "documentation": {"kind": "markdown", "value": "\n`bitwiseAnd(n1, n2)` calculates the bitwise AND of two integers.\n\n## Examples\n\n```rescript\nInt.bitwiseAnd(7, 4) == 4\n```\n"} - }, { - "label": "Int.shiftRight", + "documentation": { + "kind": "markdown", + "value": "\n`bitwiseAnd(n1, n2)` calculates the bitwise AND of two integers.\n\n## Examples\n\n```rescript\nInt.bitwiseAnd(7, 4) == 4\n```\n" + }, "kind": 12, - "tags": [], + "label": "Int.bitwiseAnd", + "tags": [] + }, + { "detail": "(int, int) => int", - "documentation": {"kind": "markdown", "value": "\n`shiftRight(n, length)` calculates the shifted value of an integer `n` by `length` bits to the right.\n\nAlso known as \"arithmetic right shift\" operation.\n\n## Examples\n\n```rescript\nInt.shiftRight(8, 1) == 4\n```\n"} - }, { - "label": "Int.compare", + "documentation": { + "kind": "markdown", + "value": "\n`shiftRight(n, length)` calculates the shifted value of an integer `n` by `length` bits to the right.\n\nAlso known as \"arithmetic right shift\" operation.\n\n## Examples\n\n```rescript\nInt.shiftRight(8, 1) == 4\n```\n" + }, "kind": 12, - "tags": [], + "label": "Int.shiftRight", + "tags": [] + }, + { "detail": "(int, int) => Ordering.t", - "documentation": null - }, { - "label": "Int.ignore", "kind": 12, - "tags": [], + "label": "Int.compare", + "tags": [] + }, + { "detail": "int => unit", - "documentation": {"kind": "markdown", "value": "\n `ignore(int)` ignores the provided int and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further.\n"} - }, { - "label": "Int.bitwiseOr", + "documentation": { + "kind": "markdown", + "value": "\n `ignore(int)` ignores the provided int and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further.\n" + }, "kind": 12, - "tags": [], + "label": "Int.ignore", + "tags": [] + }, + { "detail": "(int, int) => int", - "documentation": {"kind": "markdown", "value": "\n`bitwiseOr(n1, n2)` calculates the bitwise OR of two integers.\n\n## Examples\n\n```rescript\nInt.bitwiseOr(7, 4) == 7\n```\n"} - }, { - "label": "Int.toPrecision", + "documentation": { + "kind": "markdown", + "value": "\n`bitwiseOr(n1, n2)` calculates the bitwise OR of two integers.\n\n## Examples\n\n```rescript\nInt.bitwiseOr(7, 4) == 7\n```\n" + }, "kind": 12, - "tags": [], + "label": "Int.bitwiseOr", + "tags": [] + }, + { "detail": "(int, ~digits: int=?) => string", - "documentation": {"kind": "markdown", "value": "\n`toPrecision(n, ~digits=?)` return a `string` representing the giver value with\nprecision. `digits` specifies the number of significant digits. See [`Number.toPrecision`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toPrecision) on MDN.\n\n## Examples\n\n```rescript\nInt.toPrecision(100) // \"100\"\nInt.toPrecision(1) // \"1\"\nInt.toPrecision(100, ~digits=2) // \"1.0e+2\"\nInt.toPrecision(1, ~digits=2) // \"1.0\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` is not between 1 and 100 (inclusive).\n Implementations are allowed to support larger and smaller values as well.\n ECMA-262 only requires a precision of up to 21 significant digits.\n"} - }, { - "label": "Int.range", + "documentation": { + "kind": "markdown", + "value": "\n`toPrecision(n, ~digits=?)` return a `string` representing the giver value with\nprecision. `digits` specifies the number of significant digits. See [`Number.toPrecision`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toPrecision) on MDN.\n\n## Examples\n\n```rescript\nInt.toPrecision(100) // \"100\"\nInt.toPrecision(1) // \"1\"\nInt.toPrecision(100, ~digits=2) // \"1.0e+2\"\nInt.toPrecision(1, ~digits=2) // \"1.0\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` is not between 1 and 100 (inclusive).\n Implementations are allowed to support larger and smaller values as well.\n ECMA-262 only requires a precision of up to 21 significant digits.\n" + }, "kind": 12, - "tags": [], + "label": "Int.toPrecision", + "tags": [] + }, + { "detail": "(int, int, ~options: rangeOptions=?) => array", - "documentation": {"kind": "markdown", "value": "\n`range(start, end, ~options=?)` returns an int array of the sequence of integers in the\nrange `[start, end)`. That is, including `start` but excluding `end`.\n\nIf `step` is not set and `start < end`, the sequence will be increasing in steps of 1.\n\nIf `step` is not set and `start > end`, the sequence will be decreasing in steps of -1.\n\nIf `step` is set, the sequence will increase or decrease by that amount for each\nstep. If `start < end` and `step` is negative, or vice versa, an empty array is\nreturned since the sequence would otherwise never reach or exceed the end value\nand hence be infinite. If `step` is `0` and `start !=` end, a `RangeError` is\nthrown as the sequence would never reach or exceed the end value and hence be\ninfinite.\n\nIf `inclusive` is set to `true`, the sequence will include `end` if `step` is\nset such that the sequence includes it.\n\n## Examples\n\n```rescript\nInt.range(3, 6) == [3, 4, 5]\nInt.range(-3, -1) == [-3, -2]\nInt.range(3, 1) == [3, 2]\nInt.range(3, 7, ~options={step: 2}) == [3, 5]\nInt.range(3, 7, ~options={step: 2, inclusive: true}) == [3, 5, 7]\nInt.range(3, 6, ~options={step: -2}) // RangeError\n```\n\n## Exceptions\n\n- Raises `RangeError` if `step == 0 && start != end`.\n"} - }, { - "label": "Int.toString", + "documentation": { + "kind": "markdown", + "value": "\n`range(start, end, ~options=?)` returns an int array of the sequence of integers in the\nrange `[start, end)`. That is, including `start` but excluding `end`.\n\nIf `step` is not set and `start < end`, the sequence will be increasing in steps of 1.\n\nIf `step` is not set and `start > end`, the sequence will be decreasing in steps of -1.\n\nIf `step` is set, the sequence will increase or decrease by that amount for each\nstep. If `start < end` and `step` is negative, or vice versa, an empty array is\nreturned since the sequence would otherwise never reach or exceed the end value\nand hence be infinite. If `step` is `0` and `start !=` end, a `RangeError` is\nthrown as the sequence would never reach or exceed the end value and hence be\ninfinite.\n\nIf `inclusive` is set to `true`, the sequence will include `end` if `step` is\nset such that the sequence includes it.\n\n## Examples\n\n```rescript\nInt.range(3, 6) == [3, 4, 5]\nInt.range(-3, -1) == [-3, -2]\nInt.range(3, 1) == [3, 2]\nInt.range(3, 7, ~options={step: 2}) == [3, 5]\nInt.range(3, 7, ~options={step: 2, inclusive: true}) == [3, 5, 7]\nInt.range(3, 6, ~options={step: -2}) // RangeError\n```\n\n## Exceptions\n\n- Raises `RangeError` if `step == 0 && start != end`.\n" + }, "kind": 12, - "tags": [], + "label": "Int.range", + "tags": [] + }, + { "detail": "(int, ~radix: int=?) => string", - "documentation": {"kind": "markdown", "value": "\n`toString(n, ~radix=?)` return a `string` representing the given value.\n`~radix` specifies the radix base to use for the formatted number.\nSee [`Number.toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toString)\non MDN.\n\n## Examples\n\n```rescript\nInt.toString(1000) // \"1000\"\nInt.toString(-1000) // \"-1000\"\nInt.toString(6, ~radix=2) // \"110\"\nInt.toString(373592855, ~radix=16) // \"16449317\"\nInt.toString(123456, ~radix=36) // \"2n9c\"\n```\n\n## Exceptions\n\n`RangeError`: if `radix` is less than 2 or greater than 36.\n"} - }, { - "label": "Int.shiftLeft", + "documentation": { + "kind": "markdown", + "value": "\n`toString(n, ~radix=?)` return a `string` representing the given value.\n`~radix` specifies the radix base to use for the formatted number.\nSee [`Number.toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toString)\non MDN.\n\n## Examples\n\n```rescript\nInt.toString(1000) // \"1000\"\nInt.toString(-1000) // \"-1000\"\nInt.toString(6, ~radix=2) // \"110\"\nInt.toString(373592855, ~radix=16) // \"16449317\"\nInt.toString(123456, ~radix=36) // \"2n9c\"\n```\n\n## Exceptions\n\n`RangeError`: if `radix` is less than 2 or greater than 36.\n" + }, "kind": 12, - "tags": [], + "label": "Int.toString", + "tags": [] + }, + { "detail": "(int, int) => int", - "documentation": {"kind": "markdown", "value": "\n`shiftLeft(n, length)` calculates the shifted value of an integer `n` by `length` bits to the left.\n\n## Examples\n\n```rescript\nInt.shiftLeft(4, 1) == 8\n```\n"} - }, { - "label": "Int.toFloat", + "documentation": { + "kind": "markdown", + "value": "\n`shiftLeft(n, length)` calculates the shifted value of an integer `n` by `length` bits to the left.\n\n## Examples\n\n```rescript\nInt.shiftLeft(4, 1) == 8\n```\n" + }, "kind": 12, - "tags": [], + "label": "Int.shiftLeft", + "tags": [] + }, + { "detail": "int => float", - "documentation": {"kind": "markdown", "value": "\n`toFloat(n)` return a `float` representing the given value.\n\n## Examples\n\n```rescript\nInt.toFloat(100) == 100.0\nInt.toFloat(2) == 2.0\n```\n"} - }, { - "label": "Int.mod", + "documentation": { + "kind": "markdown", + "value": "\n`toFloat(n)` return a `float` representing the given value.\n\n## Examples\n\n```rescript\nInt.toFloat(100) == 100.0\nInt.toFloat(2) == 2.0\n```\n" + }, "kind": 12, - "tags": [], + "label": "Int.toFloat", + "tags": [] + }, + { "detail": "(int, int) => int", - "documentation": {"kind": "markdown", "value": "\n`mod(n1, n2)` calculates the modulo (remainder after division) of two integers.\n\n## Examples\n\n```rescript\nInt.mod(7, 4) == 3\n```\n"} - }, { - "label": "Int.rangeWithOptions", + "documentation": { + "kind": "markdown", + "value": "\n`mod(n1, n2)` calculates the modulo (remainder after division) of two integers.\n\n## Examples\n\n```rescript\nInt.mod(7, 4) == 3\n```\n" + }, "kind": 12, - "tags": [1], + "label": "Int.mod", + "tags": [] + }, + { + "deprecated": true, "detail": "(int, int, rangeOptions) => array", - "documentation": {"kind": "markdown", "value": "Deprecated: Use `range` instead\n\n\n`rangeWithOptions(start, end, options)` is like `range`, but with `step` and\n`inclusive` options configurable.\n\nIf `step` is set, the sequence will increase or decrease by that amount for each\nstep. If `start < end` and `step` is negative, or vice versa, an empty array is\nreturned since the sequence would otherwise never reach or exceed the end value\nand hence be infinite. If `step` is `0` and `start !=` end, a `RangeError` is\nraised as the sequence would never reach or exceed the end value and hence be\ninfinite.\n\nIf `inclusive` is set to `true`, the sequence will include `end` if `step` is\nset such that the sequence includes it.\n\n## Examples\n\n```rescript\nInt.rangeWithOptions(3, 7, {step: 2}) == [3, 5]\nInt.rangeWithOptions(3, 7, {step: 2, inclusive: true}) == [3, 5, 7]\nInt.rangeWithOptions(3, 6, {step: -2}) // RangeError\n```\n\n## Exceptions\n\n- Raises `RangeError` if `step == 0 && start != end`.\n"} - }, { - "label": "Int.shiftRightUnsigned", + "documentation": { + "kind": "markdown", + "value": "Deprecated: Use `range` instead\n\n\n`rangeWithOptions(start, end, options)` is like `range`, but with `step` and\n`inclusive` options configurable.\n\nIf `step` is set, the sequence will increase or decrease by that amount for each\nstep. If `start < end` and `step` is negative, or vice versa, an empty array is\nreturned since the sequence would otherwise never reach or exceed the end value\nand hence be infinite. If `step` is `0` and `start !=` end, a `RangeError` is\nraised as the sequence would never reach or exceed the end value and hence be\ninfinite.\n\nIf `inclusive` is set to `true`, the sequence will include `end` if `step` is\nset such that the sequence includes it.\n\n## Examples\n\n```rescript\nInt.rangeWithOptions(3, 7, {step: 2}) == [3, 5]\nInt.rangeWithOptions(3, 7, {step: 2, inclusive: true}) == [3, 5, 7]\nInt.rangeWithOptions(3, 6, {step: -2}) // RangeError\n```\n\n## Exceptions\n\n- Raises `RangeError` if `step == 0 && start != end`.\n" + }, "kind": 12, - "tags": [], + "label": "Int.rangeWithOptions", + "tags": [ 1 ] + }, + { "detail": "(int, int) => int", - "documentation": {"kind": "markdown", "value": "\n`shiftRightUnsigned(n, length)` calculates the shifted value of an integer `n` by `length` bits to the right.\nExcess bits shifted off to the right are discarded, and zero bits are shifted in from the left.\n\nAlso known as \"zero-filling right shift\" operation.\n\n## Examples\n\n```rescript\nInt.shiftRightUnsigned(4, 1) == 2\n```\n"} - }, { - "label": "Int.toLocaleString", + "documentation": { + "kind": "markdown", + "value": "\n`shiftRightUnsigned(n, length)` calculates the shifted value of an integer `n` by `length` bits to the right.\nExcess bits shifted off to the right are discarded, and zero bits are shifted in from the left.\n\nAlso known as \"zero-filling right shift\" operation.\n\n## Examples\n\n```rescript\nInt.shiftRightUnsigned(4, 1) == 2\n```\n" + }, "kind": 12, - "tags": [], + "label": "Int.shiftRightUnsigned", + "tags": [] + }, + { "detail": "int => string", - "documentation": {"kind": "markdown", "value": "\n`toLocaleString(n)` return a `string` with language-sensitive representing the\ngiven value. See [`Number.toLocaleString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toLocaleString) on MDN.\n\n## Examples\n\n```rescript\n// If the application uses English as the default language\nInt.toLocaleString(1000) // \"1,000\"\n\n// If the application uses Portuguese Brazil as the default language\nInt.toLocaleString(1000) // \"1.000\"\n```\n"} - }, { - "label": "Int.bitwiseNot", + "documentation": { + "kind": "markdown", + "value": "\n`toLocaleString(n)` return a `string` with language-sensitive representing the\ngiven value. See [`Number.toLocaleString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toLocaleString) on MDN.\n\n## Examples\n\n```rescript\n// If the application uses English as the default language\nInt.toLocaleString(1000) // \"1,000\"\n\n// If the application uses Portuguese Brazil as the default language\nInt.toLocaleString(1000) // \"1.000\"\n```\n" + }, "kind": 12, - "tags": [], + "label": "Int.toLocaleString", + "tags": [] + }, + { "detail": "int => int", - "documentation": {"kind": "markdown", "value": "\n`bitwiseNot(n)` calculates the bitwise NOT of an integer.\n\n## Examples\n\n```rescript\nInt.bitwiseNot(2) == -3\n```\n"} - }, { - "label": "Int.toExponential", + "documentation": { + "kind": "markdown", + "value": "\n`bitwiseNot(n)` calculates the bitwise NOT of an integer.\n\n## Examples\n\n```rescript\nInt.bitwiseNot(2) == -3\n```\n" + }, "kind": 12, - "tags": [], + "label": "Int.bitwiseNot", + "tags": [] + }, + { "detail": "(int, ~digits: int=?) => string", - "documentation": {"kind": "markdown", "value": "\n`toExponential(n, ~digits=?)` return a `string` representing the given value in\nexponential notation. `digits` specifies how many digits should appear after\nthe decimal point. See [`Number.toExponential`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toExponential)\n\n## Examples\n\n```rescript\nInt.toExponential(1000) // \"1e+3\"\nInt.toExponential(-1000) // \"-1e+3\"\nInt.toExponential(77, ~digits=2) // \"7.70e+1\"\nInt.toExponential(5678, ~digits=2) // \"5.68e+3\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` less than 0 or greater than 10.\n"} - }, { - "label": "Int.toFixed", + "documentation": { + "kind": "markdown", + "value": "\n`toExponential(n, ~digits=?)` return a `string` representing the given value in\nexponential notation. `digits` specifies how many digits should appear after\nthe decimal point. See [`Number.toExponential`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toExponential)\n\n## Examples\n\n```rescript\nInt.toExponential(1000) // \"1e+3\"\nInt.toExponential(-1000) // \"-1e+3\"\nInt.toExponential(77, ~digits=2) // \"7.70e+1\"\nInt.toExponential(5678, ~digits=2) // \"5.68e+3\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` less than 0 or greater than 10.\n" + }, "kind": 12, - "tags": [], + "label": "Int.toExponential", + "tags": [] + }, + { "detail": "(int, ~digits: int=?) => string", - "documentation": {"kind": "markdown", "value": "\n`toFixed(n, ~digits=?)` return a `string` representing the given\nvalue using fixed-point notation. `digits` specifies how many digits should\nappear after the decimal point. See [`Number.toFixed`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toFixed)\non MDN.\n\n## Examples\n\n```rescript\nInt.toFixed(123456) // \"123456.00\"\nInt.toFixed(10) // \"10.00\"\nInt.toFixed(300, ~digits=4) // \"300.0000\"\nInt.toFixed(300, ~digits=1) // \"300.0\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` is less than 0 or larger than 100.\n"} - }] + "documentation": { + "kind": "markdown", + "value": "\n`toFixed(n, ~digits=?)` return a `string` representing the given\nvalue using fixed-point notation. `digits` specifies how many digits should\nappear after the decimal point. See [`Number.toFixed`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toFixed)\non MDN.\n\n## Examples\n\n```rescript\nInt.toFixed(123456) // \"123456.00\"\nInt.toFixed(10) // \"10.00\"\nInt.toFixed(300, ~digits=4) // \"300.0000\"\nInt.toFixed(300, ~digits=1) // \"300.0\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` is less than 0 or larger than 100.\n" + }, + "kind": 12, + "label": "Int.toFixed", + "tags": [] + } +] Complete src/CompletionJsx.res 28:20 posCursor:[28:20] posNoWhite:[28:19] Found expr:[8:13->33:3] @@ -536,27 +793,40 @@ Path someArr Path Stdlib.Array.a Path ArrayUtils.a Path a -[{ - "label": "React.array", - "kind": 12, - "tags": [], +[ + { "detail": "array", - "documentation": {"kind": "markdown", "value": "Turns `array` into a JSX element so it can be used inside of JSX."}, - "sortText": "A", - "insertTextFormat": 2 - }, { - "label": "Array.at", + "documentation": { + "kind": "markdown", + "value": "Turns `array` into a JSX element so it can be used inside of JSX." + }, + "insertTextFormat": 2, "kind": 12, - "tags": [], + "label": "React.array", + "sortText": "A", + "tags": [] + }, + { "detail": "(array<'a>, int) => option<'a>", - "documentation": {"kind": "markdown", "value": "\n`at(array, index)`\n\nGet an element by its index. Negative indices count backwards from the last item.\n\n## Examples\n\n```rescript\n[\"a\", \"b\", \"c\"]->Array.at(0) == Some(\"a\")\n[\"a\", \"b\", \"c\"]->Array.at(2) == Some(\"c\")\n[\"a\", \"b\", \"c\"]->Array.at(3) == None\n[\"a\", \"b\", \"c\"]->Array.at(-1) == Some(\"c\")\n[\"a\", \"b\", \"c\"]->Array.at(-3) == Some(\"a\")\n[\"a\", \"b\", \"c\"]->Array.at(-4) == None\n```\n"} - }, { - "label": "Array.asIterable", + "documentation": { + "kind": "markdown", + "value": "\n`at(array, index)`\n\nGet an element by its index. Negative indices count backwards from the last item.\n\n## Examples\n\n```rescript\n[\"a\", \"b\", \"c\"]->Array.at(0) == Some(\"a\")\n[\"a\", \"b\", \"c\"]->Array.at(2) == Some(\"c\")\n[\"a\", \"b\", \"c\"]->Array.at(3) == None\n[\"a\", \"b\", \"c\"]->Array.at(-1) == Some(\"c\")\n[\"a\", \"b\", \"c\"]->Array.at(-3) == Some(\"a\")\n[\"a\", \"b\", \"c\"]->Array.at(-4) == None\n```\n" + }, "kind": 12, - "tags": [], + "label": "Array.at", + "tags": [] + }, + { "detail": "array<'a> => Iterable.t<'a>", - "documentation": {"kind": "markdown", "value": "\n`asIterable(array)` views `array` as an `Iterable.t`.\n\nThis is useful when passing an array to APIs that consume iterables, such as\n`Array.from` or `for...of` in JavaScript.\n"} - }] + "documentation": { + "kind": "markdown", + "value": "\n`asIterable(array)` views `array` as an `Iterable.t`.\n\nThis is useful when passing an array to APIs that consume iterables, such as\n`Array.from` or `for...of` in JavaScript.\n" + }, + "kind": 12, + "label": "Array.asIterable", + "tags": [] + } +] Complete src/CompletionJsx.res 30:12 posCursor:[30:12] posNoWhite:[30:11] Found expr:[8:13->33:3] @@ -571,28 +841,42 @@ JSX 30:12] > _children:None Completable: ChtmlElement ", - "kind": 4, - "tags": [], +[ + { "detail": "Defines a dialog box or subwindow.", - "documentation": {"kind": "markdown", "value": "Defines a dialog box or subwindow."}, - "insertText": "dialog" - }, { - "label": "", + "documentation": { + "kind": "markdown", + "value": "Defines a dialog box or subwindow." + }, + "insertText": "dialog", "kind": 4, - "tags": [1], + "label": "", + "tags": [] + }, + { + "deprecated": true, "detail": "Defines a directory list. Use
    instead.", - "documentation": {"kind": "markdown", "value": "Deprecated: true\n\nDefines a directory list. Use
      instead."}, - "insertText": "dir" - }, { - "label": "
      ", + "documentation": { + "kind": "markdown", + "value": "Deprecated: true\n\nDefines a directory list. Use
        instead." + }, + "insertText": "dir", "kind": 4, - "tags": [], + "label": "", + "tags": [ 1 ] + }, + { "detail": "Specifies a division or a section in a document.", - "documentation": {"kind": "markdown", "value": "Specifies a division or a section in a document."}, - "insertText": "div" - }] + "documentation": { + "kind": "markdown", + "value": "Specifies a division or a section in a document." + }, + "insertText": "div", + "kind": 4, + "label": "
        ", + "tags": [] + } +] Complete src/CompletionJsx.res 45:23 posCursor:[45:23] posNoWhite:[45:22] Found expr:[45:3->45:23] @@ -601,13 +885,7 @@ Completable: Cjsx([CompWithoutJsxPpx], n, [n]) Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib Path CompWithoutJsxPpx.make -[{ - "label": "name", - "kind": 4, - "tags": [], - "detail": "string", - "documentation": null - }] +[ { "detail": "string", "kind": 4, "label": "name", "tags": [] } ] Complete src/CompletionJsx.res 48:27 posCursor:[48:27] posNoWhite:[48:26] Found expr:[48:3->48:28] @@ -617,16 +895,17 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath CJsxPropValue [SomeComponent] someProp Path SomeComponent.make -[{ - "label": "\"\"", - "kind": 12, - "tags": [], +[ + { "detail": "string", - "documentation": null, - "sortText": "A", "insertText": "{\"$0\"}", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 12, + "label": "\"\"", + "sortText": "A", + "tags": [] + } +] Complete src/CompletionJsx.res 51:11 posCursor:[51:11] posNoWhite:[51:10] Found expr:[51:3->51:11] @@ -636,13 +915,7 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib Path ReactDOM.domProps Path JsxDOM.domProps -[{ - "label": "hidden", - "kind": 4, - "tags": [], - "detail": "bool", - "documentation": null - }] +[ { "detail": "bool", "kind": 4, "label": "hidden", "tags": [] } ] Complete src/CompletionJsx.res 61:30 posCursor:[61:30] posNoWhite:[61:28] Found expr:[61:3->61:29] @@ -651,25 +924,11 @@ Completable: Cjsx([IntrinsicElementLowercase], "", []) Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib Path IntrinsicElementLowercase.make -[{ - "label": "name", - "kind": 4, - "tags": [], - "detail": "option", - "documentation": null - }, { - "label": "age", - "kind": 4, - "tags": [], - "detail": "option", - "documentation": null - }, { - "label": "key", - "kind": 4, - "tags": [], - "detail": "string", - "documentation": null - }] +[ + { "detail": "option", "kind": 4, "label": "name", "tags": [] }, + { "detail": "option", "kind": 4, "label": "age", "tags": [] }, + { "detail": "string", "kind": 4, "label": "key", "tags": [] } +] Complete src/CompletionJsx.res 73:36 posCursor:[73:36] posNoWhite:[73:35] Found expr:[73:3->73:41] @@ -679,23 +938,32 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath CJsxPropValue [MultiPropComp] time Path MultiPropComp.make -[{ - "label": "Now", - "kind": 4, - "tags": [], +[ + { "detail": "Now", - "documentation": {"kind": "markdown", "value": "```rescript\nNow\n```\n\n```rescript\ntype time = Now | Later\n```"}, + "documentation": { + "kind": "markdown", + "value": "```rescript\nNow\n```\n\n```rescript\ntype time = Now | Later\n```" + }, "insertText": "{Now}", - "insertTextFormat": 2 - }, { - "label": "Later", + "insertTextFormat": 2, "kind": 4, - "tags": [], + "label": "Now", + "tags": [] + }, + { "detail": "Later", - "documentation": {"kind": "markdown", "value": "```rescript\nLater\n```\n\n```rescript\ntype time = Now | Later\n```"}, + "documentation": { + "kind": "markdown", + "value": "```rescript\nLater\n```\n\n```rescript\ntype time = Now | Later\n```" + }, "insertText": "{Later}", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 4, + "label": "Later", + "tags": [] + } +] Complete src/CompletionJsx.res 76:36 posCursor:[76:36] posNoWhite:[76:35] Found expr:[76:3->76:40] @@ -705,23 +973,32 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath CJsxPropValue [MultiPropComp] time Path MultiPropComp.make -[{ - "label": "Now", - "kind": 4, - "tags": [], +[ + { "detail": "Now", - "documentation": {"kind": "markdown", "value": "```rescript\nNow\n```\n\n```rescript\ntype time = Now | Later\n```"}, + "documentation": { + "kind": "markdown", + "value": "```rescript\nNow\n```\n\n```rescript\ntype time = Now | Later\n```" + }, "insertText": "{Now}", - "insertTextFormat": 2 - }, { - "label": "Later", + "insertTextFormat": 2, "kind": 4, - "tags": [], + "label": "Now", + "tags": [] + }, + { "detail": "Later", - "documentation": {"kind": "markdown", "value": "```rescript\nLater\n```\n\n```rescript\ntype time = Now | Later\n```"}, + "documentation": { + "kind": "markdown", + "value": "```rescript\nLater\n```\n\n```rescript\ntype time = Now | Later\n```" + }, "insertText": "{Later}", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 4, + "label": "Later", + "tags": [] + } +] Complete src/CompletionJsx.res 79:28 posCursor:[79:28] posNoWhite:[79:27] Found expr:[79:3->79:32] @@ -731,23 +1008,32 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath CJsxPropValue [MultiPropComp] time Path MultiPropComp.make -[{ - "label": "Now", - "kind": 4, - "tags": [], +[ + { "detail": "Now", - "documentation": {"kind": "markdown", "value": "```rescript\nNow\n```\n\n```rescript\ntype time = Now | Later\n```"}, + "documentation": { + "kind": "markdown", + "value": "```rescript\nNow\n```\n\n```rescript\ntype time = Now | Later\n```" + }, "insertText": "{Now}", - "insertTextFormat": 2 - }, { - "label": "Later", + "insertTextFormat": 2, "kind": 4, - "tags": [], + "label": "Now", + "tags": [] + }, + { "detail": "Later", - "documentation": {"kind": "markdown", "value": "```rescript\nLater\n```\n\n```rescript\ntype time = Now | Later\n```"}, + "documentation": { + "kind": "markdown", + "value": "```rescript\nLater\n```\n\n```rescript\ntype time = Now | Later\n```" + }, "insertText": "{Later}", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 4, + "label": "Later", + "tags": [] + } +] Complete src/CompletionJsx.res 89:26 posCursor:[89:26] posNoWhite:[89:24] Found expr:[89:3->89:27] @@ -756,13 +1042,7 @@ Completable: Cjsx([Info], "", [_type]) Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib Path Info.make -[{ - "label": "key", - "kind": 4, - "tags": [], - "detail": "string", - "documentation": null - }] +[ { "detail": "string", "kind": 4, "label": "key", "tags": [] } ] Complete src/CompletionJsx.res 93:19 posCursor:[93:19] posNoWhite:[93:18] Found expr:[93:11->93:24] @@ -778,162 +1058,282 @@ ContextPath string->s <> ContextPath string Path Stdlib.String.s Path s -[{ - "label": "->React.string", - "kind": 12, - "tags": [], +[ + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 18, "line": 93 }, + "start": { "character": 17, "line": 93 } + } + } + ], "detail": "string", - "documentation": {"kind": "markdown", "value": "Turns `string` into a JSX element so it can be used inside of JSX."}, - "sortText": "A", + "documentation": { + "kind": "markdown", + "value": "Turns `string` into a JSX element so it can be used inside of JSX." + }, "insertText": "->React.string", "insertTextFormat": 2, - "additionalTextEdits": [{ - "range": {"start": {"line": 93, "character": 17}, "end": {"line": 93, "character": 18}}, - "newText": "" - }] - }, { - "label": "->String.searchOpt", "kind": 12, - "tags": [], + "label": "->React.string", + "sortText": "A", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 18, "line": 93 }, + "start": { "character": 17, "line": 93 } + } + } + ], "detail": "(string, RegExp.t) => option", - "documentation": {"kind": "markdown", "value": "\n`searchOpt(str, regexp)`. Like `search`, but return an `option`.\n\n## Examples\n\n```rescript\nString.searchOpt(\"testing 1 2 3\", /\\d+/) == Some(8)\nString.searchOpt(\"no numbers\", /\\d+/) == None\n```\n"}, - "sortText": "searchOpt", + "documentation": { + "kind": "markdown", + "value": "\n`searchOpt(str, regexp)`. Like `search`, but return an `option`.\n\n## Examples\n\n```rescript\nString.searchOpt(\"testing 1 2 3\", /\\d+/) == Some(8)\nString.searchOpt(\"no numbers\", /\\d+/) == None\n```\n" + }, "insertText": "->String.searchOpt", - "additionalTextEdits": [{ - "range": {"start": {"line": 93, "character": 17}, "end": {"line": 93, "character": 18}}, - "newText": "" - }] - }, { - "label": "->String.splitByRegExpAtMost", "kind": 12, - "tags": [], + "label": "->String.searchOpt", + "sortText": "searchOpt", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 18, "line": 93 }, + "start": { "character": 17, "line": 93 } + } + } + ], "detail": "(string, RegExp.t, ~limit: int) => array>", - "documentation": {"kind": "markdown", "value": "\n`splitByRegExpAtMost(str, regexp, ~limit)` splits the given `str` at every\noccurrence of `regexp` and returns an array of the first `limit` resulting\nsubstrings. If `limit` is negative or greater than the number of substrings, the\narray will contain all the substrings.\nSee [`String.split`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/split) on MDN.\n\n## Examples\n\n```rescript\nString.splitByRegExpAtMost(\"Hello World. How are you doing?\", / /, ~limit=3) == [\n Some(\"Hello\"),\n Some(\"World.\"),\n Some(\"How\"),\n ]\n```\n"}, - "sortText": "splitByRegExpAtMost", + "documentation": { + "kind": "markdown", + "value": "\n`splitByRegExpAtMost(str, regexp, ~limit)` splits the given `str` at every\noccurrence of `regexp` and returns an array of the first `limit` resulting\nsubstrings. If `limit` is negative or greater than the number of substrings, the\narray will contain all the substrings.\nSee [`String.split`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/split) on MDN.\n\n## Examples\n\n```rescript\nString.splitByRegExpAtMost(\"Hello World. How are you doing?\", / /, ~limit=3) == [\n Some(\"Hello\"),\n Some(\"World.\"),\n Some(\"How\"),\n ]\n```\n" + }, "insertText": "->String.splitByRegExpAtMost", - "additionalTextEdits": [{ - "range": {"start": {"line": 93, "character": 17}, "end": {"line": 93, "character": 18}}, - "newText": "" - }] - }, { - "label": "->String.slice", "kind": 12, - "tags": [], + "label": "->String.splitByRegExpAtMost", + "sortText": "splitByRegExpAtMost", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 18, "line": 93 }, + "start": { "character": 17, "line": 93 } + } + } + ], "detail": "(string, ~start: int, ~end: int=?) => string", - "documentation": {"kind": "markdown", "value": "\n`slice(str, ~start, ~end)` returns the substring of `str` starting at\ncharacter `start` up to but not including `end`.\n- If either `start` or `end` is negative, then it is evaluated as\n `length(str - start)` or `length(str - end)`.\n- If `end` is greater than the length of `str`, then it is treated as\n `length(str)`.\n- If `start` is greater than `end`, slice returns the empty string.\n See [`String.slice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/slice) on MDN.\n\n## Examples\n\n```rescript\nString.slice(\"abcdefg\", ~start=2, ~end=5) == \"cde\"\nString.slice(\"abcdefg\", ~start=2, ~end=9) == \"cdefg\"\nString.slice(\"abcdefg\", ~start=-4, ~end=-2) == \"de\"\nString.slice(\"abcdefg\", ~start=5, ~end=1) == \"\"\nString.slice(\"abcdefg\", ~start=2) == \"cdefg\"\nString.slice(\"Hello World\", ~start=6) == \"World\"\n```\n"}, - "sortText": "slice", + "documentation": { + "kind": "markdown", + "value": "\n`slice(str, ~start, ~end)` returns the substring of `str` starting at\ncharacter `start` up to but not including `end`.\n- If either `start` or `end` is negative, then it is evaluated as\n `length(str - start)` or `length(str - end)`.\n- If `end` is greater than the length of `str`, then it is treated as\n `length(str)`.\n- If `start` is greater than `end`, slice returns the empty string.\n See [`String.slice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/slice) on MDN.\n\n## Examples\n\n```rescript\nString.slice(\"abcdefg\", ~start=2, ~end=5) == \"cde\"\nString.slice(\"abcdefg\", ~start=2, ~end=9) == \"cdefg\"\nString.slice(\"abcdefg\", ~start=-4, ~end=-2) == \"de\"\nString.slice(\"abcdefg\", ~start=5, ~end=1) == \"\"\nString.slice(\"abcdefg\", ~start=2) == \"cdefg\"\nString.slice(\"Hello World\", ~start=6) == \"World\"\n```\n" + }, "insertText": "->String.slice", - "additionalTextEdits": [{ - "range": {"start": {"line": 93, "character": 17}, "end": {"line": 93, "character": 18}}, - "newText": "" - }] - }, { - "label": "->String.substringToEnd", "kind": 12, - "tags": [1], + "label": "->String.slice", + "sortText": "slice", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 18, "line": 93 }, + "start": { "character": 17, "line": 93 } + } + } + ], + "deprecated": true, "detail": "(string, ~start: int) => string", - "documentation": {"kind": "markdown", "value": "Deprecated: Use `substring` instead\n\n\n`substringToEnd(str, ~start)` returns the substring of `str` from position\n`start` to the end.\n- If `start` is less than or equal to zero, the entire string is returned.\n- If `start` is greater than or equal to the length of `str`, the empty string\n is returned.\n See [`String.substring`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/substring) on MDN.\n\n## Examples\n\n```rescript\nString.substringToEnd(\"playground\", ~start=4) == \"ground\"\nString.substringToEnd(\"playground\", ~start=-3) == \"playground\"\nString.substringToEnd(\"playground\", ~start=12) == \"\"\n```\n"}, - "sortText": "substringToEnd", + "documentation": { + "kind": "markdown", + "value": "Deprecated: Use `substring` instead\n\n\n`substringToEnd(str, ~start)` returns the substring of `str` from position\n`start` to the end.\n- If `start` is less than or equal to zero, the entire string is returned.\n- If `start` is greater than or equal to the length of `str`, the empty string\n is returned.\n See [`String.substring`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/substring) on MDN.\n\n## Examples\n\n```rescript\nString.substringToEnd(\"playground\", ~start=4) == \"ground\"\nString.substringToEnd(\"playground\", ~start=-3) == \"playground\"\nString.substringToEnd(\"playground\", ~start=12) == \"\"\n```\n" + }, "insertText": "->String.substringToEnd", - "additionalTextEdits": [{ - "range": {"start": {"line": 93, "character": 17}, "end": {"line": 93, "character": 18}}, - "newText": "" - }] - }, { - "label": "->String.startsWith", "kind": 12, - "tags": [], + "label": "->String.substringToEnd", + "sortText": "substringToEnd", + "tags": [ 1 ] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 18, "line": 93 }, + "start": { "character": 17, "line": 93 } + } + } + ], "detail": "(string, string) => bool", - "documentation": {"kind": "markdown", "value": "\n`startsWith(str, substr)` returns `true` if the `str` starts with `substr`,\n`false` otherwise.\nSee [`String.startsWith`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/startsWith) on MDN.\n\n## Examples\n\n```rescript\nString.startsWith(\"BuckleScript\", \"Buckle\") == true\nString.startsWith(\"BuckleScript\", \"\") == true\nString.startsWith(\"JavaScript\", \"Buckle\") == false\n```\n"}, - "sortText": "startsWith", + "documentation": { + "kind": "markdown", + "value": "\n`startsWith(str, substr)` returns `true` if the `str` starts with `substr`,\n`false` otherwise.\nSee [`String.startsWith`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/startsWith) on MDN.\n\n## Examples\n\n```rescript\nString.startsWith(\"BuckleScript\", \"Buckle\") == true\nString.startsWith(\"BuckleScript\", \"\") == true\nString.startsWith(\"JavaScript\", \"Buckle\") == false\n```\n" + }, "insertText": "->String.startsWith", - "additionalTextEdits": [{ - "range": {"start": {"line": 93, "character": 17}, "end": {"line": 93, "character": 18}}, - "newText": "" - }] - }, { - "label": "->String.splitAtMost", "kind": 12, - "tags": [], + "label": "->String.startsWith", + "sortText": "startsWith", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 18, "line": 93 }, + "start": { "character": 17, "line": 93 } + } + } + ], "detail": "(string, string, ~limit: int) => array", - "documentation": {"kind": "markdown", "value": "\n`splitAtMost(str, delimiter, ~limit)` splits the given `str` at every\noccurrence of `delimiter` and returns an array of the first `limit` resulting\nsubstrings. If `limit` is negative or greater than the number of substrings,\nthe array will contain all the substrings.\n\n## Examples\n\n```rescript\nString.splitAtMost(\"ant/bee/cat/dog/elk\", \"/\", ~limit=3) == [\"ant\", \"bee\", \"cat\"]\nString.splitAtMost(\"ant/bee/cat/dog/elk\", \"/\", ~limit=0) == []\nString.splitAtMost(\"ant/bee/cat/dog/elk\", \"/\", ~limit=9) == [\"ant\", \"bee\", \"cat\", \"dog\", \"elk\"]\n```\n"}, - "sortText": "splitAtMost", + "documentation": { + "kind": "markdown", + "value": "\n`splitAtMost(str, delimiter, ~limit)` splits the given `str` at every\noccurrence of `delimiter` and returns an array of the first `limit` resulting\nsubstrings. If `limit` is negative or greater than the number of substrings,\nthe array will contain all the substrings.\n\n## Examples\n\n```rescript\nString.splitAtMost(\"ant/bee/cat/dog/elk\", \"/\", ~limit=3) == [\"ant\", \"bee\", \"cat\"]\nString.splitAtMost(\"ant/bee/cat/dog/elk\", \"/\", ~limit=0) == []\nString.splitAtMost(\"ant/bee/cat/dog/elk\", \"/\", ~limit=9) == [\"ant\", \"bee\", \"cat\", \"dog\", \"elk\"]\n```\n" + }, "insertText": "->String.splitAtMost", - "additionalTextEdits": [{ - "range": {"start": {"line": 93, "character": 17}, "end": {"line": 93, "character": 18}}, - "newText": "" - }] - }, { - "label": "->String.sliceToEnd", "kind": 12, - "tags": [1], + "label": "->String.splitAtMost", + "sortText": "splitAtMost", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 18, "line": 93 }, + "start": { "character": 17, "line": 93 } + } + } + ], + "deprecated": true, "detail": "(string, ~start: int) => string", - "documentation": {"kind": "markdown", "value": "Deprecated: Use `slice` instead\n\n\n`sliceToEnd(str, ~start)` returns the substring of `str` starting at character\n`start` to the end of the string.\n- If `start` is negative, then it is evaluated as `length(str - start)`.\n- If `start` is greater than the length of `str`, then sliceToEnd returns the empty string.\n See [`String.slice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/slice) on MDN.\n\n## Examples\n\n```rescript\nString.sliceToEnd(\"abcdefg\", ~start=4) == \"efg\"\nString.sliceToEnd(\"abcdefg\", ~start=-2) == \"fg\"\nString.sliceToEnd(\"abcdefg\", ~start=7) == \"\"\n```\n"}, - "sortText": "sliceToEnd", + "documentation": { + "kind": "markdown", + "value": "Deprecated: Use `slice` instead\n\n\n`sliceToEnd(str, ~start)` returns the substring of `str` starting at character\n`start` to the end of the string.\n- If `start` is negative, then it is evaluated as `length(str - start)`.\n- If `start` is greater than the length of `str`, then sliceToEnd returns the empty string.\n See [`String.slice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/slice) on MDN.\n\n## Examples\n\n```rescript\nString.sliceToEnd(\"abcdefg\", ~start=4) == \"efg\"\nString.sliceToEnd(\"abcdefg\", ~start=-2) == \"fg\"\nString.sliceToEnd(\"abcdefg\", ~start=7) == \"\"\n```\n" + }, "insertText": "->String.sliceToEnd", - "additionalTextEdits": [{ - "range": {"start": {"line": 93, "character": 17}, "end": {"line": 93, "character": 18}}, - "newText": "" - }] - }, { - "label": "->String.splitByRegExp", "kind": 12, - "tags": [], + "label": "->String.sliceToEnd", + "sortText": "sliceToEnd", + "tags": [ 1 ] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 18, "line": 93 }, + "start": { "character": 17, "line": 93 } + } + } + ], "detail": "(string, RegExp.t) => array>", - "documentation": {"kind": "markdown", "value": "\n`splitByRegExp(str, regexp)` splits the given `str` at every occurrence of\n`regexp` and returns an array of the resulting substrings.\nSee [`String.split`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/split) on MDN.\n\n## Examples\n\n```rescript\nString.splitByRegExp(\"Jan,Feb,Mar\", /,/) == [Some(\"Jan\"), Some(\"Feb\"), Some(\"Mar\")]\n```\n"}, - "sortText": "splitByRegExp", + "documentation": { + "kind": "markdown", + "value": "\n`splitByRegExp(str, regexp)` splits the given `str` at every occurrence of\n`regexp` and returns an array of the resulting substrings.\nSee [`String.split`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/split) on MDN.\n\n## Examples\n\n```rescript\nString.splitByRegExp(\"Jan,Feb,Mar\", /,/) == [Some(\"Jan\"), Some(\"Feb\"), Some(\"Mar\")]\n```\n" + }, "insertText": "->String.splitByRegExp", - "additionalTextEdits": [{ - "range": {"start": {"line": 93, "character": 17}, "end": {"line": 93, "character": 18}}, - "newText": "" - }] - }, { - "label": "->String.startsWithFrom", "kind": 12, - "tags": [], + "label": "->String.splitByRegExp", + "sortText": "splitByRegExp", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 18, "line": 93 }, + "start": { "character": 17, "line": 93 } + } + } + ], "detail": "(string, string, int) => bool", - "documentation": {"kind": "markdown", "value": "\n`startsWithFrom(str, substr, n)` returns `true` if the `str` starts\nwith `substr` starting at position `n`, `false` otherwise. If `n` is negative,\nthe search starts at the beginning of `str`.\nSee [`String.startsWith`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/startsWith) on MDN.\n\n## Examples\n\n```rescript\nString.startsWithFrom(\"BuckleScript\", \"kle\", 3) == true\nString.startsWithFrom(\"BuckleScript\", \"\", 3) == true\nString.startsWithFrom(\"JavaScript\", \"Buckle\", 2) == false\n```\n"}, - "sortText": "startsWithFrom", + "documentation": { + "kind": "markdown", + "value": "\n`startsWithFrom(str, substr, n)` returns `true` if the `str` starts\nwith `substr` starting at position `n`, `false` otherwise. If `n` is negative,\nthe search starts at the beginning of `str`.\nSee [`String.startsWith`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/startsWith) on MDN.\n\n## Examples\n\n```rescript\nString.startsWithFrom(\"BuckleScript\", \"kle\", 3) == true\nString.startsWithFrom(\"BuckleScript\", \"\", 3) == true\nString.startsWithFrom(\"JavaScript\", \"Buckle\", 2) == false\n```\n" + }, "insertText": "->String.startsWithFrom", - "additionalTextEdits": [{ - "range": {"start": {"line": 93, "character": 17}, "end": {"line": 93, "character": 18}}, - "newText": "" - }] - }, { - "label": "->String.split", "kind": 12, - "tags": [], + "label": "->String.startsWithFrom", + "sortText": "startsWithFrom", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 18, "line": 93 }, + "start": { "character": 17, "line": 93 } + } + } + ], "detail": "(string, string) => array", - "documentation": {"kind": "markdown", "value": "\n`split(str, delimiter)` splits the given `str` at every occurrence of\n`delimiter` and returns an array of the resulting substrings.\nSee [`String.split`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/split) on MDN.\n\n## Examples\n\n```rescript\nString.split(\"2018-01-02\", \"-\") == [\"2018\", \"01\", \"02\"]\nString.split(\"a,b,,c\", \",\") == [\"a\", \"b\", \"\", \"c\"]\nString.split(\"good::bad as great::awful\", \"::\") == [\"good\", \"bad as great\", \"awful\"]\nString.split(\"has-no-delimiter\", \";\") == [\"has-no-delimiter\"]\n```\n"}, - "sortText": "split", + "documentation": { + "kind": "markdown", + "value": "\n`split(str, delimiter)` splits the given `str` at every occurrence of\n`delimiter` and returns an array of the resulting substrings.\nSee [`String.split`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/split) on MDN.\n\n## Examples\n\n```rescript\nString.split(\"2018-01-02\", \"-\") == [\"2018\", \"01\", \"02\"]\nString.split(\"a,b,,c\", \",\") == [\"a\", \"b\", \"\", \"c\"]\nString.split(\"good::bad as great::awful\", \"::\") == [\"good\", \"bad as great\", \"awful\"]\nString.split(\"has-no-delimiter\", \";\") == [\"has-no-delimiter\"]\n```\n" + }, "insertText": "->String.split", - "additionalTextEdits": [{ - "range": {"start": {"line": 93, "character": 17}, "end": {"line": 93, "character": 18}}, - "newText": "" - }] - }, { - "label": "->String.substring", "kind": 12, - "tags": [], + "label": "->String.split", + "sortText": "split", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 18, "line": 93 }, + "start": { "character": 17, "line": 93 } + } + } + ], "detail": "(string, ~start: int, ~end: int=?) => string", - "documentation": {"kind": "markdown", "value": "\n`substring(str, ~start, ~end)` returns characters `start` up to but not\nincluding end from `str`.\n- If `start` is less than zero, it is treated as zero.\n- If `end` is zero or negative, the empty string is returned.\n- If `start` is greater than `end`, the `start` and `end` points are swapped.\n See [`String.substring`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/substring) on MDN.\n\n## Examples\n\n```rescript\nString.substring(\"playground\", ~start=3, ~end=6) == \"ygr\"\nString.substring(\"playground\", ~start=6, ~end=3) == \"ygr\"\nString.substring(\"playground\", ~start=4, ~end=12) == \"ground\"\nString.substring(\"playground\", ~start=4) == \"ground\"\nString.substring(\"Hello World\", ~start=6) == \"World\"\n```\n"}, - "sortText": "substring", + "documentation": { + "kind": "markdown", + "value": "\n`substring(str, ~start, ~end)` returns characters `start` up to but not\nincluding end from `str`.\n- If `start` is less than zero, it is treated as zero.\n- If `end` is zero or negative, the empty string is returned.\n- If `start` is greater than `end`, the `start` and `end` points are swapped.\n See [`String.substring`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/substring) on MDN.\n\n## Examples\n\n```rescript\nString.substring(\"playground\", ~start=3, ~end=6) == \"ygr\"\nString.substring(\"playground\", ~start=6, ~end=3) == \"ygr\"\nString.substring(\"playground\", ~start=4, ~end=12) == \"ground\"\nString.substring(\"playground\", ~start=4) == \"ground\"\nString.substring(\"Hello World\", ~start=6) == \"World\"\n```\n" + }, "insertText": "->String.substring", - "additionalTextEdits": [{ - "range": {"start": {"line": 93, "character": 17}, "end": {"line": 93, "character": 18}}, - "newText": "" - }] - }, { - "label": "->String.search", "kind": 12, - "tags": [], + "label": "->String.substring", + "sortText": "substring", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 18, "line": 93 }, + "start": { "character": 17, "line": 93 } + } + } + ], "detail": "(string, RegExp.t) => int", - "documentation": {"kind": "markdown", "value": "\n`search(str, regexp)` returns the starting position of the first match of\n`regexp` in the given `str`, or -1 if there is no match.\nSee [`String.search`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/search) on MDN.\n\n## Examples\n\n```rescript\nString.search(\"testing 1 2 3\", /\\d+/) == 8\nString.search(\"no numbers\", /\\d+/) == -1\n```\n"}, - "sortText": "search", + "documentation": { + "kind": "markdown", + "value": "\n`search(str, regexp)` returns the starting position of the first match of\n`regexp` in the given `str`, or -1 if there is no match.\nSee [`String.search`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/search) on MDN.\n\n## Examples\n\n```rescript\nString.search(\"testing 1 2 3\", /\\d+/) == 8\nString.search(\"no numbers\", /\\d+/) == -1\n```\n" + }, "insertText": "->String.search", - "additionalTextEdits": [{ - "range": {"start": {"line": 93, "character": 17}, "end": {"line": 93, "character": 18}}, - "newText": "" - }] - }] + "kind": 12, + "label": "->String.search", + "sortText": "search", + "tags": [] + } +] diff --git a/tests/analysis_tests/tests/src/expected/CompletionJsxProps.res.txt b/tests/analysis_tests/tests/src/expected/CompletionJsxProps.res.txt index af410bf97a7..7d6405d1408 100644 --- a/tests/analysis_tests/tests/src/expected/CompletionJsxProps.res.txt +++ b/tests/analysis_tests/tests/src/expected/CompletionJsxProps.res.txt @@ -6,19 +6,10 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath CJsxPropValue [CompletionSupport, TestComponent] on Path CompletionSupport.TestComponent.make -[{ - "label": "true", - "kind": 4, - "tags": [], - "detail": "bool", - "documentation": null - }, { - "label": "false", - "kind": 4, - "tags": [], - "detail": "bool", - "documentation": null - }] +[ + { "detail": "bool", "kind": 4, "label": "true", "tags": [] }, + { "detail": "bool", "kind": 4, "label": "false", "tags": [] } +] Complete src/CompletionJsxProps.res 3:48 posCursor:[3:48] posNoWhite:[3:47] Found expr:[3:11->3:48] @@ -28,20 +19,25 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath CJsxPropValue [CompletionSupport, TestComponent] on Path CompletionSupport.TestComponent.make -[{ - "label": "true", - "kind": 4, - "tags": [], +[ + { "detail": "bool", - "documentation": null, - "sortText": "A true" - }, { - "label": "typeof", - "kind": 12, - "tags": [], + "kind": 4, + "label": "true", + "sortText": "A true", + "tags": [] + }, + { "detail": "'a => Type.t", - "documentation": {"kind": "markdown", "value": "\n`typeof(value)` exposes JavaScript's `typeof` operator and returns a `Type.t` enum.\nIt helps you inspect values that come from JavaScript APIs.\n\n## Examples\n\n```rescript\ntypeof(1) == #number\ntypeof(\"a\") == #string\n```\n"} - }] + "documentation": { + "kind": "markdown", + "value": "\n`typeof(value)` exposes JavaScript's `typeof` operator and returns a `Type.t` enum.\nIt helps you inspect values that come from JavaScript APIs.\n\n## Examples\n\n```rescript\ntypeof(1) == #number\ntypeof(\"a\") == #string\n```\n" + }, + "kind": 12, + "label": "typeof", + "tags": [] + } +] Complete src/CompletionJsxProps.res 6:50 posCursor:[6:50] posNoWhite:[6:49] Found expr:[6:11->6:50] @@ -51,93 +47,97 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath CJsxPropValue [CompletionSupport, TestComponent] test Path CompletionSupport.TestComponent.make -[{ - "label": "Two", - "kind": 4, - "tags": [], +[ + { "detail": "Two", - "documentation": {"kind": "markdown", "value": "```rescript\nTwo\n```\n\n```rescript\ntype testVariant = One | Two | Three(int)\n```"}, - "sortText": "A Two", + "documentation": { + "kind": "markdown", + "value": "```rescript\nTwo\n```\n\n```rescript\ntype testVariant = One | Two | Three(int)\n```" + }, "insertText": "{Two}", - "insertTextFormat": 2 - }, { - "label": "Three(_)", + "insertTextFormat": 2, "kind": 4, - "tags": [], + "label": "Two", + "sortText": "A Two", + "tags": [] + }, + { "detail": "Three(int)", - "documentation": {"kind": "markdown", "value": "```rescript\nThree(int)\n```\n\n```rescript\ntype testVariant = One | Two | Three(int)\n```"}, - "sortText": "A Three(_)", + "documentation": { + "kind": "markdown", + "value": "```rescript\nThree(int)\n```\n\n```rescript\ntype testVariant = One | Two | Three(int)\n```" + }, "insertText": "{Three($0)}", - "insertTextFormat": 2 - }, { - "label": "TypedArray", - "kind": 9, - "tags": [], + "insertTextFormat": 2, + "kind": 4, + "label": "Three(_)", + "sortText": "A Three(_)", + "tags": [] + }, + { "detail": "module TypedArray", - "documentation": null - }, { - "label": "TimeoutId", "kind": 9, - "tags": [], + "label": "TypedArray", + "tags": [] + }, + { "detail": "module TimeoutId", - "documentation": null - }, { - "label": "Type", - "kind": 9, - "tags": [], - "detail": "module Type", - "documentation": null - }, { - "label": "TableclothMap", "kind": 9, - "tags": [], - "detail": "module TableclothMap", - "documentation": null, + "label": "TimeoutId", + "tags": [] + }, + { "detail": "module Type", "kind": 9, "label": "Type", "tags": [] }, + { "data": { "modulePath": "TableclothMap", "filePath": "src/CompletionJsxProps.res" - } - }, { - "label": "TypeArgCtx", + }, + "detail": "module TableclothMap", "kind": 9, - "tags": [], - "detail": "module TypeArgCtx", - "documentation": null, + "label": "TableclothMap", + "tags": [] + }, + { "data": { "modulePath": "TypeArgCtx", "filePath": "src/CompletionJsxProps.res" - } - }, { - "label": "TypeAtPosCompletion", + }, + "detail": "module TypeArgCtx", "kind": 9, - "tags": [], - "detail": "module TypeAtPosCompletion", - "documentation": null, + "label": "TypeArgCtx", + "tags": [] + }, + { "data": { "modulePath": "TypeAtPosCompletion", "filePath": "src/CompletionJsxProps.res" - } - }, { - "label": "TypeConstraint", + }, + "detail": "module TypeAtPosCompletion", "kind": 9, - "tags": [], - "detail": "module TypeConstraint", - "documentation": null, + "label": "TypeAtPosCompletion", + "tags": [] + }, + { "data": { "modulePath": "TypeConstraint", "filePath": "src/CompletionJsxProps.res" - } - }, { - "label": "TypeDefinition", + }, + "detail": "module TypeConstraint", "kind": 9, - "tags": [], - "detail": "module TypeDefinition", - "documentation": null, + "label": "TypeConstraint", + "tags": [] + }, + { "data": { "modulePath": "TypeDefinition", "filePath": "src/CompletionJsxProps.res" - } - }] + }, + "detail": "module TypeDefinition", + "kind": 9, + "label": "TypeDefinition", + "tags": [] + } +] Complete src/CompletionJsxProps.res 9:52 posCursor:[9:52] posNoWhite:[9:51] Found expr:[9:11->9:52] @@ -147,39 +147,56 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath CJsxPropValue [CompletionSupport, TestComponent] polyArg Path CompletionSupport.TestComponent.make -[{ - "label": "#one", - "kind": 4, - "tags": [], +[ + { "detail": "#one", - "documentation": {"kind": "markdown", "value": "```rescript\n#one\n```\n\n```rescript\n[#one | #three(int, bool) | #two | #two2]\n```"}, + "documentation": { + "kind": "markdown", + "value": "```rescript\n#one\n```\n\n```rescript\n[#one | #three(int, bool) | #two | #two2]\n```" + }, "insertText": "{#one}", - "insertTextFormat": 2 - }, { - "label": "#three(_, _)", + "insertTextFormat": 2, "kind": 4, - "tags": [], + "label": "#one", + "tags": [] + }, + { "detail": "#three(int, bool)", - "documentation": {"kind": "markdown", "value": "```rescript\n#three(int, bool)\n```\n\n```rescript\n[#one | #three(int, bool) | #two | #two2]\n```"}, + "documentation": { + "kind": "markdown", + "value": "```rescript\n#three(int, bool)\n```\n\n```rescript\n[#one | #three(int, bool) | #two | #two2]\n```" + }, "insertText": "{#three(${1:_}, ${2:_})}", - "insertTextFormat": 2 - }, { - "label": "#two", + "insertTextFormat": 2, "kind": 4, - "tags": [], + "label": "#three(_, _)", + "tags": [] + }, + { "detail": "#two", - "documentation": {"kind": "markdown", "value": "```rescript\n#two\n```\n\n```rescript\n[#one | #three(int, bool) | #two | #two2]\n```"}, + "documentation": { + "kind": "markdown", + "value": "```rescript\n#two\n```\n\n```rescript\n[#one | #three(int, bool) | #two | #two2]\n```" + }, "insertText": "{#two}", - "insertTextFormat": 2 - }, { - "label": "#two2", + "insertTextFormat": 2, "kind": 4, - "tags": [], + "label": "#two", + "tags": [] + }, + { "detail": "#two2", - "documentation": {"kind": "markdown", "value": "```rescript\n#two2\n```\n\n```rescript\n[#one | #three(int, bool) | #two | #two2]\n```"}, + "documentation": { + "kind": "markdown", + "value": "```rescript\n#two2\n```\n\n```rescript\n[#one | #three(int, bool) | #two | #two2]\n```" + }, "insertText": "{#two2}", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 4, + "label": "#two2", + "tags": [] + } +] Complete src/CompletionJsxProps.res 12:54 posCursor:[12:54] posNoWhite:[12:53] Found expr:[12:11->12:54] @@ -189,31 +206,44 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath CJsxPropValue [CompletionSupport, TestComponent] polyArg Path CompletionSupport.TestComponent.make -[{ - "label": "#three(_, _)", - "kind": 4, - "tags": [], +[ + { "detail": "#three(int, bool)", - "documentation": {"kind": "markdown", "value": "```rescript\n#three(int, bool)\n```\n\n```rescript\n[#one | #three(int, bool) | #two | #two2]\n```"}, + "documentation": { + "kind": "markdown", + "value": "```rescript\n#three(int, bool)\n```\n\n```rescript\n[#one | #three(int, bool) | #two | #two2]\n```" + }, "insertText": "{three(${1:_}, ${2:_})}", - "insertTextFormat": 2 - }, { - "label": "#two", + "insertTextFormat": 2, "kind": 4, - "tags": [], + "label": "#three(_, _)", + "tags": [] + }, + { "detail": "#two", - "documentation": {"kind": "markdown", "value": "```rescript\n#two\n```\n\n```rescript\n[#one | #three(int, bool) | #two | #two2]\n```"}, + "documentation": { + "kind": "markdown", + "value": "```rescript\n#two\n```\n\n```rescript\n[#one | #three(int, bool) | #two | #two2]\n```" + }, "insertText": "{two}", - "insertTextFormat": 2 - }, { - "label": "#two2", + "insertTextFormat": 2, "kind": 4, - "tags": [], + "label": "#two", + "tags": [] + }, + { "detail": "#two2", - "documentation": {"kind": "markdown", "value": "```rescript\n#two2\n```\n\n```rescript\n[#one | #three(int, bool) | #two | #two2]\n```"}, + "documentation": { + "kind": "markdown", + "value": "```rescript\n#two2\n```\n\n```rescript\n[#one | #three(int, bool) | #two | #two2]\n```" + }, "insertText": "{two2}", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 4, + "label": "#two2", + "tags": [] + } +] Complete src/CompletionJsxProps.res 15:22 posCursor:[15:22] posNoWhite:[15:21] Found expr:[15:11->15:25] @@ -224,19 +254,10 @@ Resolved opens 1 Stdlib ContextPath CJsxPropValue [div] muted Path ReactDOM.domProps Path JsxDOM.domProps -[{ - "label": "true", - "kind": 4, - "tags": [], - "detail": "bool", - "documentation": null - }, { - "label": "false", - "kind": 4, - "tags": [], - "detail": "bool", - "documentation": null - }] +[ + { "detail": "bool", "kind": 4, "label": "true", "tags": [] }, + { "detail": "bool", "kind": 4, "label": "false", "tags": [] } +] Complete src/CompletionJsxProps.res 18:29 posCursor:[18:29] posNoWhite:[18:28] Found expr:[18:11->18:32] @@ -247,16 +268,17 @@ Resolved opens 1 Stdlib ContextPath CJsxPropValue [div] onMouseEnter Path ReactDOM.domProps Path JsxDOM.domProps -[{ - "label": "event => event", - "kind": 12, - "tags": [], +[ + { "detail": "JsxEvent.Mouse.t => unit", - "documentation": null, - "sortText": "A", "insertText": "{${1:event} => ${0:event}}", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 12, + "label": "event => event", + "sortText": "A", + "tags": [] + } +] Complete src/CompletionJsxProps.res 22:52 posCursor:[22:52] posNoWhite:[22:51] Found expr:[22:11->22:52] @@ -266,16 +288,21 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath CJsxPropValue [CompletionSupport, TestComponent] testArr Path CompletionSupport.TestComponent.make -[{ - "label": "[]", - "kind": 12, - "tags": [], +[ + { "detail": "testVariant", - "documentation": {"kind": "markdown", "value": "```rescript\ntype testVariant = One | Two | Three(int)\n```"}, - "sortText": "A", + "documentation": { + "kind": "markdown", + "value": "```rescript\ntype testVariant = One | Two | Three(int)\n```" + }, "insertText": "{[$0]}", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 12, + "label": "[]", + "sortText": "A", + "tags": [] + } +] Complete src/CompletionJsxProps.res 26:54 posCursor:[26:54] posNoWhite:[26:53] Found expr:[26:11->26:56] @@ -285,31 +312,44 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath CJsxPropValue [CompletionSupport, TestComponent] testArr Path CompletionSupport.TestComponent.make -[{ - "label": "One", - "kind": 4, - "tags": [], +[ + { "detail": "One", - "documentation": {"kind": "markdown", "value": "```rescript\nOne\n```\n\n```rescript\ntype testVariant = One | Two | Three(int)\n```"}, + "documentation": { + "kind": "markdown", + "value": "```rescript\nOne\n```\n\n```rescript\ntype testVariant = One | Two | Three(int)\n```" + }, "insertText": "One", - "insertTextFormat": 2 - }, { - "label": "Two", + "insertTextFormat": 2, "kind": 4, - "tags": [], + "label": "One", + "tags": [] + }, + { "detail": "Two", - "documentation": {"kind": "markdown", "value": "```rescript\nTwo\n```\n\n```rescript\ntype testVariant = One | Two | Three(int)\n```"}, + "documentation": { + "kind": "markdown", + "value": "```rescript\nTwo\n```\n\n```rescript\ntype testVariant = One | Two | Three(int)\n```" + }, "insertText": "Two", - "insertTextFormat": 2 - }, { - "label": "Three(_)", + "insertTextFormat": 2, "kind": 4, - "tags": [], + "label": "Two", + "tags": [] + }, + { "detail": "Three(int)", - "documentation": {"kind": "markdown", "value": "```rescript\nThree(int)\n```\n\n```rescript\ntype testVariant = One | Two | Three(int)\n```"}, + "documentation": { + "kind": "markdown", + "value": "```rescript\nThree(int)\n```\n\n```rescript\ntype testVariant = One | Two | Three(int)\n```" + }, "insertText": "Three($0)", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 4, + "label": "Three(_)", + "tags": [] + } +] Complete src/CompletionJsxProps.res 31:53 posCursor:[31:53] posNoWhite:[31:52] Found expr:[31:11->31:54] @@ -319,39 +359,56 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath CJsxPropValue [CompletionSupport, TestComponent] polyArg Path CompletionSupport.TestComponent.make -[{ - "label": "#one", - "kind": 4, - "tags": [], +[ + { "detail": "#one", - "documentation": {"kind": "markdown", "value": "```rescript\n#one\n```\n\n```rescript\n[#one | #three(int, bool) | #two | #two2]\n```"}, + "documentation": { + "kind": "markdown", + "value": "```rescript\n#one\n```\n\n```rescript\n[#one | #three(int, bool) | #two | #two2]\n```" + }, "insertText": "#one", - "insertTextFormat": 2 - }, { - "label": "#three(_, _)", + "insertTextFormat": 2, "kind": 4, - "tags": [], + "label": "#one", + "tags": [] + }, + { "detail": "#three(int, bool)", - "documentation": {"kind": "markdown", "value": "```rescript\n#three(int, bool)\n```\n\n```rescript\n[#one | #three(int, bool) | #two | #two2]\n```"}, + "documentation": { + "kind": "markdown", + "value": "```rescript\n#three(int, bool)\n```\n\n```rescript\n[#one | #three(int, bool) | #two | #two2]\n```" + }, "insertText": "#three(${1:_}, ${2:_})", - "insertTextFormat": 2 - }, { - "label": "#two", + "insertTextFormat": 2, "kind": 4, - "tags": [], + "label": "#three(_, _)", + "tags": [] + }, + { "detail": "#two", - "documentation": {"kind": "markdown", "value": "```rescript\n#two\n```\n\n```rescript\n[#one | #three(int, bool) | #two | #two2]\n```"}, + "documentation": { + "kind": "markdown", + "value": "```rescript\n#two\n```\n\n```rescript\n[#one | #three(int, bool) | #two | #two2]\n```" + }, "insertText": "#two", - "insertTextFormat": 2 - }, { - "label": "#two2", + "insertTextFormat": 2, "kind": 4, - "tags": [], + "label": "#two", + "tags": [] + }, + { "detail": "#two2", - "documentation": {"kind": "markdown", "value": "```rescript\n#two2\n```\n\n```rescript\n[#one | #three(int, bool) | #two | #two2]\n```"}, + "documentation": { + "kind": "markdown", + "value": "```rescript\n#two2\n```\n\n```rescript\n[#one | #three(int, bool) | #two | #two2]\n```" + }, "insertText": "#two2", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 4, + "label": "#two2", + "tags": [] + } +] Complete src/CompletionJsxProps.res 34:49 posCursor:[34:49] posNoWhite:[34:48] Found expr:[34:11->34:50] @@ -361,25 +418,20 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath CJsxPropValue [CompletionSupport, TestComponent] on Path CompletionSupport.TestComponent.make -[{ - "label": "true", - "kind": 4, - "tags": [], - "detail": "bool", - "documentation": null - }, { - "label": "tsomeVar", +[ + { "detail": "bool", "kind": 4, "label": "true", "tags": [] }, + { "detail": "[> #two]", "kind": 12, "label": "tsomeVar", "tags": [] }, + { + "detail": "'a => Type.t", + "documentation": { + "kind": "markdown", + "value": "\n`typeof(value)` exposes JavaScript's `typeof` operator and returns a `Type.t` enum.\nIt helps you inspect values that come from JavaScript APIs.\n\n## Examples\n\n```rescript\ntypeof(1) == #number\ntypeof(\"a\") == #string\n```\n" + }, "kind": 12, - "tags": [], - "detail": "[> #two]", - "documentation": null - }, { "label": "typeof", - "kind": 12, - "tags": [], - "detail": "'a => Type.t", - "documentation": {"kind": "markdown", "value": "\n`typeof(value)` exposes JavaScript's `typeof` operator and returns a `Type.t` enum.\nIt helps you inspect values that come from JavaScript APIs.\n\n## Examples\n\n```rescript\ntypeof(1) == #number\ntypeof(\"a\") == #string\n```\n"} - }] + "tags": [] + } +] Complete src/CompletionJsxProps.res 44:44 posCursor:[44:44] posNoWhite:[44:43] Found expr:[44:11->44:44] @@ -389,21 +441,30 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath CJsxPropValue [CompletableComponentLazy] status Path CompletableComponentLazy.make -[{ - "label": "On", - "kind": 4, - "tags": [], +[ + { "detail": "On", - "documentation": {"kind": "markdown", "value": "```rescript\nOn\n```\n\n```rescript\ntype status = On | Off\n```"}, + "documentation": { + "kind": "markdown", + "value": "```rescript\nOn\n```\n\n```rescript\ntype status = On | Off\n```" + }, "insertText": "{On}", - "insertTextFormat": 2 - }, { - "label": "Off", + "insertTextFormat": 2, "kind": 4, - "tags": [], + "label": "On", + "tags": [] + }, + { "detail": "Off", - "documentation": {"kind": "markdown", "value": "```rescript\nOff\n```\n\n```rescript\ntype status = On | Off\n```"}, + "documentation": { + "kind": "markdown", + "value": "```rescript\nOff\n```\n\n```rescript\ntype status = On | Off\n```" + }, "insertText": "{Off}", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 4, + "label": "Off", + "tags": [] + } +] diff --git a/tests/analysis_tests/tests/src/expected/CompletionMultipleEditorCompleteFrom.res.txt b/tests/analysis_tests/tests/src/expected/CompletionMultipleEditorCompleteFrom.res.txt index cc9888647e1..f5383e166fb 100644 --- a/tests/analysis_tests/tests/src/expected/CompletionMultipleEditorCompleteFrom.res.txt +++ b/tests/analysis_tests/tests/src/expected/CompletionMultipleEditorCompleteFrom.res.txt @@ -15,29 +15,40 @@ Path A. Path B. Path C. Path -[{ - "label": "->B.b", - "kind": 12, - "tags": [], +[ + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 5, "line": 19 }, + "start": { "character": 4, "line": 19 } + } + } + ], "detail": "A.a => int", - "documentation": null, - "sortText": "b", "insertText": "->B.b", - "additionalTextEdits": [{ - "range": {"start": {"line": 19, "character": 4}, "end": {"line": 19, "character": 5}}, - "newText": "" - }] - }, { - "label": "->C.c", "kind": 12, - "tags": [], + "label": "->B.b", + "sortText": "b", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 5, "line": 19 }, + "start": { "character": 4, "line": 19 } + } + } + ], "detail": "A.a => char", - "documentation": null, - "sortText": "c", "insertText": "->C.c", - "additionalTextEdits": [{ - "range": {"start": {"line": 19, "character": 4}, "end": {"line": 19, "character": 5}}, - "newText": "" - }] - }] + "kind": 12, + "label": "->C.c", + "sortText": "c", + "tags": [] + } +] diff --git a/tests/analysis_tests/tests/src/expected/CompletionNullNullable.res.txt b/tests/analysis_tests/tests/src/expected/CompletionNullNullable.res.txt index 8903a5ef5a3..3fdbfa4534f 100644 --- a/tests/analysis_tests/tests/src/expected/CompletionNullNullable.res.txt +++ b/tests/analysis_tests/tests/src/expected/CompletionNullNullable.res.txt @@ -12,187 +12,326 @@ ContextPath Value[x] Path x Path Stdlib.Null. Path -[{ - "label": "->Null.equal", - "kind": 12, - "tags": [], +[ + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 5, "line": 2 }, + "start": { "character": 4, "line": 2 } + } + } + ], "detail": "(t<'a>, t<'b>, ('a, 'b) => bool) => bool", - "documentation": {"kind": "markdown", "value": "\n`equal(a, b, eq)` checks if `a` and `b` are equal.\nIf both are `Null.Value`, it will use function `eq` to check if the values are equal.\n\n## Examples\n```rescript\nlet a = Null.Value(1)\nlet b = Null.null\nlet c = Null.Value(2)\n\nNull.equal(a, b, Int.equal) == false\nNull.equal(a, c, Int.equal) == false\nNull.equal(Null.null, Null.null, Int.equal) == true\n```\n "}, - "sortText": "equal", + "documentation": { + "kind": "markdown", + "value": "\n`equal(a, b, eq)` checks if `a` and `b` are equal.\nIf both are `Null.Value`, it will use function `eq` to check if the values are equal.\n\n## Examples\n```rescript\nlet a = Null.Value(1)\nlet b = Null.null\nlet c = Null.Value(2)\n\nNull.equal(a, b, Int.equal) == false\nNull.equal(a, c, Int.equal) == false\nNull.equal(Null.null, Null.null, Int.equal) == true\n```\n " + }, "insertText": "->Null.equal", - "additionalTextEdits": [{ - "range": {"start": {"line": 2, "character": 4}, "end": {"line": 2, "character": 5}}, - "newText": "" - }] - }, { - "label": "->Null.getUnsafe", "kind": 12, - "tags": [], + "label": "->Null.equal", + "sortText": "equal", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 5, "line": 2 }, + "start": { "character": 4, "line": 2 } + } + } + ], "detail": "t<'a> => 'a", - "documentation": {"kind": "markdown", "value": "\n`getUnsafe(value)` returns `value`.\n\n## Examples\n\n```rescript\nNull.getUnsafe(Null.make(3)) == 3\nNull.getUnsafe(Null.null) // Throws an error\n```\n\n## Important\n\n- This is an unsafe operation, it assumes `value` is not `null`.\n"}, - "sortText": "getUnsafe", + "documentation": { + "kind": "markdown", + "value": "\n`getUnsafe(value)` returns `value`.\n\n## Examples\n\n```rescript\nNull.getUnsafe(Null.make(3)) == 3\nNull.getUnsafe(Null.null) // Throws an error\n```\n\n## Important\n\n- This is an unsafe operation, it assumes `value` is not `null`.\n" + }, "insertText": "->Null.getUnsafe", - "additionalTextEdits": [{ - "range": {"start": {"line": 2, "character": 4}, "end": {"line": 2, "character": 5}}, - "newText": "" - }] - }, { - "label": "->Null.map", "kind": 12, - "tags": [], + "label": "->Null.getUnsafe", + "sortText": "getUnsafe", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 5, "line": 2 }, + "start": { "character": 4, "line": 2 } + } + } + ], "detail": "(t<'a>, 'a => 'b) => t<'b>", - "documentation": {"kind": "markdown", "value": "\n`map(value, f)` returns `f(value)` if `value` is not `null`, otherwise returns\n`value` unchanged.\n\n## Examples\n\n```rescript\nNull.map(Null.make(3), x => x * x) // Null.make(9)\nNull.map(Null.null, x => x * x) // null\n```\n"}, - "sortText": "map", + "documentation": { + "kind": "markdown", + "value": "\n`map(value, f)` returns `f(value)` if `value` is not `null`, otherwise returns\n`value` unchanged.\n\n## Examples\n\n```rescript\nNull.map(Null.make(3), x => x * x) // Null.make(9)\nNull.map(Null.null, x => x * x) // null\n```\n" + }, "insertText": "->Null.map", - "additionalTextEdits": [{ - "range": {"start": {"line": 2, "character": 4}, "end": {"line": 2, "character": 5}}, - "newText": "" - }] - }, { - "label": "->Null.getExn", "kind": 12, - "tags": [1], + "label": "->Null.map", + "sortText": "map", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 5, "line": 2 }, + "start": { "character": 4, "line": 2 } + } + } + ], + "deprecated": true, "detail": "t<'a> => 'a", - "documentation": {"kind": "markdown", "value": "Deprecated: Use `getOrThrow` instead\n\n\n`getExn(value)` throws an exception if `null`, otherwise returns the value.\n\n```rescript\nNull.getExn(Null.make(3)) == 3\n\nswitch Null.getExn(%raw(\"'ReScript'\")) {\n| exception Invalid_argument(_) => assert(false)\n| value => value == \"ReScript\"\n}\n\nswitch Null.getExn(%raw(\"null\")) {\n| exception Invalid_argument(_) => assert(true)\n| _ => assert(false)\n}\n```\n\n## Exceptions\n\n- Throws `Invalid_argument` if `value` is `null`\n"}, - "sortText": "getExn", + "documentation": { + "kind": "markdown", + "value": "Deprecated: Use `getOrThrow` instead\n\n\n`getExn(value)` throws an exception if `null`, otherwise returns the value.\n\n```rescript\nNull.getExn(Null.make(3)) == 3\n\nswitch Null.getExn(%raw(\"'ReScript'\")) {\n| exception Invalid_argument(_) => assert(false)\n| value => value == \"ReScript\"\n}\n\nswitch Null.getExn(%raw(\"null\")) {\n| exception Invalid_argument(_) => assert(true)\n| _ => assert(false)\n}\n```\n\n## Exceptions\n\n- Throws `Invalid_argument` if `value` is `null`\n" + }, "insertText": "->Null.getExn", - "additionalTextEdits": [{ - "range": {"start": {"line": 2, "character": 4}, "end": {"line": 2, "character": 5}}, - "newText": "" - }] - }, { - "label": "->Null.compare", "kind": 12, - "tags": [], + "label": "->Null.getExn", + "sortText": "getExn", + "tags": [ 1 ] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 5, "line": 2 }, + "start": { "character": 4, "line": 2 } + } + } + ], "detail": "(t<'a>, t<'b>, ('a, 'b) => Ordering.t) => Ordering.t", - "documentation": {"kind": "markdown", "value": "\n`compare(a, b, cmp)` compares `a` and `b`.\nIf both are `Null.Value`, it will use function `cmp` to compare the values.\n\n## Examples\n```rescript\nlet a = Null.Value(1)\nlet b = Null.null\nlet c = Null.Value(2)\n\n// A value is greater than null\nNull.compare(a, b, Int.compare) == Stdlib_Ordering.greater\n// A value is less than null\nNull.compare(b, a, Int.compare) == Stdlib_Ordering.less\n// A null is equal to null\nNull.compare(Null.null, Null.null, Int.compare) == Stdlib_Ordering.equal\n// The compare function is used if both are `Null.Value`\nNull.compare(a, c, Int.compare) == Stdlib_Ordering.less\n```\n"}, - "sortText": "compare", + "documentation": { + "kind": "markdown", + "value": "\n`compare(a, b, cmp)` compares `a` and `b`.\nIf both are `Null.Value`, it will use function `cmp` to compare the values.\n\n## Examples\n```rescript\nlet a = Null.Value(1)\nlet b = Null.null\nlet c = Null.Value(2)\n\n// A value is greater than null\nNull.compare(a, b, Int.compare) == Stdlib_Ordering.greater\n// A value is less than null\nNull.compare(b, a, Int.compare) == Stdlib_Ordering.less\n// A null is equal to null\nNull.compare(Null.null, Null.null, Int.compare) == Stdlib_Ordering.equal\n// The compare function is used if both are `Null.Value`\nNull.compare(a, c, Int.compare) == Stdlib_Ordering.less\n```\n" + }, "insertText": "->Null.compare", - "additionalTextEdits": [{ - "range": {"start": {"line": 2, "character": 4}, "end": {"line": 2, "character": 5}}, - "newText": "" - }] - }, { - "label": "->Null.ignore", "kind": 12, - "tags": [], + "label": "->Null.compare", + "sortText": "compare", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 5, "line": 2 }, + "start": { "character": 4, "line": 2 } + } + } + ], "detail": "t<'a> => unit", - "documentation": {"kind": "markdown", "value": "\n `ignore(null)` ignores the provided null and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further.\n"}, - "sortText": "ignore", + "documentation": { + "kind": "markdown", + "value": "\n `ignore(null)` ignores the provided null and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further.\n" + }, "insertText": "->Null.ignore", - "additionalTextEdits": [{ - "range": {"start": {"line": 2, "character": 4}, "end": {"line": 2, "character": 5}}, - "newText": "" - }] - }, { - "label": "->Null.getOrThrow", "kind": 12, - "tags": [], + "label": "->Null.ignore", + "sortText": "ignore", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 5, "line": 2 }, + "start": { "character": 4, "line": 2 } + } + } + ], "detail": "t<'a> => 'a", - "documentation": {"kind": "markdown", "value": "\n`getOrThrow(value)` throws an exception if `null`, otherwise returns the value.\n\n```rescript\nNull.getOrThrow(Null.make(3)) == 3\n\nswitch Null.getOrThrow(%raw(\"'ReScript'\")) {\n| exception Invalid_argument(_) => assert(false)\n| value => value == \"ReScript\"\n}\n\nswitch Null.getOrThrow(%raw(\"null\")) {\n| exception Invalid_argument(_) => assert(true)\n| _ => assert(false)\n}\n```\n\n## Exceptions\n\n- Throws `Invalid_argument` if `value` is `null`\n"}, - "sortText": "getOrThrow", + "documentation": { + "kind": "markdown", + "value": "\n`getOrThrow(value)` throws an exception if `null`, otherwise returns the value.\n\n```rescript\nNull.getOrThrow(Null.make(3)) == 3\n\nswitch Null.getOrThrow(%raw(\"'ReScript'\")) {\n| exception Invalid_argument(_) => assert(false)\n| value => value == \"ReScript\"\n}\n\nswitch Null.getOrThrow(%raw(\"null\")) {\n| exception Invalid_argument(_) => assert(true)\n| _ => assert(false)\n}\n```\n\n## Exceptions\n\n- Throws `Invalid_argument` if `value` is `null`\n" + }, "insertText": "->Null.getOrThrow", - "additionalTextEdits": [{ - "range": {"start": {"line": 2, "character": 4}, "end": {"line": 2, "character": 5}}, - "newText": "" - }] - }, { - "label": "->Null.toOption", "kind": 12, - "tags": [], + "label": "->Null.getOrThrow", + "sortText": "getOrThrow", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 5, "line": 2 }, + "start": { "character": 4, "line": 2 } + } + } + ], "detail": "t<'a> => option<'a>", - "documentation": {"kind": "markdown", "value": "\nConverts a nullable value into an option, so it can be pattern matched on.\nWill convert `null` to `None`, and a present value to `Some(value)`.\n\n## Examples\n```rescript\nlet nullStr = Null.make(\"Hello\")\n\nswitch nullStr->Null.toOption {\n| Some(str) => Console.log2(\"Got string:\", str)\n| None => Console.log(\"Didn't have a value.\")\n}\n```\n"}, - "sortText": "toOption", + "documentation": { + "kind": "markdown", + "value": "\nConverts a nullable value into an option, so it can be pattern matched on.\nWill convert `null` to `None`, and a present value to `Some(value)`.\n\n## Examples\n```rescript\nlet nullStr = Null.make(\"Hello\")\n\nswitch nullStr->Null.toOption {\n| Some(str) => Console.log2(\"Got string:\", str)\n| None => Console.log(\"Didn't have a value.\")\n}\n```\n" + }, "insertText": "->Null.toOption", - "additionalTextEdits": [{ - "range": {"start": {"line": 2, "character": 4}, "end": {"line": 2, "character": 5}}, - "newText": "" - }] - }, { - "label": "->Null.getOr", "kind": 12, - "tags": [], + "label": "->Null.toOption", + "sortText": "toOption", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 5, "line": 2 }, + "start": { "character": 4, "line": 2 } + } + } + ], "detail": "(t<'a>, 'a) => 'a", - "documentation": {"kind": "markdown", "value": "\n`getOr(value, default)` returns `value` if not `null`, otherwise return\n`default`.\n\n## Examples\n\n```rescript\nNull.getOr(Null.null, \"Banana\") // Banana\nNull.getOr(Null.make(\"Apple\"), \"Banana\") // Apple\n\nlet greet = (firstName: option) => \"Greetings \" ++ firstName->Option.getOr(\"Anonymous\")\n\nNull.make(\"Jane\")->Null.toOption->greet // \"Greetings Jane\"\nNull.null->Null.toOption->greet // \"Greetings Anonymous\"\n```\n"}, - "sortText": "getOr", + "documentation": { + "kind": "markdown", + "value": "\n`getOr(value, default)` returns `value` if not `null`, otherwise return\n`default`.\n\n## Examples\n\n```rescript\nNull.getOr(Null.null, \"Banana\") // Banana\nNull.getOr(Null.make(\"Apple\"), \"Banana\") // Apple\n\nlet greet = (firstName: option) => \"Greetings \" ++ firstName->Option.getOr(\"Anonymous\")\n\nNull.make(\"Jane\")->Null.toOption->greet // \"Greetings Jane\"\nNull.null->Null.toOption->greet // \"Greetings Anonymous\"\n```\n" + }, "insertText": "->Null.getOr", - "additionalTextEdits": [{ - "range": {"start": {"line": 2, "character": 4}, "end": {"line": 2, "character": 5}}, - "newText": "" - }] - }, { - "label": "->Null.mapOr", "kind": 12, - "tags": [], + "label": "->Null.getOr", + "sortText": "getOr", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 5, "line": 2 }, + "start": { "character": 4, "line": 2 } + } + } + ], "detail": "(t<'a>, 'b, 'a => 'b) => 'b", - "documentation": {"kind": "markdown", "value": "\n`mapOr(value, default, f)` returns `f(value)` if `value` is not `null`,\notherwise returns `default`.\n\n## Examples\n\n```rescript\nlet someValue = Null.make(3)\nsomeValue->Null.mapOr(0, x => x + 5) // 8\n\nlet noneValue = Null.null\nnoneValue->Null.mapOr(0, x => x + 5) // 0\n```\n"}, - "sortText": "mapOr", + "documentation": { + "kind": "markdown", + "value": "\n`mapOr(value, default, f)` returns `f(value)` if `value` is not `null`,\notherwise returns `default`.\n\n## Examples\n\n```rescript\nlet someValue = Null.make(3)\nsomeValue->Null.mapOr(0, x => x + 5) // 8\n\nlet noneValue = Null.null\nnoneValue->Null.mapOr(0, x => x + 5) // 0\n```\n" + }, "insertText": "->Null.mapOr", - "additionalTextEdits": [{ - "range": {"start": {"line": 2, "character": 4}, "end": {"line": 2, "character": 5}}, - "newText": "" - }] - }, { - "label": "->Null.mapWithDefault", "kind": 12, - "tags": [1], + "label": "->Null.mapOr", + "sortText": "mapOr", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 5, "line": 2 }, + "start": { "character": 4, "line": 2 } + } + } + ], + "deprecated": true, "detail": "(t<'a>, 'b, 'a => 'b) => 'b", - "documentation": {"kind": "markdown", "value": "Deprecated: Use mapOr instead\n\n"}, - "sortText": "mapWithDefault", + "documentation": { + "kind": "markdown", + "value": "Deprecated: Use mapOr instead\n\n" + }, "insertText": "->Null.mapWithDefault", - "additionalTextEdits": [{ - "range": {"start": {"line": 2, "character": 4}, "end": {"line": 2, "character": 5}}, - "newText": "" - }] - }, { - "label": "->Null.getWithDefault", "kind": 12, - "tags": [1], + "label": "->Null.mapWithDefault", + "sortText": "mapWithDefault", + "tags": [ 1 ] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 5, "line": 2 }, + "start": { "character": 4, "line": 2 } + } + } + ], + "deprecated": true, "detail": "(t<'a>, 'a) => 'a", - "documentation": {"kind": "markdown", "value": "Deprecated: Use getOr instead\n\n"}, - "sortText": "getWithDefault", + "documentation": { + "kind": "markdown", + "value": "Deprecated: Use getOr instead\n\n" + }, "insertText": "->Null.getWithDefault", - "additionalTextEdits": [{ - "range": {"start": {"line": 2, "character": 4}, "end": {"line": 2, "character": 5}}, - "newText": "" - }] - }, { - "label": "->Null.asNullable", "kind": 12, - "tags": [], + "label": "->Null.getWithDefault", + "sortText": "getWithDefault", + "tags": [ 1 ] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 5, "line": 2 }, + "start": { "character": 4, "line": 2 } + } + } + ], "detail": "t<'a> => Nullable.t<'a>", - "documentation": {"kind": "markdown", "value": "\nConverts a `Null.t` into a `Nullable.t`.\n\n## Examples\n```rescript\nlet nullValue = Null.make(\"Hello\")\nlet asNullable = nullValue->Null.asNullable // Nullable.t\n```\n"}, - "sortText": "asNullable", + "documentation": { + "kind": "markdown", + "value": "\nConverts a `Null.t` into a `Nullable.t`.\n\n## Examples\n```rescript\nlet nullValue = Null.make(\"Hello\")\nlet asNullable = nullValue->Null.asNullable // Nullable.t\n```\n" + }, "insertText": "->Null.asNullable", - "additionalTextEdits": [{ - "range": {"start": {"line": 2, "character": 4}, "end": {"line": 2, "character": 5}}, - "newText": "" - }] - }, { - "label": "->Null.forEach", "kind": 12, - "tags": [], + "label": "->Null.asNullable", + "sortText": "asNullable", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 5, "line": 2 }, + "start": { "character": 4, "line": 2 } + } + } + ], "detail": "(t<'a>, 'a => unit) => unit", - "documentation": {"kind": "markdown", "value": "\n`forEach(value, f)` call `f` on `value`. if `value` is not `null`, then if calls\n`f`, otherwise returns `unit`.\n\n## Examples\n\n```rescript\nNull.forEach(Null.make(\"thing\"), x => Console.log(x)) // logs \"thing\"\nNull.forEach(Null.null, x => Console.log(x)) // logs nothing\n```\n"}, - "sortText": "forEach", + "documentation": { + "kind": "markdown", + "value": "\n`forEach(value, f)` call `f` on `value`. if `value` is not `null`, then if calls\n`f`, otherwise returns `unit`.\n\n## Examples\n\n```rescript\nNull.forEach(Null.make(\"thing\"), x => Console.log(x)) // logs \"thing\"\nNull.forEach(Null.null, x => Console.log(x)) // logs nothing\n```\n" + }, "insertText": "->Null.forEach", - "additionalTextEdits": [{ - "range": {"start": {"line": 2, "character": 4}, "end": {"line": 2, "character": 5}}, - "newText": "" - }] - }, { - "label": "->Null.flatMap", "kind": 12, - "tags": [], + "label": "->Null.forEach", + "sortText": "forEach", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 5, "line": 2 }, + "start": { "character": 4, "line": 2 } + } + } + ], "detail": "(t<'a>, 'a => t<'b>) => t<'b>", - "documentation": {"kind": "markdown", "value": "\n`flatMap(value, f)` returns `f(value)` if `value` is not `null`, otherwise\nreturns `value` unchanged.\n\n## Examples\n\n```rescript\nlet addIfAboveOne = value =>\n if value > 1 {\n Null.make(value + 1)\n } else {\n Null.null\n }\n\nNull.flatMap(Null.make(2), addIfAboveOne) // Null.make(3)\nNull.flatMap(Null.make(-4), addIfAboveOne) // null\nNull.flatMap(Null.null, addIfAboveOne) // null\n```\n"}, - "sortText": "flatMap", + "documentation": { + "kind": "markdown", + "value": "\n`flatMap(value, f)` returns `f(value)` if `value` is not `null`, otherwise\nreturns `value` unchanged.\n\n## Examples\n\n```rescript\nlet addIfAboveOne = value =>\n if value > 1 {\n Null.make(value + 1)\n } else {\n Null.null\n }\n\nNull.flatMap(Null.make(2), addIfAboveOne) // Null.make(3)\nNull.flatMap(Null.make(-4), addIfAboveOne) // null\nNull.flatMap(Null.null, addIfAboveOne) // null\n```\n" + }, "insertText": "->Null.flatMap", - "additionalTextEdits": [{ - "range": {"start": {"line": 2, "character": 4}, "end": {"line": 2, "character": 5}}, - "newText": "" - }] - }] + "kind": 12, + "label": "->Null.flatMap", + "sortText": "flatMap", + "tags": [] + } +] Complete src/CompletionNullNullable.res 7:5 posCursor:[7:5] posNoWhite:[7:4] Found expr:[7:3->7:5] @@ -208,185 +347,316 @@ ContextPath Value[y] Path y Path Stdlib.Nullable. Path -[{ - "label": "->Nullable.equal", - "kind": 12, - "tags": [], +[ + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 5, "line": 7 }, + "start": { "character": 4, "line": 7 } + } + } + ], "detail": "(t<'a>, t<'b>, ('a, 'b) => bool) => bool", - "documentation": null, - "sortText": "equal", "insertText": "->Nullable.equal", - "additionalTextEdits": [{ - "range": {"start": {"line": 7, "character": 4}, "end": {"line": 7, "character": 5}}, - "newText": "" - }] - }, { - "label": "->Nullable.getUnsafe", "kind": 12, - "tags": [], + "label": "->Nullable.equal", + "sortText": "equal", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 5, "line": 7 }, + "start": { "character": 4, "line": 7 } + } + } + ], "detail": "t<'a> => 'a", - "documentation": {"kind": "markdown", "value": "\n`getUnsafe(value)` returns `value`.\n\n## Examples\n\n```rescript\nNullable.getUnsafe(Nullable.make(3)) == 3\nNullable.getUnsafe(Nullable.null) // Throws an error\n```\n\n## Important\n\n- This is an unsafe operation, it assumes `value` is not `null` or `undefined`.\n"}, - "sortText": "getUnsafe", + "documentation": { + "kind": "markdown", + "value": "\n`getUnsafe(value)` returns `value`.\n\n## Examples\n\n```rescript\nNullable.getUnsafe(Nullable.make(3)) == 3\nNullable.getUnsafe(Nullable.null) // Throws an error\n```\n\n## Important\n\n- This is an unsafe operation, it assumes `value` is not `null` or `undefined`.\n" + }, "insertText": "->Nullable.getUnsafe", - "additionalTextEdits": [{ - "range": {"start": {"line": 7, "character": 4}, "end": {"line": 7, "character": 5}}, - "newText": "" - }] - }, { - "label": "->Nullable.map", "kind": 12, - "tags": [], + "label": "->Nullable.getUnsafe", + "sortText": "getUnsafe", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 5, "line": 7 }, + "start": { "character": 4, "line": 7 } + } + } + ], "detail": "(t<'a>, 'a => 'b) => t<'b>", - "documentation": {"kind": "markdown", "value": "\n`map(value, f)` returns `f(value)` if `value` is not `null` or `undefined`,\notherwise returns `value` unchanged.\n\n## Examples\n\n```rescript\nNullable.map(Nullable.make(3), x => x * x) // Nullable.make(9)\nNullable.map(undefined, x => x * x) // undefined\n```\n"}, - "sortText": "map", + "documentation": { + "kind": "markdown", + "value": "\n`map(value, f)` returns `f(value)` if `value` is not `null` or `undefined`,\notherwise returns `value` unchanged.\n\n## Examples\n\n```rescript\nNullable.map(Nullable.make(3), x => x * x) // Nullable.make(9)\nNullable.map(undefined, x => x * x) // undefined\n```\n" + }, "insertText": "->Nullable.map", - "additionalTextEdits": [{ - "range": {"start": {"line": 7, "character": 4}, "end": {"line": 7, "character": 5}}, - "newText": "" - }] - }, { - "label": "->Nullable.getExn", "kind": 12, - "tags": [1], + "label": "->Nullable.map", + "sortText": "map", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 5, "line": 7 }, + "start": { "character": 4, "line": 7 } + } + } + ], + "deprecated": true, "detail": "t<'a> => 'a", - "documentation": {"kind": "markdown", "value": "Deprecated: Use `getOrThrow` instead\n\n\n`getExn(value)` throws an exception if `null` or `undefined`, otherwise returns the value.\n\n```rescript\nswitch Nullable.getExn(%raw(\"'Hello'\")) {\n| exception Invalid_argument(_) => assert(false)\n| value => value == \"Hello\"\n}\n\nswitch Nullable.getExn(%raw(\"null\")) {\n| exception Invalid_argument(_) => assert(true)\n| _ => assert(false)\n}\n\nswitch Nullable.getExn(%raw(\"undefined\")) {\n| exception Invalid_argument(_) => assert(true)\n| _ => assert(false)\n}\n```\n\n## Exceptions\n\n- Throws `Invalid_argument` if `value` is `null` or `undefined`\n"}, - "sortText": "getExn", + "documentation": { + "kind": "markdown", + "value": "Deprecated: Use `getOrThrow` instead\n\n\n`getExn(value)` throws an exception if `null` or `undefined`, otherwise returns the value.\n\n```rescript\nswitch Nullable.getExn(%raw(\"'Hello'\")) {\n| exception Invalid_argument(_) => assert(false)\n| value => value == \"Hello\"\n}\n\nswitch Nullable.getExn(%raw(\"null\")) {\n| exception Invalid_argument(_) => assert(true)\n| _ => assert(false)\n}\n\nswitch Nullable.getExn(%raw(\"undefined\")) {\n| exception Invalid_argument(_) => assert(true)\n| _ => assert(false)\n}\n```\n\n## Exceptions\n\n- Throws `Invalid_argument` if `value` is `null` or `undefined`\n" + }, "insertText": "->Nullable.getExn", - "additionalTextEdits": [{ - "range": {"start": {"line": 7, "character": 4}, "end": {"line": 7, "character": 5}}, - "newText": "" - }] - }, { - "label": "->Nullable.compare", "kind": 12, - "tags": [], + "label": "->Nullable.getExn", + "sortText": "getExn", + "tags": [ 1 ] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 5, "line": 7 }, + "start": { "character": 4, "line": 7 } + } + } + ], "detail": "(t<'a>, t<'b>, ('a, 'b) => Ordering.t) => Ordering.t", - "documentation": null, - "sortText": "compare", "insertText": "->Nullable.compare", - "additionalTextEdits": [{ - "range": {"start": {"line": 7, "character": 4}, "end": {"line": 7, "character": 5}}, - "newText": "" - }] - }, { - "label": "->Nullable.ignore", "kind": 12, - "tags": [], + "label": "->Nullable.compare", + "sortText": "compare", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 5, "line": 7 }, + "start": { "character": 4, "line": 7 } + } + } + ], "detail": "t<'a> => unit", - "documentation": {"kind": "markdown", "value": "\n `ignore(nullable)` ignores the provided nullable and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further.\n"}, - "sortText": "ignore", + "documentation": { + "kind": "markdown", + "value": "\n `ignore(nullable)` ignores the provided nullable and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further.\n" + }, "insertText": "->Nullable.ignore", - "additionalTextEdits": [{ - "range": {"start": {"line": 7, "character": 4}, "end": {"line": 7, "character": 5}}, - "newText": "" - }] - }, { - "label": "->Nullable.getOrThrow", "kind": 12, - "tags": [], + "label": "->Nullable.ignore", + "sortText": "ignore", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 5, "line": 7 }, + "start": { "character": 4, "line": 7 } + } + } + ], "detail": "t<'a> => 'a", - "documentation": {"kind": "markdown", "value": "\n`getOrThrow(value)` throws an exception if `null` or `undefined`, otherwise returns the value.\n\n```rescript\nswitch Nullable.getOrThrow(%raw(\"'Hello'\")) {\n| exception Invalid_argument(_) => assert(false)\n| value => value == \"Hello\"\n}\n\nswitch Nullable.getOrThrow(%raw(\"null\")) {\n| exception Invalid_argument(_) => assert(true)\n| _ => assert(false)\n}\n\nswitch Nullable.getOrThrow(%raw(\"undefined\")) {\n| exception Invalid_argument(_) => assert(true)\n| _ => assert(false)\n}\n```\n\n## Exceptions\n\n- Throws `Invalid_argument` if `value` is `null` or `undefined`\n"}, - "sortText": "getOrThrow", + "documentation": { + "kind": "markdown", + "value": "\n`getOrThrow(value)` throws an exception if `null` or `undefined`, otherwise returns the value.\n\n```rescript\nswitch Nullable.getOrThrow(%raw(\"'Hello'\")) {\n| exception Invalid_argument(_) => assert(false)\n| value => value == \"Hello\"\n}\n\nswitch Nullable.getOrThrow(%raw(\"null\")) {\n| exception Invalid_argument(_) => assert(true)\n| _ => assert(false)\n}\n\nswitch Nullable.getOrThrow(%raw(\"undefined\")) {\n| exception Invalid_argument(_) => assert(true)\n| _ => assert(false)\n}\n```\n\n## Exceptions\n\n- Throws `Invalid_argument` if `value` is `null` or `undefined`\n" + }, "insertText": "->Nullable.getOrThrow", - "additionalTextEdits": [{ - "range": {"start": {"line": 7, "character": 4}, "end": {"line": 7, "character": 5}}, - "newText": "" - }] - }, { - "label": "->Nullable.toOption", "kind": 12, - "tags": [], + "label": "->Nullable.getOrThrow", + "sortText": "getOrThrow", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 5, "line": 7 }, + "start": { "character": 4, "line": 7 } + } + } + ], "detail": "t<'a> => option<'a>", - "documentation": {"kind": "markdown", "value": "\nConverts a nullable value into an option, so it can be pattern matched on.\nWill convert both `null` and `undefined` to `None`, and a present value to `Some(value)`.\n\n## Examples\n```rescript\nlet nullableString = Nullable.make(\"Hello\")\n\nswitch nullableString->Nullable.toOption {\n| Some(str) => Console.log2(\"Got string:\", str)\n| None => Console.log(\"Didn't have a value.\")\n}\n```\n"}, - "sortText": "toOption", + "documentation": { + "kind": "markdown", + "value": "\nConverts a nullable value into an option, so it can be pattern matched on.\nWill convert both `null` and `undefined` to `None`, and a present value to `Some(value)`.\n\n## Examples\n```rescript\nlet nullableString = Nullable.make(\"Hello\")\n\nswitch nullableString->Nullable.toOption {\n| Some(str) => Console.log2(\"Got string:\", str)\n| None => Console.log(\"Didn't have a value.\")\n}\n```\n" + }, "insertText": "->Nullable.toOption", - "additionalTextEdits": [{ - "range": {"start": {"line": 7, "character": 4}, "end": {"line": 7, "character": 5}}, - "newText": "" - }] - }, { - "label": "->Nullable.getOr", "kind": 12, - "tags": [], + "label": "->Nullable.toOption", + "sortText": "toOption", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 5, "line": 7 }, + "start": { "character": 4, "line": 7 } + } + } + ], "detail": "(t<'a>, 'a) => 'a", - "documentation": {"kind": "markdown", "value": "\n`getOr(value, default)` returns `value` if not `null` or `undefined`,\notherwise return `default`.\n\n## Examples\n\n```rescript\nNullable.getOr(Nullable.null, \"Banana\") // Banana\nNullable.getOr(Nullable.make(\"Apple\"), \"Banana\") // Apple\n\nlet greet = (firstName: option) => \"Greetings \" ++ firstName->Option.getOr(\"Anonymous\")\n\nNullable.make(\"Jane\")->Nullable.toOption->greet // \"Greetings Jane\"\nNullable.null->Nullable.toOption->greet // \"Greetings Anonymous\"\n```\n"}, - "sortText": "getOr", + "documentation": { + "kind": "markdown", + "value": "\n`getOr(value, default)` returns `value` if not `null` or `undefined`,\notherwise return `default`.\n\n## Examples\n\n```rescript\nNullable.getOr(Nullable.null, \"Banana\") // Banana\nNullable.getOr(Nullable.make(\"Apple\"), \"Banana\") // Apple\n\nlet greet = (firstName: option) => \"Greetings \" ++ firstName->Option.getOr(\"Anonymous\")\n\nNullable.make(\"Jane\")->Nullable.toOption->greet // \"Greetings Jane\"\nNullable.null->Nullable.toOption->greet // \"Greetings Anonymous\"\n```\n" + }, "insertText": "->Nullable.getOr", - "additionalTextEdits": [{ - "range": {"start": {"line": 7, "character": 4}, "end": {"line": 7, "character": 5}}, - "newText": "" - }] - }, { - "label": "->Nullable.mapOr", "kind": 12, - "tags": [], + "label": "->Nullable.getOr", + "sortText": "getOr", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 5, "line": 7 }, + "start": { "character": 4, "line": 7 } + } + } + ], "detail": "(t<'a>, 'b, 'a => 'b) => 'b", - "documentation": {"kind": "markdown", "value": "\n`mapOr(value, default, f)` returns `f(value)` if `value` is not `null`\nor `undefined`, otherwise returns `default`.\n\n## Examples\n\n```rescript\nlet someValue = Nullable.make(3)\nsomeValue->Nullable.mapOr(0, x => x + 5) // 8\n\nlet noneValue = Nullable.null\nnoneValue->Nullable.mapOr(0, x => x + 5) // 0\n```\n"}, - "sortText": "mapOr", + "documentation": { + "kind": "markdown", + "value": "\n`mapOr(value, default, f)` returns `f(value)` if `value` is not `null`\nor `undefined`, otherwise returns `default`.\n\n## Examples\n\n```rescript\nlet someValue = Nullable.make(3)\nsomeValue->Nullable.mapOr(0, x => x + 5) // 8\n\nlet noneValue = Nullable.null\nnoneValue->Nullable.mapOr(0, x => x + 5) // 0\n```\n" + }, "insertText": "->Nullable.mapOr", - "additionalTextEdits": [{ - "range": {"start": {"line": 7, "character": 4}, "end": {"line": 7, "character": 5}}, - "newText": "" - }] - }, { - "label": "->Nullable.mapWithDefault", "kind": 12, - "tags": [1], + "label": "->Nullable.mapOr", + "sortText": "mapOr", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 5, "line": 7 }, + "start": { "character": 4, "line": 7 } + } + } + ], + "deprecated": true, "detail": "(t<'a>, 'b, 'a => 'b) => 'b", - "documentation": {"kind": "markdown", "value": "Deprecated: Use mapOr instead\n\n"}, - "sortText": "mapWithDefault", + "documentation": { + "kind": "markdown", + "value": "Deprecated: Use mapOr instead\n\n" + }, "insertText": "->Nullable.mapWithDefault", - "additionalTextEdits": [{ - "range": {"start": {"line": 7, "character": 4}, "end": {"line": 7, "character": 5}}, - "newText": "" - }] - }, { - "label": "->Nullable.getWithDefault", "kind": 12, - "tags": [1], + "label": "->Nullable.mapWithDefault", + "sortText": "mapWithDefault", + "tags": [ 1 ] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 5, "line": 7 }, + "start": { "character": 4, "line": 7 } + } + } + ], + "deprecated": true, "detail": "(t<'a>, 'a) => 'a", - "documentation": {"kind": "markdown", "value": "Deprecated: Use getOr instead\n\n"}, - "sortText": "getWithDefault", + "documentation": { + "kind": "markdown", + "value": "Deprecated: Use getOr instead\n\n" + }, "insertText": "->Nullable.getWithDefault", - "additionalTextEdits": [{ - "range": {"start": {"line": 7, "character": 4}, "end": {"line": 7, "character": 5}}, - "newText": "" - }] - }, { - "label": "->Nullable.isNullable", "kind": 12, - "tags": [], + "label": "->Nullable.getWithDefault", + "sortText": "getWithDefault", + "tags": [ 1 ] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 5, "line": 7 }, + "start": { "character": 4, "line": 7 } + } + } + ], "detail": "t<'a> => bool", - "documentation": {"kind": "markdown", "value": "\n`isNullable(a)` returns `true` if `a` is null or undefined, `false` otherwise.\n\n## Examples\n\n```rescript\nlet myStr = \"Hello\"\nlet asNullable = myStr->Nullable.make\n\n// Can't do the below because we're now forced to check for nullability\n// myStr == asNullable\n\n// Check if asNullable is not null or undefined\nswitch asNullable->Nullable.isNullable {\n| true => assert(false)\n| false => assert(true)\n}\n```\n"}, - "sortText": "isNullable", + "documentation": { + "kind": "markdown", + "value": "\n`isNullable(a)` returns `true` if `a` is null or undefined, `false` otherwise.\n\n## Examples\n\n```rescript\nlet myStr = \"Hello\"\nlet asNullable = myStr->Nullable.make\n\n// Can't do the below because we're now forced to check for nullability\n// myStr == asNullable\n\n// Check if asNullable is not null or undefined\nswitch asNullable->Nullable.isNullable {\n| true => assert(false)\n| false => assert(true)\n}\n```\n" + }, "insertText": "->Nullable.isNullable", - "additionalTextEdits": [{ - "range": {"start": {"line": 7, "character": 4}, "end": {"line": 7, "character": 5}}, - "newText": "" - }] - }, { - "label": "->Nullable.forEach", "kind": 12, - "tags": [], + "label": "->Nullable.isNullable", + "sortText": "isNullable", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 5, "line": 7 }, + "start": { "character": 4, "line": 7 } + } + } + ], "detail": "(t<'a>, 'a => unit) => unit", - "documentation": {"kind": "markdown", "value": "\n`forEach(value, f)` call `f` on `value`. if `value` is not `null` or `undefined`,\nthen if calls `f`, otherwise returns `unit`.\n\n## Examples\n\n```rescript\nNullable.forEach(Nullable.make(\"thing\"), x => Console.log(x)) // logs \"thing\"\nNullable.forEach(Nullable.null, x => Console.log(x)) // returns ()\nNullable.forEach(undefined, x => Console.log(x)) // returns ()\n```\n"}, - "sortText": "forEach", + "documentation": { + "kind": "markdown", + "value": "\n`forEach(value, f)` call `f` on `value`. if `value` is not `null` or `undefined`,\nthen if calls `f`, otherwise returns `unit`.\n\n## Examples\n\n```rescript\nNullable.forEach(Nullable.make(\"thing\"), x => Console.log(x)) // logs \"thing\"\nNullable.forEach(Nullable.null, x => Console.log(x)) // returns ()\nNullable.forEach(undefined, x => Console.log(x)) // returns ()\n```\n" + }, "insertText": "->Nullable.forEach", - "additionalTextEdits": [{ - "range": {"start": {"line": 7, "character": 4}, "end": {"line": 7, "character": 5}}, - "newText": "" - }] - }, { - "label": "->Nullable.flatMap", "kind": 12, - "tags": [], + "label": "->Nullable.forEach", + "sortText": "forEach", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 5, "line": 7 }, + "start": { "character": 4, "line": 7 } + } + } + ], "detail": "(t<'a>, 'a => t<'b>) => t<'b>", - "documentation": {"kind": "markdown", "value": "\n`flatMap(value, f)` returns `f(value)` if `value` is not `null` or `undefined`,\notherwise returns `value` unchanged.\n\n## Examples\n\n```rescript\nlet addIfAboveOne = value =>\n if value > 1 {\n Nullable.make(value + 1)\n } else {\n Nullable.null\n }\n\nNullable.flatMap(Nullable.make(2), addIfAboveOne) // Nullable.make(3)\nNullable.flatMap(Nullable.make(-4), addIfAboveOne) // undefined\nNullable.flatMap(Nullable.null, addIfAboveOne) // undefined\n```\n"}, - "sortText": "flatMap", + "documentation": { + "kind": "markdown", + "value": "\n`flatMap(value, f)` returns `f(value)` if `value` is not `null` or `undefined`,\notherwise returns `value` unchanged.\n\n## Examples\n\n```rescript\nlet addIfAboveOne = value =>\n if value > 1 {\n Nullable.make(value + 1)\n } else {\n Nullable.null\n }\n\nNullable.flatMap(Nullable.make(2), addIfAboveOne) // Nullable.make(3)\nNullable.flatMap(Nullable.make(-4), addIfAboveOne) // undefined\nNullable.flatMap(Nullable.null, addIfAboveOne) // undefined\n```\n" + }, "insertText": "->Nullable.flatMap", - "additionalTextEdits": [{ - "range": {"start": {"line": 7, "character": 4}, "end": {"line": 7, "character": 5}}, - "newText": "" - }] - }] + "kind": 12, + "label": "->Nullable.flatMap", + "sortText": "flatMap", + "tags": [] + } +] diff --git a/tests/analysis_tests/tests/src/expected/CompletionObjects.res.txt b/tests/analysis_tests/tests/src/expected/CompletionObjects.res.txt index aeee22461dc..8bc83dda759 100644 --- a/tests/analysis_tests/tests/src/expected/CompletionObjects.res.txt +++ b/tests/analysis_tests/tests/src/expected/CompletionObjects.res.txt @@ -8,31 +8,17 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Value[x] Path x -[{ - "label": "None", - "kind": 12, - "tags": [], - "detail": "bool", - "documentation": null - }, { - "label": "Some(_)", - "kind": 12, - "tags": [], +[ + { "detail": "bool", "kind": 12, "label": "None", "tags": [] }, + { "detail": "bool", - "documentation": null, "insertText": "Some(${1:_})", - "insertTextFormat": 2 - }, { - "label": "Some(true)", - "kind": 4, - "tags": [], - "detail": "bool", - "documentation": null - }, { - "label": "Some(false)", - "kind": 4, - "tags": [], - "detail": "bool", - "documentation": null - }] + "insertTextFormat": 2, + "kind": 12, + "label": "Some(_)", + "tags": [] + }, + { "detail": "bool", "kind": 4, "label": "Some(true)", "tags": [] }, + { "detail": "bool", "kind": 4, "label": "Some(false)", "tags": [] } +] diff --git a/tests/analysis_tests/tests/src/expected/CompletionPattern.res.txt b/tests/analysis_tests/tests/src/expected/CompletionPattern.res.txt index 3ee897359ec..bd60dbe226c 100644 --- a/tests/analysis_tests/tests/src/expected/CompletionPattern.res.txt +++ b/tests/analysis_tests/tests/src/expected/CompletionPattern.res.txt @@ -9,15 +9,16 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Value[v] Path v -[{ - "label": "(_, _, _)", - "kind": 12, - "tags": [], +[ + { "detail": "(bool, option, (bool, bool))", - "documentation": null, "insertText": "(${1:_}, ${2:_}, ${3:_})", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 12, + "label": "(_, _, _)", + "tags": [] + } +] Complete src/CompletionPattern.res 13:18 posCursor:[13:18] posNoWhite:[13:17] Found pattern:[13:16->13:22] @@ -27,13 +28,7 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Value[v] Path v -[{ - "label": "true", - "kind": 4, - "tags": [], - "detail": "bool", - "documentation": null - }] +[ { "detail": "bool", "kind": 4, "label": "true", "tags": [] } ] Complete src/CompletionPattern.res 16:25 posCursor:[16:25] posNoWhite:[16:24] Found pattern:[16:16->16:30] @@ -44,13 +39,7 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Value[v] Path v -[{ - "label": "false", - "kind": 4, - "tags": [], - "detail": "bool", - "documentation": null - }] +[ { "detail": "bool", "kind": 4, "label": "false", "tags": [] } ] Complete src/CompletionPattern.res 21:15 XXX Not found! @@ -59,19 +48,10 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Value[x] Path x -[{ - "label": "true", - "kind": 4, - "tags": [], - "detail": "bool", - "documentation": null - }, { - "label": "false", - "kind": 4, - "tags": [], - "detail": "bool", - "documentation": null - }] +[ + { "detail": "bool", "kind": 4, "label": "true", "tags": [] }, + { "detail": "bool", "kind": 4, "label": "false", "tags": [] } +] Complete src/CompletionPattern.res 24:17 posCursor:[24:17] posNoWhite:[24:16] Found pattern:[24:16->24:17] @@ -80,13 +60,7 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Value[x] Path x -[{ - "label": "true", - "kind": 4, - "tags": [], - "detail": "bool", - "documentation": null - }] +[ { "detail": "bool", "kind": 4, "label": "true", "tags": [] } ] Complete src/CompletionPattern.res 46:15 XXX Not found! @@ -95,16 +69,21 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Value[f] Path f -[{ - "label": "{}", - "kind": 22, - "tags": [], +[ + { "detail": "someRecord", - "documentation": {"kind": "markdown", "value": "```rescript\ntype someRecord = {first: int, second: (bool, option), optThird: option<[#first | #second(someRecord)]>, nest: nestedRecord}\n```"}, - "sortText": "A", + "documentation": { + "kind": "markdown", + "value": "```rescript\ntype someRecord = {first: int, second: (bool, option), optThird: option<[#first | #second(someRecord)]>, nest: nestedRecord}\n```" + }, "insertText": "{$0}", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 22, + "label": "{}", + "sortText": "A", + "tags": [] + } +] Complete src/CompletionPattern.res 49:17 posCursor:[49:17] posNoWhite:[49:16] Found pattern:[49:16->49:18] @@ -113,31 +92,48 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Value[f] Path f -[{ - "label": "first", - "kind": 5, - "tags": [], +[ + { "detail": "int", - "documentation": {"kind": "markdown", "value": "```rescript\nfirst: int\n```\n\n```rescript\ntype someRecord = {first: int, second: (bool, option), optThird: option<[#first | #second(someRecord)]>, nest: nestedRecord}\n```"} - }, { - "label": "second", + "documentation": { + "kind": "markdown", + "value": "```rescript\nfirst: int\n```\n\n```rescript\ntype someRecord = {first: int, second: (bool, option), optThird: option<[#first | #second(someRecord)]>, nest: nestedRecord}\n```" + }, "kind": 5, - "tags": [], + "label": "first", + "tags": [] + }, + { "detail": "(bool, option)", - "documentation": {"kind": "markdown", "value": "```rescript\nsecond: (bool, option)\n```\n\n```rescript\ntype someRecord = {first: int, second: (bool, option), optThird: option<[#first | #second(someRecord)]>, nest: nestedRecord}\n```"} - }, { - "label": "optThird", + "documentation": { + "kind": "markdown", + "value": "```rescript\nsecond: (bool, option)\n```\n\n```rescript\ntype someRecord = {first: int, second: (bool, option), optThird: option<[#first | #second(someRecord)]>, nest: nestedRecord}\n```" + }, "kind": 5, - "tags": [], + "label": "second", + "tags": [] + }, + { "detail": "option<[#first | #second(someRecord)]>", - "documentation": {"kind": "markdown", "value": "```rescript\noptThird: option<[#first | #second(someRecord)]>\n```\n\n```rescript\ntype someRecord = {first: int, second: (bool, option), optThird: option<[#first | #second(someRecord)]>, nest: nestedRecord}\n```"} - }, { - "label": "nest", + "documentation": { + "kind": "markdown", + "value": "```rescript\noptThird: option<[#first | #second(someRecord)]>\n```\n\n```rescript\ntype someRecord = {first: int, second: (bool, option), optThird: option<[#first | #second(someRecord)]>, nest: nestedRecord}\n```" + }, "kind": 5, - "tags": [], + "label": "optThird", + "tags": [] + }, + { "detail": "nestedRecord", - "documentation": {"kind": "markdown", "value": "```rescript\nnest: nestedRecord\n```\n\n```rescript\ntype someRecord = {first: int, second: (bool, option), optThird: option<[#first | #second(someRecord)]>, nest: nestedRecord}\n```"} - }] + "documentation": { + "kind": "markdown", + "value": "```rescript\nnest: nestedRecord\n```\n\n```rescript\ntype someRecord = {first: int, second: (bool, option), optThird: option<[#first | #second(someRecord)]>, nest: nestedRecord}\n```" + }, + "kind": 5, + "label": "nest", + "tags": [] + } +] Complete src/CompletionPattern.res 52:24 posCursor:[52:24] posNoWhite:[52:22] Found pattern:[52:16->52:35] @@ -146,19 +142,28 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Value[f] Path f -[{ - "label": "optThird", - "kind": 5, - "tags": [], +[ + { "detail": "option<[#first | #second(someRecord)]>", - "documentation": {"kind": "markdown", "value": "```rescript\noptThird: option<[#first | #second(someRecord)]>\n```\n\n```rescript\ntype someRecord = {first: int, second: (bool, option), optThird: option<[#first | #second(someRecord)]>, nest: nestedRecord}\n```"} - }, { - "label": "nest", + "documentation": { + "kind": "markdown", + "value": "```rescript\noptThird: option<[#first | #second(someRecord)]>\n```\n\n```rescript\ntype someRecord = {first: int, second: (bool, option), optThird: option<[#first | #second(someRecord)]>, nest: nestedRecord}\n```" + }, "kind": 5, - "tags": [], + "label": "optThird", + "tags": [] + }, + { "detail": "nestedRecord", - "documentation": {"kind": "markdown", "value": "```rescript\nnest: nestedRecord\n```\n\n```rescript\ntype someRecord = {first: int, second: (bool, option), optThird: option<[#first | #second(someRecord)]>, nest: nestedRecord}\n```"} - }] + "documentation": { + "kind": "markdown", + "value": "```rescript\nnest: nestedRecord\n```\n\n```rescript\ntype someRecord = {first: int, second: (bool, option), optThird: option<[#first | #second(someRecord)]>, nest: nestedRecord}\n```" + }, + "kind": 5, + "label": "nest", + "tags": [] + } +] Complete src/CompletionPattern.res 55:19 posCursor:[55:19] posNoWhite:[55:18] Found pattern:[55:16->55:20] @@ -168,13 +173,18 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Value[f] Path f -[{ - "label": "first", - "kind": 5, - "tags": [], +[ + { "detail": "int", - "documentation": {"kind": "markdown", "value": "```rescript\nfirst: int\n```\n\n```rescript\ntype someRecord = {first: int, second: (bool, option), optThird: option<[#first | #second(someRecord)]>, nest: nestedRecord}\n```"} - }] + "documentation": { + "kind": "markdown", + "value": "```rescript\nfirst: int\n```\n\n```rescript\ntype someRecord = {first: int, second: (bool, option), optThird: option<[#first | #second(someRecord)]>, nest: nestedRecord}\n```" + }, + "kind": 5, + "label": "first", + "tags": [] + } +] Complete src/CompletionPattern.res 58:19 posCursor:[58:19] posNoWhite:[58:18] Found pattern:[58:16->58:24] @@ -185,13 +195,18 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Value[z] Path z -[{ - "label": "optThird", - "kind": 5, - "tags": [], +[ + { "detail": "option<[#first | #second(someRecord)]>", - "documentation": {"kind": "markdown", "value": "```rescript\noptThird: option<[#first | #second(someRecord)]>\n```\n\n```rescript\ntype someRecord = {first: int, second: (bool, option), optThird: option<[#first | #second(someRecord)]>, nest: nestedRecord}\n```"} - }] + "documentation": { + "kind": "markdown", + "value": "```rescript\noptThird: option<[#first | #second(someRecord)]>\n```\n\n```rescript\ntype someRecord = {first: int, second: (bool, option), optThird: option<[#first | #second(someRecord)]>, nest: nestedRecord}\n```" + }, + "kind": 5, + "label": "optThird", + "tags": [] + } +] Complete src/CompletionPattern.res 61:22 posCursor:[61:22] posNoWhite:[61:21] Found pattern:[61:16->61:25] @@ -200,16 +215,21 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Value[f] Path f -[{ - "label": "{}", - "kind": 22, - "tags": [], +[ + { "detail": "nestedRecord", - "documentation": {"kind": "markdown", "value": "```rescript\ntype nestedRecord = {nested: bool}\n```"}, - "sortText": "A", + "documentation": { + "kind": "markdown", + "value": "```rescript\ntype nestedRecord = {nested: bool}\n```" + }, "insertText": "{$0}", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 22, + "label": "{}", + "sortText": "A", + "tags": [] + } +] Complete src/CompletionPattern.res 64:24 posCursor:[64:24] posNoWhite:[64:23] Found pattern:[64:16->64:26] @@ -219,13 +239,18 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Value[f] Path f -[{ - "label": "nested", - "kind": 5, - "tags": [], +[ + { "detail": "bool", - "documentation": {"kind": "markdown", "value": "```rescript\nnested: bool\n```\n\n```rescript\ntype nestedRecord = {nested: bool}\n```"} - }] + "documentation": { + "kind": "markdown", + "value": "```rescript\nnested: bool\n```\n\n```rescript\ntype nestedRecord = {nested: bool}\n```" + }, + "kind": 5, + "label": "nested", + "tags": [] + } +] Complete src/CompletionPattern.res 70:22 posCursor:[70:22] posNoWhite:[70:21] Found expr:[69:2->72:13] @@ -236,13 +261,18 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Value[nest] Path nest -[{ - "label": "nested", - "kind": 5, - "tags": [], +[ + { "detail": "bool", - "documentation": {"kind": "markdown", "value": "```rescript\nnested: bool\n```\n\n```rescript\ntype nestedRecord = {nested: bool}\n```"} - }] + "documentation": { + "kind": "markdown", + "value": "```rescript\nnested: bool\n```\n\n```rescript\ntype nestedRecord = {nested: bool}\n```" + }, + "kind": 5, + "label": "nested", + "tags": [] + } +] Complete src/CompletionPattern.res 76:8 posCursor:[76:8] posNoWhite:[76:7] Found pattern:[76:7->76:9] @@ -251,31 +281,48 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Value[f] Path f -[{ - "label": "first", - "kind": 5, - "tags": [], +[ + { "detail": "int", - "documentation": {"kind": "markdown", "value": "```rescript\nfirst: int\n```\n\n```rescript\ntype someRecord = {first: int, second: (bool, option), optThird: option<[#first | #second(someRecord)]>, nest: nestedRecord}\n```"} - }, { - "label": "second", + "documentation": { + "kind": "markdown", + "value": "```rescript\nfirst: int\n```\n\n```rescript\ntype someRecord = {first: int, second: (bool, option), optThird: option<[#first | #second(someRecord)]>, nest: nestedRecord}\n```" + }, "kind": 5, - "tags": [], + "label": "first", + "tags": [] + }, + { "detail": "(bool, option)", - "documentation": {"kind": "markdown", "value": "```rescript\nsecond: (bool, option)\n```\n\n```rescript\ntype someRecord = {first: int, second: (bool, option), optThird: option<[#first | #second(someRecord)]>, nest: nestedRecord}\n```"} - }, { - "label": "optThird", + "documentation": { + "kind": "markdown", + "value": "```rescript\nsecond: (bool, option)\n```\n\n```rescript\ntype someRecord = {first: int, second: (bool, option), optThird: option<[#first | #second(someRecord)]>, nest: nestedRecord}\n```" + }, "kind": 5, - "tags": [], + "label": "second", + "tags": [] + }, + { "detail": "option<[#first | #second(someRecord)]>", - "documentation": {"kind": "markdown", "value": "```rescript\noptThird: option<[#first | #second(someRecord)]>\n```\n\n```rescript\ntype someRecord = {first: int, second: (bool, option), optThird: option<[#first | #second(someRecord)]>, nest: nestedRecord}\n```"} - }, { - "label": "nest", + "documentation": { + "kind": "markdown", + "value": "```rescript\noptThird: option<[#first | #second(someRecord)]>\n```\n\n```rescript\ntype someRecord = {first: int, second: (bool, option), optThird: option<[#first | #second(someRecord)]>, nest: nestedRecord}\n```" + }, "kind": 5, - "tags": [], + "label": "optThird", + "tags": [] + }, + { "detail": "nestedRecord", - "documentation": {"kind": "markdown", "value": "```rescript\nnest: nestedRecord\n```\n\n```rescript\ntype someRecord = {first: int, second: (bool, option), optThird: option<[#first | #second(someRecord)]>, nest: nestedRecord}\n```"} - }] + "documentation": { + "kind": "markdown", + "value": "```rescript\nnest: nestedRecord\n```\n\n```rescript\ntype someRecord = {first: int, second: (bool, option), optThird: option<[#first | #second(someRecord)]>, nest: nestedRecord}\n```" + }, + "kind": 5, + "label": "nest", + "tags": [] + } +] Complete src/CompletionPattern.res 79:16 posCursor:[79:16] posNoWhite:[79:15] Found pattern:[79:7->79:18] @@ -286,13 +333,18 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Value[f] Path f -[{ - "label": "nested", - "kind": 5, - "tags": [], +[ + { "detail": "bool", - "documentation": {"kind": "markdown", "value": "```rescript\nnested: bool\n```\n\n```rescript\ntype nestedRecord = {nested: bool}\n```"} - }] + "documentation": { + "kind": "markdown", + "value": "```rescript\nnested: bool\n```\n\n```rescript\ntype nestedRecord = {nested: bool}\n```" + }, + "kind": 5, + "label": "nested", + "tags": [] + } +] Complete src/CompletionPattern.res 87:20 posCursor:[87:20] posNoWhite:[87:19] Found pattern:[87:16->87:21] @@ -304,19 +356,10 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Value[z] Path z -[{ - "label": "true", - "kind": 4, - "tags": [], - "detail": "bool", - "documentation": null - }, { - "label": "false", - "kind": 4, - "tags": [], - "detail": "bool", - "documentation": null - }] +[ + { "detail": "bool", "kind": 4, "label": "true", "tags": [] }, + { "detail": "bool", "kind": 4, "label": "false", "tags": [] } +] Complete src/CompletionPattern.res 90:21 posCursor:[90:21] posNoWhite:[90:20] Found pattern:[90:16->90:22] @@ -327,13 +370,7 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Value[z] Path z -[{ - "label": "true", - "kind": 4, - "tags": [], - "detail": "bool", - "documentation": null - }] +[ { "detail": "bool", "kind": 4, "label": "true", "tags": [] } ] Complete src/CompletionPattern.res 93:23 posCursor:[93:23] posNoWhite:[93:22] Found pattern:[93:16->93:25] @@ -344,31 +381,48 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Value[z] Path z -[{ - "label": "first", - "kind": 5, - "tags": [], +[ + { "detail": "int", - "documentation": {"kind": "markdown", "value": "```rescript\nfirst: int\n```\n\n```rescript\ntype someRecord = {first: int, second: (bool, option), optThird: option<[#first | #second(someRecord)]>, nest: nestedRecord}\n```"} - }, { - "label": "second", + "documentation": { + "kind": "markdown", + "value": "```rescript\nfirst: int\n```\n\n```rescript\ntype someRecord = {first: int, second: (bool, option), optThird: option<[#first | #second(someRecord)]>, nest: nestedRecord}\n```" + }, "kind": 5, - "tags": [], + "label": "first", + "tags": [] + }, + { "detail": "(bool, option)", - "documentation": {"kind": "markdown", "value": "```rescript\nsecond: (bool, option)\n```\n\n```rescript\ntype someRecord = {first: int, second: (bool, option), optThird: option<[#first | #second(someRecord)]>, nest: nestedRecord}\n```"} - }, { - "label": "optThird", + "documentation": { + "kind": "markdown", + "value": "```rescript\nsecond: (bool, option)\n```\n\n```rescript\ntype someRecord = {first: int, second: (bool, option), optThird: option<[#first | #second(someRecord)]>, nest: nestedRecord}\n```" + }, "kind": 5, - "tags": [], + "label": "second", + "tags": [] + }, + { "detail": "option<[#first | #second(someRecord)]>", - "documentation": {"kind": "markdown", "value": "```rescript\noptThird: option<[#first | #second(someRecord)]>\n```\n\n```rescript\ntype someRecord = {first: int, second: (bool, option), optThird: option<[#first | #second(someRecord)]>, nest: nestedRecord}\n```"} - }, { - "label": "nest", + "documentation": { + "kind": "markdown", + "value": "```rescript\noptThird: option<[#first | #second(someRecord)]>\n```\n\n```rescript\ntype someRecord = {first: int, second: (bool, option), optThird: option<[#first | #second(someRecord)]>, nest: nestedRecord}\n```" + }, "kind": 5, - "tags": [], + "label": "optThird", + "tags": [] + }, + { "detail": "nestedRecord", - "documentation": {"kind": "markdown", "value": "```rescript\nnest: nestedRecord\n```\n\n```rescript\ntype someRecord = {first: int, second: (bool, option), optThird: option<[#first | #second(someRecord)]>, nest: nestedRecord}\n```"} - }] + "documentation": { + "kind": "markdown", + "value": "```rescript\nnest: nestedRecord\n```\n\n```rescript\ntype someRecord = {first: int, second: (bool, option), optThird: option<[#first | #second(someRecord)]>, nest: nestedRecord}\n```" + }, + "kind": 5, + "label": "nest", + "tags": [] + } +] Complete src/CompletionPattern.res 96:27 posCursor:[96:27] posNoWhite:[96:26] Found pattern:[96:16->96:28] @@ -380,13 +434,7 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Value[z] Path z -[{ - "label": "true", - "kind": 4, - "tags": [], - "detail": "bool", - "documentation": null - }] +[ { "detail": "bool", "kind": 4, "label": "true", "tags": [] } ] Complete src/CompletionPattern.res 103:21 posCursor:[103:21] posNoWhite:[103:20] Found pattern:[103:16->103:22] @@ -397,19 +445,10 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Value[b] Path b -[{ - "label": "true", - "kind": 4, - "tags": [], - "detail": "bool", - "documentation": null - }, { - "label": "false", - "kind": 4, - "tags": [], - "detail": "bool", - "documentation": null - }] +[ + { "detail": "bool", "kind": 4, "label": "true", "tags": [] }, + { "detail": "bool", "kind": 4, "label": "false", "tags": [] } +] Complete src/CompletionPattern.res 106:22 posCursor:[106:22] posNoWhite:[106:21] Found pattern:[106:16->106:23] @@ -419,13 +458,7 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Value[b] Path b -[{ - "label": "true", - "kind": 4, - "tags": [], - "detail": "bool", - "documentation": null - }] +[ { "detail": "bool", "kind": 4, "label": "true", "tags": [] } ] Complete src/CompletionPattern.res 109:24 posCursor:[109:24] posNoWhite:[109:23] Found pattern:[109:16->109:26] @@ -435,31 +468,48 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Value[b] Path b -[{ - "label": "first", - "kind": 5, - "tags": [], +[ + { "detail": "int", - "documentation": {"kind": "markdown", "value": "```rescript\nfirst: int\n```\n\n```rescript\ntype someRecord = {first: int, second: (bool, option), optThird: option<[#first | #second(someRecord)]>, nest: nestedRecord}\n```"} - }, { - "label": "second", + "documentation": { + "kind": "markdown", + "value": "```rescript\nfirst: int\n```\n\n```rescript\ntype someRecord = {first: int, second: (bool, option), optThird: option<[#first | #second(someRecord)]>, nest: nestedRecord}\n```" + }, "kind": 5, - "tags": [], + "label": "first", + "tags": [] + }, + { "detail": "(bool, option)", - "documentation": {"kind": "markdown", "value": "```rescript\nsecond: (bool, option)\n```\n\n```rescript\ntype someRecord = {first: int, second: (bool, option), optThird: option<[#first | #second(someRecord)]>, nest: nestedRecord}\n```"} - }, { - "label": "optThird", + "documentation": { + "kind": "markdown", + "value": "```rescript\nsecond: (bool, option)\n```\n\n```rescript\ntype someRecord = {first: int, second: (bool, option), optThird: option<[#first | #second(someRecord)]>, nest: nestedRecord}\n```" + }, "kind": 5, - "tags": [], + "label": "second", + "tags": [] + }, + { "detail": "option<[#first | #second(someRecord)]>", - "documentation": {"kind": "markdown", "value": "```rescript\noptThird: option<[#first | #second(someRecord)]>\n```\n\n```rescript\ntype someRecord = {first: int, second: (bool, option), optThird: option<[#first | #second(someRecord)]>, nest: nestedRecord}\n```"} - }, { - "label": "nest", + "documentation": { + "kind": "markdown", + "value": "```rescript\noptThird: option<[#first | #second(someRecord)]>\n```\n\n```rescript\ntype someRecord = {first: int, second: (bool, option), optThird: option<[#first | #second(someRecord)]>, nest: nestedRecord}\n```" + }, "kind": 5, - "tags": [], + "label": "optThird", + "tags": [] + }, + { "detail": "nestedRecord", - "documentation": {"kind": "markdown", "value": "```rescript\nnest: nestedRecord\n```\n\n```rescript\ntype someRecord = {first: int, second: (bool, option), optThird: option<[#first | #second(someRecord)]>, nest: nestedRecord}\n```"} - }] + "documentation": { + "kind": "markdown", + "value": "```rescript\nnest: nestedRecord\n```\n\n```rescript\ntype someRecord = {first: int, second: (bool, option), optThird: option<[#first | #second(someRecord)]>, nest: nestedRecord}\n```" + }, + "kind": 5, + "label": "nest", + "tags": [] + } +] Complete src/CompletionPattern.res 112:28 posCursor:[112:28] posNoWhite:[112:27] Found pattern:[112:16->112:29] @@ -470,13 +520,7 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Value[b] Path b -[{ - "label": "true", - "kind": 4, - "tags": [], - "detail": "bool", - "documentation": null - }] +[ { "detail": "bool", "kind": 4, "label": "true", "tags": [] } ] Complete src/CompletionPattern.res 118:15 XXX Not found! @@ -485,16 +529,17 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Value[c] Path c -[{ - "label": "[]", - "kind": 12, - "tags": [], +[ + { "detail": "bool", - "documentation": null, - "sortText": "A", "insertText": "[$0]", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 12, + "label": "[]", + "sortText": "A", + "tags": [] + } +] Complete src/CompletionPattern.res 121:17 posCursor:[121:17] posNoWhite:[121:16] Found pattern:[121:16->121:18] @@ -503,19 +548,10 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Value[c] Path c -[{ - "label": "true", - "kind": 4, - "tags": [], - "detail": "bool", - "documentation": null - }, { - "label": "false", - "kind": 4, - "tags": [], - "detail": "bool", - "documentation": null - }] +[ + { "detail": "bool", "kind": 4, "label": "true", "tags": [] }, + { "detail": "bool", "kind": 4, "label": "false", "tags": [] } +] Complete src/CompletionPattern.res 127:21 posCursor:[127:21] posNoWhite:[127:20] Found pattern:[127:16->127:22] @@ -527,19 +563,10 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Value[o] Path o -[{ - "label": "true", - "kind": 4, - "tags": [], - "detail": "bool", - "documentation": null - }, { - "label": "false", - "kind": 4, - "tags": [], - "detail": "bool", - "documentation": null - }] +[ + { "detail": "bool", "kind": 4, "label": "true", "tags": [] }, + { "detail": "bool", "kind": 4, "label": "false", "tags": [] } +] Complete src/CompletionPattern.res 134:23 posCursor:[134:23] posNoWhite:[134:22] Found pattern:[134:16->134:25] @@ -549,19 +576,10 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Value[p] Path p -[{ - "label": "true", - "kind": 4, - "tags": [], - "detail": "bool", - "documentation": null - }, { - "label": "false", - "kind": 4, - "tags": [], - "detail": "bool", - "documentation": null - }] +[ + { "detail": "bool", "kind": 4, "label": "true", "tags": [] }, + { "detail": "bool", "kind": 4, "label": "false", "tags": [] } +] Complete src/CompletionPattern.res 137:29 posCursor:[137:29] posNoWhite:[137:28] Found pattern:[137:16->137:31] @@ -572,33 +590,19 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Value[p] Path p -[{ - "label": "None", - "kind": 12, - "tags": [], +[ + { "detail": "bool", "kind": 12, "label": "None", "tags": [] }, + { "detail": "bool", - "documentation": null - }, { - "label": "Some(_)", - "kind": 12, - "tags": [], - "detail": "bool", - "documentation": null, "insertText": "Some(${1:_})", - "insertTextFormat": 2 - }, { - "label": "Some(true)", - "kind": 4, - "tags": [], - "detail": "bool", - "documentation": null - }, { - "label": "Some(false)", - "kind": 4, - "tags": [], - "detail": "bool", - "documentation": null - }] + "insertTextFormat": 2, + "kind": 12, + "label": "Some(_)", + "tags": [] + }, + { "detail": "bool", "kind": 4, "label": "Some(true)", "tags": [] }, + { "detail": "bool", "kind": 4, "label": "Some(false)", "tags": [] } +] Complete src/CompletionPattern.res 140:23 posCursor:[140:23] posNoWhite:[140:22] Found pattern:[140:16->140:31] @@ -609,19 +613,10 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Value[p] Path p -[{ - "label": "true", - "kind": 4, - "tags": [], - "detail": "bool", - "documentation": null - }, { - "label": "false", - "kind": 4, - "tags": [], - "detail": "bool", - "documentation": null - }] +[ + { "detail": "bool", "kind": 4, "label": "true", "tags": [] }, + { "detail": "bool", "kind": 4, "label": "false", "tags": [] } +] Complete src/CompletionPattern.res 143:35 posCursor:[143:35] posNoWhite:[143:34] Found pattern:[143:16->143:37] @@ -632,16 +627,17 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Value[p] Path p -[{ - "label": "[]", - "kind": 12, - "tags": [], +[ + { "detail": "bool", - "documentation": null, - "sortText": "A", "insertText": "[$0]", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 12, + "label": "[]", + "sortText": "A", + "tags": [] + } +] Complete src/CompletionPattern.res 150:24 posCursor:[150:24] posNoWhite:[150:23] Found pattern:[150:16->150:26] @@ -650,19 +646,10 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Value[v] Path v -[{ - "label": "true", - "kind": 4, - "tags": [], - "detail": "bool", - "documentation": null - }, { - "label": "false", - "kind": 4, - "tags": [], - "detail": "bool", - "documentation": null - }] +[ + { "detail": "bool", "kind": 4, "label": "true", "tags": [] }, + { "detail": "bool", "kind": 4, "label": "false", "tags": [] } +] Complete src/CompletionPattern.res 153:30 posCursor:[153:30] posNoWhite:[153:29] Found pattern:[153:16->153:32] @@ -672,33 +659,19 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Value[v] Path v -[{ - "label": "None", - "kind": 12, - "tags": [], +[ + { "detail": "bool", "kind": 12, "label": "None", "tags": [] }, + { "detail": "bool", - "documentation": null - }, { - "label": "Some(_)", - "kind": 12, - "tags": [], - "detail": "bool", - "documentation": null, "insertText": "Some(${1:_})", - "insertTextFormat": 2 - }, { - "label": "Some(true)", - "kind": 4, - "tags": [], - "detail": "bool", - "documentation": null - }, { - "label": "Some(false)", - "kind": 4, - "tags": [], - "detail": "bool", - "documentation": null - }] + "insertTextFormat": 2, + "kind": 12, + "label": "Some(_)", + "tags": [] + }, + { "detail": "bool", "kind": 4, "label": "Some(true)", "tags": [] }, + { "detail": "bool", "kind": 4, "label": "Some(false)", "tags": [] } +] Complete src/CompletionPattern.res 156:24 posCursor:[156:24] posNoWhite:[156:23] Found pattern:[156:16->156:32] @@ -708,19 +681,10 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Value[v] Path v -[{ - "label": "true", - "kind": 4, - "tags": [], - "detail": "bool", - "documentation": null - }, { - "label": "false", - "kind": 4, - "tags": [], - "detail": "bool", - "documentation": null - }] +[ + { "detail": "bool", "kind": 4, "label": "true", "tags": [] }, + { "detail": "bool", "kind": 4, "label": "false", "tags": [] } +] Complete src/CompletionPattern.res 159:36 posCursor:[159:36] posNoWhite:[159:35] Found pattern:[159:16->159:38] @@ -730,16 +694,17 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Value[v] Path v -[{ - "label": "[]", - "kind": 12, - "tags": [], +[ + { "detail": "bool", - "documentation": null, - "sortText": "A", "insertText": "[$0]", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 12, + "label": "[]", + "sortText": "A", + "tags": [] + } +] Complete src/CompletionPattern.res 164:17 posCursor:[164:17] posNoWhite:[164:16] Found pattern:[164:16->164:18] @@ -749,19 +714,10 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Value[s] Path s -[{ - "label": "true", - "kind": 4, - "tags": [], - "detail": "bool", - "documentation": null - }, { - "label": "false", - "kind": 4, - "tags": [], - "detail": "bool", - "documentation": null - }] +[ + { "detail": "bool", "kind": 4, "label": "true", "tags": [] }, + { "detail": "bool", "kind": 4, "label": "false", "tags": [] } +] Complete src/CompletionPattern.res 167:23 posCursor:[167:23] posNoWhite:[167:21] Found pattern:[167:16->167:24] @@ -770,33 +726,19 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Value[s] Path s -[{ - "label": "None", - "kind": 12, - "tags": [], +[ + { "detail": "bool", "kind": 12, "label": "None", "tags": [] }, + { "detail": "bool", - "documentation": null - }, { - "label": "Some(_)", - "kind": 12, - "tags": [], - "detail": "bool", - "documentation": null, "insertText": "Some(${1:_})", - "insertTextFormat": 2 - }, { - "label": "Some(true)", - "kind": 4, - "tags": [], - "detail": "bool", - "documentation": null - }, { - "label": "Some(false)", - "kind": 4, - "tags": [], - "detail": "bool", - "documentation": null - }] + "insertTextFormat": 2, + "kind": 12, + "label": "Some(_)", + "tags": [] + }, + { "detail": "bool", "kind": 4, "label": "Some(true)", "tags": [] }, + { "detail": "bool", "kind": 4, "label": "Some(false)", "tags": [] } +] Complete src/CompletionPattern.res 170:22 posCursor:[170:22] posNoWhite:[170:21] Found pattern:[170:16->170:28] @@ -805,33 +747,19 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Value[s] Path s -[{ - "label": "None", - "kind": 12, - "tags": [], - "detail": "bool", - "documentation": null - }, { - "label": "Some(_)", - "kind": 12, - "tags": [], +[ + { "detail": "bool", "kind": 12, "label": "None", "tags": [] }, + { "detail": "bool", - "documentation": null, "insertText": "Some(${1:_})", - "insertTextFormat": 2 - }, { - "label": "Some(true)", - "kind": 4, - "tags": [], - "detail": "bool", - "documentation": null - }, { - "label": "Some(false)", - "kind": 4, - "tags": [], - "detail": "bool", - "documentation": null - }] + "insertTextFormat": 2, + "kind": 12, + "label": "Some(_)", + "tags": [] + }, + { "detail": "bool", "kind": 4, "label": "Some(true)", "tags": [] }, + { "detail": "bool", "kind": 4, "label": "Some(false)", "tags": [] } +] Complete src/CompletionPattern.res 173:35 XXX Not found! @@ -840,15 +768,16 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Value[s] Path s -[{ - "label": "(_, _, _)", - "kind": 12, - "tags": [], +[ + { "detail": "(bool, option, array)", - "documentation": null, "insertText": "(${1:_}, ${2:_}, ${3:_})", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 12, + "label": "(_, _, _)", + "tags": [] + } +] Complete src/CompletionPattern.res 176:41 posCursor:[176:41] posNoWhite:[176:40] Found pattern:[176:35->176:47] @@ -857,33 +786,19 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Value[s] Path s -[{ - "label": "None", - "kind": 12, - "tags": [], +[ + { "detail": "bool", "kind": 12, "label": "None", "tags": [] }, + { "detail": "bool", - "documentation": null - }, { - "label": "Some(_)", - "kind": 12, - "tags": [], - "detail": "bool", - "documentation": null, "insertText": "Some(${1:_})", - "insertTextFormat": 2 - }, { - "label": "Some(true)", - "kind": 4, - "tags": [], - "detail": "bool", - "documentation": null - }, { - "label": "Some(false)", - "kind": 4, - "tags": [], - "detail": "bool", - "documentation": null - }] + "insertTextFormat": 2, + "kind": 12, + "label": "Some(_)", + "tags": [] + }, + { "detail": "bool", "kind": 4, "label": "Some(true)", "tags": [] }, + { "detail": "bool", "kind": 4, "label": "Some(false)", "tags": [] } +] Complete src/CompletionPattern.res 179:21 XXX Not found! @@ -892,31 +807,44 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Value[z] Path z -[{ - "label": "One", - "kind": 4, - "tags": [], +[ + { "detail": "One", - "documentation": {"kind": "markdown", "value": "```rescript\nOne\n```\n\n```rescript\ntype someVariant = One | Two(bool) | Three(someRecord, bool)\n```"}, + "documentation": { + "kind": "markdown", + "value": "```rescript\nOne\n```\n\n```rescript\ntype someVariant = One | Two(bool) | Three(someRecord, bool)\n```" + }, "insertText": "One", - "insertTextFormat": 2 - }, { - "label": "Two(_)", + "insertTextFormat": 2, "kind": 4, - "tags": [], + "label": "One", + "tags": [] + }, + { "detail": "Two(bool)", - "documentation": {"kind": "markdown", "value": "```rescript\nTwo(bool)\n```\n\n```rescript\ntype someVariant = One | Two(bool) | Three(someRecord, bool)\n```"}, + "documentation": { + "kind": "markdown", + "value": "```rescript\nTwo(bool)\n```\n\n```rescript\ntype someVariant = One | Two(bool) | Three(someRecord, bool)\n```" + }, "insertText": "Two(${1:_})", - "insertTextFormat": 2 - }, { - "label": "Three(_, _)", + "insertTextFormat": 2, "kind": 4, - "tags": [], + "label": "Two(_)", + "tags": [] + }, + { "detail": "Three(someRecord, bool)", - "documentation": {"kind": "markdown", "value": "```rescript\nThree(someRecord, bool)\n```\n\n```rescript\ntype someVariant = One | Two(bool) | Three(someRecord, bool)\n```"}, + "documentation": { + "kind": "markdown", + "value": "```rescript\nThree(someRecord, bool)\n```\n\n```rescript\ntype someVariant = One | Two(bool) | Three(someRecord, bool)\n```" + }, "insertText": "Three(${1:_}, ${2:_})", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 4, + "label": "Three(_, _)", + "tags": [] + } +] Complete src/CompletionPattern.res 182:32 posCursor:[182:32] posNoWhite:[182:31] Found pattern:[182:16->182:34] @@ -927,19 +855,10 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Value[z] Path z -[{ - "label": "true", - "kind": 4, - "tags": [], - "detail": "bool", - "documentation": null - }, { - "label": "false", - "kind": 4, - "tags": [], - "detail": "bool", - "documentation": null - }] +[ + { "detail": "bool", "kind": 4, "label": "true", "tags": [] }, + { "detail": "bool", "kind": 4, "label": "false", "tags": [] } +] Complete src/CompletionPattern.res 185:48 posCursor:[185:48] posNoWhite:[185:47] Found pattern:[185:16->185:50] @@ -951,19 +870,10 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Value[z] Path z -[{ - "label": "true", - "kind": 4, - "tags": [], - "detail": "bool", - "documentation": null - }, { - "label": "false", - "kind": 4, - "tags": [], - "detail": "bool", - "documentation": null - }] +[ + { "detail": "bool", "kind": 4, "label": "true", "tags": [] }, + { "detail": "bool", "kind": 4, "label": "false", "tags": [] } +] Complete src/CompletionPattern.res 188:34 posCursor:[188:34] posNoWhite:[188:33] Found pattern:[188:16->188:36] @@ -973,19 +883,10 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Value[b] Path b -[{ - "label": "true", - "kind": 4, - "tags": [], - "detail": "bool", - "documentation": null - }, { - "label": "false", - "kind": 4, - "tags": [], - "detail": "bool", - "documentation": null - }] +[ + { "detail": "bool", "kind": 4, "label": "true", "tags": [] }, + { "detail": "bool", "kind": 4, "label": "false", "tags": [] } +] Complete src/CompletionPattern.res 191:50 posCursor:[191:50] posNoWhite:[191:49] Found pattern:[191:16->191:52] @@ -996,19 +897,10 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Value[b] Path b -[{ - "label": "true", - "kind": 4, - "tags": [], - "detail": "bool", - "documentation": null - }, { - "label": "false", - "kind": 4, - "tags": [], - "detail": "bool", - "documentation": null - }] +[ + { "detail": "bool", "kind": 4, "label": "true", "tags": [] }, + { "detail": "bool", "kind": 4, "label": "false", "tags": [] } +] Complete src/CompletionPattern.res 194:24 posCursor:[194:24] posNoWhite:[194:23] Found pattern:[194:16->194:29] @@ -1018,33 +910,19 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Value[s] Path s -[{ - "label": "None", - "kind": 12, - "tags": [], +[ + { "detail": "bool", "kind": 12, "label": "None", "tags": [] }, + { "detail": "bool", - "documentation": null - }, { - "label": "Some(_)", - "kind": 12, - "tags": [], - "detail": "bool", - "documentation": null, "insertText": "Some(${1:_})", - "insertTextFormat": 2 - }, { - "label": "Some(true)", - "kind": 4, - "tags": [], - "detail": "bool", - "documentation": null - }, { - "label": "Some(false)", - "kind": 4, - "tags": [], - "detail": "bool", - "documentation": null - }] + "insertTextFormat": 2, + "kind": 12, + "label": "Some(_)", + "tags": [] + }, + { "detail": "bool", "kind": 4, "label": "Some(true)", "tags": [] }, + { "detail": "bool", "kind": 4, "label": "Some(false)", "tags": [] } +] Complete src/CompletionPattern.res 201:25 posCursor:[201:25] posNoWhite:[201:24] Found pattern:[201:17->201:28] @@ -1062,13 +940,18 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Value[xn] Path xn -[{ - "label": "Exn.Error(error)", - "kind": 4, - "tags": [], +[ + { "detail": "Catches errors from JavaScript errors.", - "documentation": {"kind": "markdown", "value": "Matches on a JavaScript error. Read more in the [documentation on catching JS exceptions](https://rescript-lang.org/docs/manual/latest/exception#catching-js-exceptions)."} - }] + "documentation": { + "kind": "markdown", + "value": "Matches on a JavaScript error. Read more in the [documentation on catching JS exceptions](https://rescript-lang.org/docs/manual/latest/exception#catching-js-exceptions)." + }, + "kind": 4, + "label": "Exn.Error(error)", + "tags": [] + } +] Complete src/CompletionPattern.res 211:30 XXX Not found! @@ -1079,31 +962,44 @@ ContextPath await Value[getThing](Nolabel) ContextPath Value[getThing](Nolabel) ContextPath Value[getThing] Path getThing -[{ - "label": "One", - "kind": 4, - "tags": [], +[ + { "detail": "One", - "documentation": {"kind": "markdown", "value": "```rescript\nOne\n```\n\n```rescript\ntype someVariant = One | Two(bool) | Three(someRecord, bool)\n```"}, + "documentation": { + "kind": "markdown", + "value": "```rescript\nOne\n```\n\n```rescript\ntype someVariant = One | Two(bool) | Three(someRecord, bool)\n```" + }, "insertText": "One", - "insertTextFormat": 2 - }, { - "label": "Two(_)", + "insertTextFormat": 2, "kind": 4, - "tags": [], + "label": "One", + "tags": [] + }, + { "detail": "Two(bool)", - "documentation": {"kind": "markdown", "value": "```rescript\nTwo(bool)\n```\n\n```rescript\ntype someVariant = One | Two(bool) | Three(someRecord, bool)\n```"}, + "documentation": { + "kind": "markdown", + "value": "```rescript\nTwo(bool)\n```\n\n```rescript\ntype someVariant = One | Two(bool) | Three(someRecord, bool)\n```" + }, "insertText": "Two(${1:_})", - "insertTextFormat": 2 - }, { - "label": "Three(_, _)", + "insertTextFormat": 2, "kind": 4, - "tags": [], + "label": "Two(_)", + "tags": [] + }, + { "detail": "Three(someRecord, bool)", - "documentation": {"kind": "markdown", "value": "```rescript\nThree(someRecord, bool)\n```\n\n```rescript\ntype someVariant = One | Two(bool) | Three(someRecord, bool)\n```"}, + "documentation": { + "kind": "markdown", + "value": "```rescript\nThree(someRecord, bool)\n```\n\n```rescript\ntype someVariant = One | Two(bool) | Three(someRecord, bool)\n```" + }, "insertText": "Three(${1:_}, ${2:_})", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 4, + "label": "Three(_, _)", + "tags": [] + } +] Complete src/CompletionPattern.res 216:21 posCursor:[216:21] posNoWhite:[216:20] Found pattern:[216:18->216:22] @@ -1115,31 +1011,44 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Value[res] Path res -[{ - "label": "One", - "kind": 4, - "tags": [], +[ + { "detail": "One", - "documentation": {"kind": "markdown", "value": "```rescript\nOne\n```\n\n```rescript\ntype someVariant = One | Two(bool) | Three(someRecord, bool)\n```"}, + "documentation": { + "kind": "markdown", + "value": "```rescript\nOne\n```\n\n```rescript\ntype someVariant = One | Two(bool) | Three(someRecord, bool)\n```" + }, "insertText": "One", - "insertTextFormat": 2 - }, { - "label": "Two(_)", + "insertTextFormat": 2, "kind": 4, - "tags": [], + "label": "One", + "tags": [] + }, + { "detail": "Two(bool)", - "documentation": {"kind": "markdown", "value": "```rescript\nTwo(bool)\n```\n\n```rescript\ntype someVariant = One | Two(bool) | Three(someRecord, bool)\n```"}, + "documentation": { + "kind": "markdown", + "value": "```rescript\nTwo(bool)\n```\n\n```rescript\ntype someVariant = One | Two(bool) | Three(someRecord, bool)\n```" + }, "insertText": "Two(${1:_})", - "insertTextFormat": 2 - }, { - "label": "Three(_, _)", + "insertTextFormat": 2, "kind": 4, - "tags": [], + "label": "Two(_)", + "tags": [] + }, + { "detail": "Three(someRecord, bool)", - "documentation": {"kind": "markdown", "value": "```rescript\nThree(someRecord, bool)\n```\n\n```rescript\ntype someVariant = One | Two(bool) | Three(someRecord, bool)\n```"}, + "documentation": { + "kind": "markdown", + "value": "```rescript\nThree(someRecord, bool)\n```\n\n```rescript\ntype someVariant = One | Two(bool) | Three(someRecord, bool)\n```" + }, "insertText": "Three(${1:_}, ${2:_})", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 4, + "label": "Three(_, _)", + "tags": [] + } +] Complete src/CompletionPattern.res 219:24 posCursor:[219:24] posNoWhite:[219:23] Found pattern:[219:18->219:25] @@ -1151,31 +1060,44 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Value[res] Path res -[{ - "label": "#one", - "kind": 4, - "tags": [], +[ + { "detail": "#one", - "documentation": {"kind": "markdown", "value": "```rescript\n#one\n```\n\n```rescript\n[#one | #three(someRecord, bool) | #two(bool)]\n```"}, + "documentation": { + "kind": "markdown", + "value": "```rescript\n#one\n```\n\n```rescript\n[#one | #three(someRecord, bool) | #two(bool)]\n```" + }, "insertText": "#one", - "insertTextFormat": 2 - }, { - "label": "#three(_, _)", + "insertTextFormat": 2, "kind": 4, - "tags": [], + "label": "#one", + "tags": [] + }, + { "detail": "#three(someRecord, bool)", - "documentation": {"kind": "markdown", "value": "```rescript\n#three(someRecord, bool)\n```\n\n```rescript\n[#one | #three(someRecord, bool) | #two(bool)]\n```"}, + "documentation": { + "kind": "markdown", + "value": "```rescript\n#three(someRecord, bool)\n```\n\n```rescript\n[#one | #three(someRecord, bool) | #two(bool)]\n```" + }, "insertText": "#three(${1:_}, ${2:_})", - "insertTextFormat": 2 - }, { - "label": "#two(_)", + "insertTextFormat": 2, "kind": 4, - "tags": [], + "label": "#three(_, _)", + "tags": [] + }, + { "detail": "#two(bool)", - "documentation": {"kind": "markdown", "value": "```rescript\n#two(bool)\n```\n\n```rescript\n[#one | #three(someRecord, bool) | #two(bool)]\n```"}, + "documentation": { + "kind": "markdown", + "value": "```rescript\n#two(bool)\n```\n\n```rescript\n[#one | #three(someRecord, bool) | #two(bool)]\n```" + }, "insertText": "#two(${1:_})", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 4, + "label": "#two(_)", + "tags": [] + } +] Complete src/CompletionPattern.res 227:25 posCursor:[227:25] posNoWhite:[227:24] Found expr:[223:11->232:1] @@ -1187,25 +1109,38 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Value[r] Path r -[{ - "label": "second", - "kind": 5, - "tags": [], +[ + { "detail": "(bool, option)", - "documentation": {"kind": "markdown", "value": "```rescript\nsecond: (bool, option)\n```\n\n```rescript\ntype someRecord = {first: int, second: (bool, option), optThird: option<[#first | #second(someRecord)]>, nest: nestedRecord}\n```"} - }, { - "label": "optThird", + "documentation": { + "kind": "markdown", + "value": "```rescript\nsecond: (bool, option)\n```\n\n```rescript\ntype someRecord = {first: int, second: (bool, option), optThird: option<[#first | #second(someRecord)]>, nest: nestedRecord}\n```" + }, "kind": 5, - "tags": [], + "label": "second", + "tags": [] + }, + { "detail": "option<[#first | #second(someRecord)]>", - "documentation": {"kind": "markdown", "value": "```rescript\noptThird: option<[#first | #second(someRecord)]>\n```\n\n```rescript\ntype someRecord = {first: int, second: (bool, option), optThird: option<[#first | #second(someRecord)]>, nest: nestedRecord}\n```"} - }, { - "label": "nest", + "documentation": { + "kind": "markdown", + "value": "```rescript\noptThird: option<[#first | #second(someRecord)]>\n```\n\n```rescript\ntype someRecord = {first: int, second: (bool, option), optThird: option<[#first | #second(someRecord)]>, nest: nestedRecord}\n```" + }, "kind": 5, - "tags": [], + "label": "optThird", + "tags": [] + }, + { "detail": "nestedRecord", - "documentation": {"kind": "markdown", "value": "```rescript\nnest: nestedRecord\n```\n\n```rescript\ntype someRecord = {first: int, second: (bool, option), optThird: option<[#first | #second(someRecord)]>, nest: nestedRecord}\n```"} - }] + "documentation": { + "kind": "markdown", + "value": "```rescript\nnest: nestedRecord\n```\n\n```rescript\ntype someRecord = {first: int, second: (bool, option), optThird: option<[#first | #second(someRecord)]>, nest: nestedRecord}\n```" + }, + "kind": 5, + "label": "nest", + "tags": [] + } +] Complete src/CompletionPattern.res 243:33 posCursor:[243:33] posNoWhite:[243:32] Found pattern:[243:7->243:35] @@ -1215,11 +1150,16 @@ Resolved opens 1 Stdlib ContextPath Value[hitsUse](Nolabel) ContextPath Value[hitsUse] Path hitsUse -[{ - "label": "hits", - "kind": 5, - "tags": [], +[ + { "detail": "array", - "documentation": {"kind": "markdown", "value": "```rescript\nhits: array\n```\n\n```rescript\ntype hitsUse = {results: results, hits: array}\n```"} - }] + "documentation": { + "kind": "markdown", + "value": "```rescript\nhits: array\n```\n\n```rescript\ntype hitsUse = {results: results, hits: array}\n```" + }, + "kind": 5, + "label": "hits", + "tags": [] + } +] diff --git a/tests/analysis_tests/tests/src/expected/CompletionPipeChain.res.txt b/tests/analysis_tests/tests/src/expected/CompletionPipeChain.res.txt index 1519636e45b..fd4f532bd61 100644 --- a/tests/analysis_tests/tests/src/expected/CompletionPipeChain.res.txt +++ b/tests/analysis_tests/tests/src/expected/CompletionPipeChain.res.txt @@ -9,31 +9,27 @@ Path int CPPipe pathFromEnv:Integer found:true Path Integer. Path -[{ - "label": "Integer.toInt", +[ + { "detail": "t => int", "kind": 12, "label": "Integer.toInt", "tags": [] }, + { + "detail": "(t, int) => t", "kind": 12, - "tags": [], - "detail": "t => int", - "documentation": null - }, { "label": "Integer.increment", + "tags": [] + }, + { + "detail": "(t, int => int) => t", "kind": 12, - "tags": [], - "detail": "(t, int) => t", - "documentation": null - }, { "label": "Integer.decrement", + "tags": [] + }, + { + "detail": "Integer.t => SuperFloat.t", "kind": 12, - "tags": [], - "detail": "(t, int => int) => t", - "documentation": null - }, { "label": "toFlt", - "kind": 12, - "tags": [], - "detail": "Integer.t => SuperFloat.t", - "documentation": null - }] + "tags": [] + } +] Complete src/CompletionPipeChain.res 30:23 posCursor:[30:23] posNoWhite:[30:22] Found expr:[30:11->0:-1] @@ -47,13 +43,14 @@ Path toFlt CPPipe pathFromEnv:SuperFloat found:true Path SuperFloat. Path -[{ - "label": "SuperFloat.toInteger", - "kind": 12, - "tags": [], +[ + { "detail": "t => Integer.t", - "documentation": null - }] + "kind": 12, + "label": "SuperFloat.toInteger", + "tags": [] + } +] Complete src/CompletionPipeChain.res 33:38 posCursor:[33:38] posNoWhite:[33:37] Found expr:[33:11->0:-1] @@ -67,31 +64,27 @@ Path Integer.increment CPPipe pathFromEnv:Integer found:true Path Integer. Path -[{ - "label": "Integer.toInt", +[ + { "detail": "t => int", "kind": 12, "label": "Integer.toInt", "tags": [] }, + { + "detail": "(t, int) => t", "kind": 12, - "tags": [], - "detail": "t => int", - "documentation": null - }, { "label": "Integer.increment", + "tags": [] + }, + { + "detail": "(t, int => int) => t", "kind": 12, - "tags": [], - "detail": "(t, int) => t", - "documentation": null - }, { "label": "Integer.decrement", + "tags": [] + }, + { + "detail": "Integer.t => SuperFloat.t", "kind": 12, - "tags": [], - "detail": "(t, int => int) => t", - "documentation": null - }, { "label": "toFlt", - "kind": 12, - "tags": [], - "detail": "Integer.t => SuperFloat.t", - "documentation": null - }] + "tags": [] + } +] Complete src/CompletionPipeChain.res 36:38 posCursor:[36:38] posNoWhite:[36:37] Found expr:[36:11->0:-1] @@ -105,31 +98,27 @@ Path Integer.increment CPPipe pathFromEnv:Integer found:true Path Integer. Path -[{ - "label": "Integer.toInt", +[ + { "detail": "t => int", "kind": 12, "label": "Integer.toInt", "tags": [] }, + { + "detail": "(t, int) => t", "kind": 12, - "tags": [], - "detail": "t => int", - "documentation": null - }, { "label": "Integer.increment", + "tags": [] + }, + { + "detail": "(t, int => int) => t", "kind": 12, - "tags": [], - "detail": "(t, int) => t", - "documentation": null - }, { "label": "Integer.decrement", + "tags": [] + }, + { + "detail": "Integer.t => SuperFloat.t", "kind": 12, - "tags": [], - "detail": "(t, int => int) => t", - "documentation": null - }, { "label": "toFlt", - "kind": 12, - "tags": [], - "detail": "Integer.t => SuperFloat.t", - "documentation": null - }] + "tags": [] + } +] Complete src/CompletionPipeChain.res 39:47 posCursor:[39:47] posNoWhite:[39:46] Found expr:[39:11->0:-1] @@ -143,31 +132,27 @@ Path Integer.decrement CPPipe pathFromEnv:Integer found:true Path Integer. Path -[{ - "label": "Integer.toInt", +[ + { "detail": "t => int", "kind": 12, "label": "Integer.toInt", "tags": [] }, + { + "detail": "(t, int) => t", "kind": 12, - "tags": [], - "detail": "t => int", - "documentation": null - }, { "label": "Integer.increment", + "tags": [] + }, + { + "detail": "(t, int => int) => t", "kind": 12, - "tags": [], - "detail": "(t, int) => t", - "documentation": null - }, { "label": "Integer.decrement", + "tags": [] + }, + { + "detail": "Integer.t => SuperFloat.t", "kind": 12, - "tags": [], - "detail": "(t, int => int) => t", - "documentation": null - }, { "label": "toFlt", - "kind": 12, - "tags": [], - "detail": "Integer.t => SuperFloat.t", - "documentation": null - }] + "tags": [] + } +] Complete src/CompletionPipeChain.res 42:69 posCursor:[42:69] posNoWhite:[42:68] Found expr:[42:11->0:-1] @@ -181,31 +166,27 @@ Path Integer.decrement CPPipe pathFromEnv:Integer found:true Path Integer. Path -[{ - "label": "Integer.toInt", +[ + { "detail": "t => int", "kind": 12, "label": "Integer.toInt", "tags": [] }, + { + "detail": "(t, int) => t", "kind": 12, - "tags": [], - "detail": "t => int", - "documentation": null - }, { "label": "Integer.increment", + "tags": [] + }, + { + "detail": "(t, int => int) => t", "kind": 12, - "tags": [], - "detail": "(t, int) => t", - "documentation": null - }, { "label": "Integer.decrement", + "tags": [] + }, + { + "detail": "Integer.t => SuperFloat.t", "kind": 12, - "tags": [], - "detail": "(t, int => int) => t", - "documentation": null - }, { "label": "toFlt", - "kind": 12, - "tags": [], - "detail": "Integer.t => SuperFloat.t", - "documentation": null - }] + "tags": [] + } +] Complete src/CompletionPipeChain.res 45:62 posCursor:[45:62] posNoWhite:[45:61] Found expr:[45:11->0:-1] @@ -219,13 +200,14 @@ Path SuperFloat.fromInteger CPPipe pathFromEnv:SuperFloat found:true Path SuperFloat. Path -[{ - "label": "SuperFloat.toInteger", - "kind": 12, - "tags": [], +[ + { "detail": "t => Integer.t", - "documentation": null - }] + "kind": 12, + "label": "SuperFloat.toInteger", + "tags": [] + } +] Complete src/CompletionPipeChain.res 48:63 posCursor:[48:63] posNoWhite:[48:62] Found expr:[48:11->48:63] @@ -239,13 +221,14 @@ Path SuperFloat.fromInteger CPPipe pathFromEnv:SuperFloat found:true Path SuperFloat.t Path t -[{ - "label": "SuperFloat.toInteger", - "kind": 12, - "tags": [], +[ + { "detail": "t => Integer.t", - "documentation": null - }] + "kind": 12, + "label": "SuperFloat.toInteger", + "tags": [] + } +] Complete src/CompletionPipeChain.res 51:82 posCursor:[51:82] posNoWhite:[51:81] Found expr:[51:11->0:-1] @@ -259,19 +242,20 @@ Path CompletionSupport.Test.make CPPipe pathFromEnv:Test found:true Path CompletionSupport.Test. Path -[{ - "label": "CompletionSupport.Test.add", - "kind": 12, - "tags": [], +[ + { "detail": "t => int", - "documentation": null - }, { - "label": "CompletionSupport.Test.addSelf", "kind": 12, - "tags": [], + "label": "CompletionSupport.Test.add", + "tags": [] + }, + { "detail": "t => t", - "documentation": null - }] + "kind": 12, + "label": "CompletionSupport.Test.addSelf", + "tags": [] + } +] Complete src/CompletionPipeChain.res 54:78 posCursor:[54:78] posNoWhite:[54:77] Found expr:[54:11->0:-1] @@ -285,19 +269,20 @@ Path CompletionSupport.Test.addSelf CPPipe pathFromEnv:Test found:true Path CompletionSupport.Test. Path -[{ - "label": "CompletionSupport.Test.add", - "kind": 12, - "tags": [], +[ + { "detail": "t => int", - "documentation": null - }, { - "label": "CompletionSupport.Test.addSelf", "kind": 12, - "tags": [], + "label": "CompletionSupport.Test.add", + "tags": [] + }, + { "detail": "t => t", - "documentation": null - }] + "kind": 12, + "label": "CompletionSupport.Test.addSelf", + "tags": [] + } +] Complete src/CompletionPipeChain.res 58:5 posCursor:[58:5] posNoWhite:[58:4] Found expr:[57:8->0:-1] @@ -324,67 +309,112 @@ ContextPath Value[Belt, Array, reduce] Path Belt.Array.reduce Path Stdlib.Int.t Path t -[{ - "label": "Int.toStringWithRadix", - "kind": 12, - "tags": [1], +[ + { + "deprecated": true, "detail": "(int, ~radix: int) => string", - "documentation": {"kind": "markdown", "value": "Deprecated: Use `toString` instead\n\n\n`toStringWithRadix(n, ~radix)` return a `string` representing the given value.\n`~radix` specifies the radix base to use for the formatted number.\nSee [`Number.toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toString)\non MDN.\n\n## Examples\n\n```rescript\nInt.toStringWithRadix(6, ~radix=2) // \"110\"\nInt.toStringWithRadix(373592855, ~radix=16) // \"16449317\"\nInt.toStringWithRadix(123456, ~radix=36) // \"2n9c\"\n```\n\n## Exceptions\n\n`RangeError`: if `radix` is less than 2 or greater than 36.\n"} - }, { - "label": "Int.toExponentialWithPrecision", + "documentation": { + "kind": "markdown", + "value": "Deprecated: Use `toString` instead\n\n\n`toStringWithRadix(n, ~radix)` return a `string` representing the given value.\n`~radix` specifies the radix base to use for the formatted number.\nSee [`Number.toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toString)\non MDN.\n\n## Examples\n\n```rescript\nInt.toStringWithRadix(6, ~radix=2) // \"110\"\nInt.toStringWithRadix(373592855, ~radix=16) // \"16449317\"\nInt.toStringWithRadix(123456, ~radix=36) // \"2n9c\"\n```\n\n## Exceptions\n\n`RangeError`: if `radix` is less than 2 or greater than 36.\n" + }, "kind": 12, - "tags": [1], + "label": "Int.toStringWithRadix", + "tags": [ 1 ] + }, + { + "deprecated": true, "detail": "(int, ~digits: int) => string", - "documentation": {"kind": "markdown", "value": "Deprecated: Use `toExponential` instead\n\n\n`toExponential(n, ~digits)` return a `string` representing the given value in\nexponential notation. `digits` specifies how many digits should appear after\nthe decimal point. See [`Number.toExponential`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toExponential)\non MDN.\n\n## Examples\n\n```rescript\nInt.toExponentialWithPrecision(77, ~digits=2) // \"7.70e+1\"\nInt.toExponentialWithPrecision(5678, ~digits=2) // \"5.68e+3\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` less than 0 or greater than 10.\n"} - }, { - "label": "Int.toFixedWithPrecision", + "documentation": { + "kind": "markdown", + "value": "Deprecated: Use `toExponential` instead\n\n\n`toExponential(n, ~digits)` return a `string` representing the given value in\nexponential notation. `digits` specifies how many digits should appear after\nthe decimal point. See [`Number.toExponential`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toExponential)\non MDN.\n\n## Examples\n\n```rescript\nInt.toExponentialWithPrecision(77, ~digits=2) // \"7.70e+1\"\nInt.toExponentialWithPrecision(5678, ~digits=2) // \"5.68e+3\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` less than 0 or greater than 10.\n" + }, "kind": 12, - "tags": [1], + "label": "Int.toExponentialWithPrecision", + "tags": [ 1 ] + }, + { + "deprecated": true, "detail": "(int, ~digits: int) => string", - "documentation": {"kind": "markdown", "value": "Deprecated: Use `toFixed` instead\n\n\n`toFixedWithPrecision(n, ~digits)` return a `string` representing the given\nvalue using fixed-point notation. `digits` specifies how many digits should\nappear after the decimal point. See [`Number.toFixed`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toFixed)\non MDN.\n\n## Examples\n\n```rescript\nInt.toFixedWithPrecision(300, ~digits=4) // \"300.0000\"\nInt.toFixedWithPrecision(300, ~digits=1) // \"300.0\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` is less than 0 or larger than 100.\n"} - }, { - "label": "Int.toPrecisionWithPrecision", + "documentation": { + "kind": "markdown", + "value": "Deprecated: Use `toFixed` instead\n\n\n`toFixedWithPrecision(n, ~digits)` return a `string` representing the given\nvalue using fixed-point notation. `digits` specifies how many digits should\nappear after the decimal point. See [`Number.toFixed`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toFixed)\non MDN.\n\n## Examples\n\n```rescript\nInt.toFixedWithPrecision(300, ~digits=4) // \"300.0000\"\nInt.toFixedWithPrecision(300, ~digits=1) // \"300.0\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` is less than 0 or larger than 100.\n" + }, "kind": 12, - "tags": [1], + "label": "Int.toFixedWithPrecision", + "tags": [ 1 ] + }, + { + "deprecated": true, "detail": "(int, ~digits: int) => string", - "documentation": {"kind": "markdown", "value": "Deprecated: Use `toPrecision` instead\n\n\n`toPrecisionWithPrecision(n, ~digits)` return a `string` representing the giver value with\nprecision. `digits` specifies the number of significant digits. See [`Number.toPrecision`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toPrecision) on MDN.\n\n## Examples\n\n```rescript\nInt.toPrecisionWithPrecision(100, ~digits=2) // \"1.0e+2\"\nInt.toPrecisionWithPrecision(1, ~digits=2) // \"1.0\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` is not between 1 and 100 (inclusive).\n Implementations are allowed to support larger and smaller values as well.\n ECMA-262 only requires a precision of up to 21 significant digits.\n"} - }, { - "label": "Int.toPrecision", + "documentation": { + "kind": "markdown", + "value": "Deprecated: Use `toPrecision` instead\n\n\n`toPrecisionWithPrecision(n, ~digits)` return a `string` representing the giver value with\nprecision. `digits` specifies the number of significant digits. See [`Number.toPrecision`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toPrecision) on MDN.\n\n## Examples\n\n```rescript\nInt.toPrecisionWithPrecision(100, ~digits=2) // \"1.0e+2\"\nInt.toPrecisionWithPrecision(1, ~digits=2) // \"1.0\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` is not between 1 and 100 (inclusive).\n Implementations are allowed to support larger and smaller values as well.\n ECMA-262 only requires a precision of up to 21 significant digits.\n" + }, "kind": 12, - "tags": [], + "label": "Int.toPrecisionWithPrecision", + "tags": [ 1 ] + }, + { "detail": "(int, ~digits: int=?) => string", - "documentation": {"kind": "markdown", "value": "\n`toPrecision(n, ~digits=?)` return a `string` representing the giver value with\nprecision. `digits` specifies the number of significant digits. See [`Number.toPrecision`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toPrecision) on MDN.\n\n## Examples\n\n```rescript\nInt.toPrecision(100) // \"100\"\nInt.toPrecision(1) // \"1\"\nInt.toPrecision(100, ~digits=2) // \"1.0e+2\"\nInt.toPrecision(1, ~digits=2) // \"1.0\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` is not between 1 and 100 (inclusive).\n Implementations are allowed to support larger and smaller values as well.\n ECMA-262 only requires a precision of up to 21 significant digits.\n"} - }, { - "label": "Int.toString", + "documentation": { + "kind": "markdown", + "value": "\n`toPrecision(n, ~digits=?)` return a `string` representing the giver value with\nprecision. `digits` specifies the number of significant digits. See [`Number.toPrecision`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toPrecision) on MDN.\n\n## Examples\n\n```rescript\nInt.toPrecision(100) // \"100\"\nInt.toPrecision(1) // \"1\"\nInt.toPrecision(100, ~digits=2) // \"1.0e+2\"\nInt.toPrecision(1, ~digits=2) // \"1.0\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` is not between 1 and 100 (inclusive).\n Implementations are allowed to support larger and smaller values as well.\n ECMA-262 only requires a precision of up to 21 significant digits.\n" + }, "kind": 12, - "tags": [], + "label": "Int.toPrecision", + "tags": [] + }, + { "detail": "(int, ~radix: int=?) => string", - "documentation": {"kind": "markdown", "value": "\n`toString(n, ~radix=?)` return a `string` representing the given value.\n`~radix` specifies the radix base to use for the formatted number.\nSee [`Number.toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toString)\non MDN.\n\n## Examples\n\n```rescript\nInt.toString(1000) // \"1000\"\nInt.toString(-1000) // \"-1000\"\nInt.toString(6, ~radix=2) // \"110\"\nInt.toString(373592855, ~radix=16) // \"16449317\"\nInt.toString(123456, ~radix=36) // \"2n9c\"\n```\n\n## Exceptions\n\n`RangeError`: if `radix` is less than 2 or greater than 36.\n"} - }, { - "label": "Int.toFloat", + "documentation": { + "kind": "markdown", + "value": "\n`toString(n, ~radix=?)` return a `string` representing the given value.\n`~radix` specifies the radix base to use for the formatted number.\nSee [`Number.toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toString)\non MDN.\n\n## Examples\n\n```rescript\nInt.toString(1000) // \"1000\"\nInt.toString(-1000) // \"-1000\"\nInt.toString(6, ~radix=2) // \"110\"\nInt.toString(373592855, ~radix=16) // \"16449317\"\nInt.toString(123456, ~radix=36) // \"2n9c\"\n```\n\n## Exceptions\n\n`RangeError`: if `radix` is less than 2 or greater than 36.\n" + }, "kind": 12, - "tags": [], + "label": "Int.toString", + "tags": [] + }, + { "detail": "int => float", - "documentation": {"kind": "markdown", "value": "\n`toFloat(n)` return a `float` representing the given value.\n\n## Examples\n\n```rescript\nInt.toFloat(100) == 100.0\nInt.toFloat(2) == 2.0\n```\n"} - }, { - "label": "Int.toLocaleString", + "documentation": { + "kind": "markdown", + "value": "\n`toFloat(n)` return a `float` representing the given value.\n\n## Examples\n\n```rescript\nInt.toFloat(100) == 100.0\nInt.toFloat(2) == 2.0\n```\n" + }, "kind": 12, - "tags": [], + "label": "Int.toFloat", + "tags": [] + }, + { "detail": "int => string", - "documentation": {"kind": "markdown", "value": "\n`toLocaleString(n)` return a `string` with language-sensitive representing the\ngiven value. See [`Number.toLocaleString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toLocaleString) on MDN.\n\n## Examples\n\n```rescript\n// If the application uses English as the default language\nInt.toLocaleString(1000) // \"1,000\"\n\n// If the application uses Portuguese Brazil as the default language\nInt.toLocaleString(1000) // \"1.000\"\n```\n"} - }, { - "label": "Int.toExponential", + "documentation": { + "kind": "markdown", + "value": "\n`toLocaleString(n)` return a `string` with language-sensitive representing the\ngiven value. See [`Number.toLocaleString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toLocaleString) on MDN.\n\n## Examples\n\n```rescript\n// If the application uses English as the default language\nInt.toLocaleString(1000) // \"1,000\"\n\n// If the application uses Portuguese Brazil as the default language\nInt.toLocaleString(1000) // \"1.000\"\n```\n" + }, "kind": 12, - "tags": [], + "label": "Int.toLocaleString", + "tags": [] + }, + { "detail": "(int, ~digits: int=?) => string", - "documentation": {"kind": "markdown", "value": "\n`toExponential(n, ~digits=?)` return a `string` representing the given value in\nexponential notation. `digits` specifies how many digits should appear after\nthe decimal point. See [`Number.toExponential`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toExponential)\n\n## Examples\n\n```rescript\nInt.toExponential(1000) // \"1e+3\"\nInt.toExponential(-1000) // \"-1e+3\"\nInt.toExponential(77, ~digits=2) // \"7.70e+1\"\nInt.toExponential(5678, ~digits=2) // \"5.68e+3\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` less than 0 or greater than 10.\n"} - }, { - "label": "Int.toFixed", + "documentation": { + "kind": "markdown", + "value": "\n`toExponential(n, ~digits=?)` return a `string` representing the given value in\nexponential notation. `digits` specifies how many digits should appear after\nthe decimal point. See [`Number.toExponential`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toExponential)\n\n## Examples\n\n```rescript\nInt.toExponential(1000) // \"1e+3\"\nInt.toExponential(-1000) // \"-1e+3\"\nInt.toExponential(77, ~digits=2) // \"7.70e+1\"\nInt.toExponential(5678, ~digits=2) // \"5.68e+3\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` less than 0 or greater than 10.\n" + }, "kind": 12, - "tags": [], + "label": "Int.toExponential", + "tags": [] + }, + { "detail": "(int, ~digits: int=?) => string", - "documentation": {"kind": "markdown", "value": "\n`toFixed(n, ~digits=?)` return a `string` representing the given\nvalue using fixed-point notation. `digits` specifies how many digits should\nappear after the decimal point. See [`Number.toFixed`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toFixed)\non MDN.\n\n## Examples\n\n```rescript\nInt.toFixed(123456) // \"123456.00\"\nInt.toFixed(10) // \"10.00\"\nInt.toFixed(300, ~digits=4) // \"300.0000\"\nInt.toFixed(300, ~digits=1) // \"300.0\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` is less than 0 or larger than 100.\n"} - }] + "documentation": { + "kind": "markdown", + "value": "\n`toFixed(n, ~digits=?)` return a `string` representing the given\nvalue using fixed-point notation. `digits` specifies how many digits should\nappear after the decimal point. See [`Number.toFixed`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toFixed)\non MDN.\n\n## Examples\n\n```rescript\nInt.toFixed(123456) // \"123456.00\"\nInt.toFixed(10) // \"10.00\"\nInt.toFixed(300, ~digits=4) // \"300.0000\"\nInt.toFixed(300, ~digits=1) // \"300.0\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` is less than 0 or larger than 100.\n" + }, + "kind": 12, + "label": "Int.toFixed", + "tags": [] + } +] Complete src/CompletionPipeChain.res 70:12 posCursor:[70:12] posNoWhite:[70:11] Found expr:[70:3->0:-1] @@ -397,19 +427,20 @@ Path aliased CPPipe pathFromEnv:CompletionSupport.Test found:false Path CompletionSupport.Test. Path -[{ - "label": "CompletionSupport.Test.add", - "kind": 12, - "tags": [], +[ + { "detail": "t => int", - "documentation": null - }, { - "label": "CompletionSupport.Test.addSelf", "kind": 12, - "tags": [], + "label": "CompletionSupport.Test.add", + "tags": [] + }, + { "detail": "t => t", - "documentation": null - }] + "kind": 12, + "label": "CompletionSupport.Test.addSelf", + "tags": [] + } +] Complete src/CompletionPipeChain.res 73:15 posCursor:[73:15] posNoWhite:[73:14] Found expr:[73:3->0:-1] @@ -422,19 +453,20 @@ Path notAliased CPPipe pathFromEnv:CompletionSupport.Test found:false Path CompletionSupport.Test. Path -[{ - "label": "CompletionSupport.Test.add", - "kind": 12, - "tags": [], +[ + { "detail": "t => int", - "documentation": null - }, { - "label": "CompletionSupport.Test.addSelf", "kind": 12, - "tags": [], + "label": "CompletionSupport.Test.add", + "tags": [] + }, + { "detail": "t => t", - "documentation": null - }] + "kind": 12, + "label": "CompletionSupport.Test.addSelf", + "tags": [] + } +] Complete src/CompletionPipeChain.res 82:30 posCursor:[82:30] posNoWhite:[82:29] Found expr:[76:15->93:1] @@ -473,13 +505,14 @@ Path root CPPipe pathFromEnv:ReactDOM.Client.Root found:false Path ReactDOM.Client.Root.ren Path ren -[{ - "label": "ReactDOM.Client.Root.render", - "kind": 12, - "tags": [], +[ + { "detail": "(t, React.element) => unit", - "documentation": null - }] + "kind": 12, + "label": "ReactDOM.Client.Root.render", + "tags": [] + } +] Complete src/CompletionPipeChain.res 88:16 posCursor:[88:16] posNoWhite:[88:15] Found expr:[76:15->93:1] @@ -499,13 +532,14 @@ Path root CPPipe pathFromEnv:ReactDOM.Client.Root found:false Path ReactDOM.Client.Root.ren Path ren -[{ - "label": "ReactDOM.Client.Root.render", - "kind": 12, - "tags": [], +[ + { "detail": "(t, React.element) => unit", - "documentation": null - }] + "kind": 12, + "label": "ReactDOM.Client.Root.render", + "tags": [] + } +] Complete src/CompletionPipeChain.res 95:20 posCursor:[95:20] posNoWhite:[95:19] Found expr:[95:3->95:21] @@ -521,31 +555,27 @@ Path int CPPipe pathFromEnv:Integer found:true Path Integer. Path -[{ - "label": "Integer.toInt", +[ + { "detail": "t => int", "kind": 12, "label": "Integer.toInt", "tags": [] }, + { + "detail": "(t, int) => t", "kind": 12, - "tags": [], - "detail": "t => int", - "documentation": null - }, { "label": "Integer.increment", + "tags": [] + }, + { + "detail": "(t, int => int) => t", "kind": 12, - "tags": [], - "detail": "(t, int) => t", - "documentation": null - }, { "label": "Integer.decrement", + "tags": [] + }, + { + "detail": "Integer.t => SuperFloat.t", "kind": 12, - "tags": [], - "detail": "(t, int => int) => t", - "documentation": null - }, { "label": "toFlt", - "kind": 12, - "tags": [], - "detail": "Integer.t => SuperFloat.t", - "documentation": null - }] + "tags": [] + } +] Complete src/CompletionPipeChain.res 98:21 posCursor:[98:21] posNoWhite:[98:20] Found expr:[98:3->98:22] @@ -560,19 +590,15 @@ Path int CPPipe pathFromEnv:Integer found:true Path Integer.t Path t -[{ - "label": "Integer.toInt", +[ + { "detail": "t => int", "kind": 12, "label": "Integer.toInt", "tags": [] }, + { + "detail": "Integer.t => SuperFloat.t", "kind": 12, - "tags": [], - "detail": "t => int", - "documentation": null - }, { "label": "toFlt", - "kind": 12, - "tags": [], - "detail": "Integer.t => SuperFloat.t", - "documentation": null - }] + "tags": [] + } +] Complete src/CompletionPipeChain.res 103:8 posCursor:[103:8] posNoWhite:[103:7] Found expr:[103:3->103:8] @@ -584,13 +610,18 @@ ContextPath Value[r] Path r Path Stdlib.RegExp.la Path la -[{ - "label": "RegExp.lastIndex", - "kind": 12, - "tags": [], +[ + { "detail": "t => int", - "documentation": {"kind": "markdown", "value": "\n`lastIndex(regexp)` returns the index the next match will start from.\n\nSee [`RegExp.lastIndex`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/lastIndex) on MDN.\n\n## Examples\n```rescript\n// Match the first word in a sentence\nlet regexp = RegExp.fromString(\"\\\\w+\")\nlet someStr = \"Many words here.\"\n\nConsole.log(regexp->RegExp.lastIndex) // Logs `0` to the console\n\nregexp->RegExp.exec(someStr)->ignore\n\nConsole.log(regexp->RegExp.lastIndex) // Logs `4` to the console\n```\n"} - }] + "documentation": { + "kind": "markdown", + "value": "\n`lastIndex(regexp)` returns the index the next match will start from.\n\nSee [`RegExp.lastIndex`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/lastIndex) on MDN.\n\n## Examples\n```rescript\n// Match the first word in a sentence\nlet regexp = RegExp.fromString(\"\\\\w+\")\nlet someStr = \"Many words here.\"\n\nConsole.log(regexp->RegExp.lastIndex) // Logs `0` to the console\n\nregexp->RegExp.exec(someStr)->ignore\n\nConsole.log(regexp->RegExp.lastIndex) // Logs `4` to the console\n```\n" + }, + "kind": 12, + "label": "RegExp.lastIndex", + "tags": [] + } +] Complete src/CompletionPipeChain.res 112:7 posCursor:[112:7] posNoWhite:[112:6] Found expr:[112:3->0:-1] @@ -603,11 +634,5 @@ Path xx CPPipe pathFromEnv:Xyz found:true Path Xyz. Path -[{ - "label": "Xyz.do", - "kind": 12, - "tags": [], - "detail": "xx => string", - "documentation": null - }] +[ { "detail": "xx => string", "kind": 12, "label": "Xyz.do", "tags": [] } ] diff --git a/tests/analysis_tests/tests/src/expected/CompletionPipeProperty.res.txt b/tests/analysis_tests/tests/src/expected/CompletionPipeProperty.res.txt index 29d9652878d..35d9831e114 100644 --- a/tests/analysis_tests/tests/src/expected/CompletionPipeProperty.res.txt +++ b/tests/analysis_tests/tests/src/expected/CompletionPipeProperty.res.txt @@ -27,41 +27,60 @@ Path anchor CPPipe pathFromEnv:ObservablePoint found:true Path ObservablePoint. Path -[{ - "label": "x", - "kind": 5, - "tags": [], +[ + { "detail": "int", - "documentation": {"kind": "markdown", "value": "```rescript\nx: int\n```\n\n```rescript\ntype op = {mutable x: int, mutable y: int}\n```"} - }, { - "label": "y", + "documentation": { + "kind": "markdown", + "value": "```rescript\nx: int\n```\n\n```rescript\ntype op = {mutable x: int, mutable y: int}\n```" + }, "kind": 5, - "tags": [], + "label": "x", + "tags": [] + }, + { "detail": "int", - "documentation": {"kind": "markdown", "value": "```rescript\ny: int\n```\n\n```rescript\ntype op = {mutable x: int, mutable y: int}\n```"} - }, { - "label": "->ObservablePoint.setBoth", - "kind": 12, - "tags": [], + "documentation": { + "kind": "markdown", + "value": "```rescript\ny: int\n```\n\n```rescript\ntype op = {mutable x: int, mutable y: int}\n```" + }, + "kind": 5, + "label": "y", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 17, "line": 21 }, + "start": { "character": 16, "line": 21 } + } + } + ], "detail": "(op, float) => unit", - "documentation": null, - "sortText": "setBoth", "insertText": "->ObservablePoint.setBoth", - "additionalTextEdits": [{ - "range": {"start": {"line": 21, "character": 16}, "end": {"line": 21, "character": 17}}, - "newText": "" - }] - }, { - "label": "->ObservablePoint.set", "kind": 12, - "tags": [], + "label": "->ObservablePoint.setBoth", + "sortText": "setBoth", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 17, "line": 21 }, + "start": { "character": 16, "line": 21 } + } + } + ], "detail": "(op, float, float) => unit", - "documentation": null, - "sortText": "set", "insertText": "->ObservablePoint.set", - "additionalTextEdits": [{ - "range": {"start": {"line": 21, "character": 16}, "end": {"line": 21, "character": 17}}, - "newText": "" - }] - }] + "kind": 12, + "label": "->ObservablePoint.set", + "sortText": "set", + "tags": [] + } +] diff --git a/tests/analysis_tests/tests/src/expected/CompletionPipeSubmodules.res.txt b/tests/analysis_tests/tests/src/expected/CompletionPipeSubmodules.res.txt index 8c6ad205056..948806c930b 100644 --- a/tests/analysis_tests/tests/src/expected/CompletionPipeSubmodules.res.txt +++ b/tests/analysis_tests/tests/src/expected/CompletionPipeSubmodules.res.txt @@ -11,13 +11,7 @@ Path A.B1.xx CPPipe pathFromEnv:A.B1 found:true Path A.B1. Path -[{ - "label": "A.B1.d", - "kind": 12, - "tags": [], - "detail": "b1 => string", - "documentation": null - }] +[ { "detail": "b1 => string", "kind": 12, "label": "A.B1.d", "tags": [] } ] Complete src/CompletionPipeSubmodules.res 17:18 posCursor:[17:18] posNoWhite:[17:17] Found expr:[17:11->23:23] @@ -39,13 +33,7 @@ Path v CPPipe pathFromEnv:A.B1 found:true Path A.B1. Path -[{ - "label": "A.B1.d", - "kind": 12, - "tags": [], - "detail": "b1 => string", - "documentation": null - }] +[ { "detail": "b1 => string", "kind": 12, "label": "A.B1.d", "tags": [] } ] Complete src/CompletionPipeSubmodules.res 41:20 posCursor:[41:20] posNoWhite:[41:19] Found expr:[41:11->0:-1] @@ -79,13 +67,7 @@ Path v CPPipe pathFromEnv:C found:false Path C. Path -[{ - "label": "C.do", - "kind": 12, - "tags": [], - "detail": "t => string", - "documentation": null - }] +[ { "detail": "t => string", "kind": 12, "label": "C.do", "tags": [] } ] Complete src/CompletionPipeSubmodules.res 45:21 posCursor:[45:21] posNoWhite:[45:20] Found expr:[45:11->0:-1] @@ -119,11 +101,5 @@ Path v2 CPPipe pathFromEnv:D.C2 found:true Path D.C2. Path -[{ - "label": "D.C2.do", - "kind": 12, - "tags": [], - "detail": "t2 => string", - "documentation": null - }] +[ { "detail": "t2 => string", "kind": 12, "label": "D.C2.do", "tags": [] } ] diff --git a/tests/analysis_tests/tests/src/expected/CompletionRegexp.res.txt b/tests/analysis_tests/tests/src/expected/CompletionRegexp.res.txt index 053f84b1d04..52a73734951 100644 --- a/tests/analysis_tests/tests/src/expected/CompletionRegexp.res.txt +++ b/tests/analysis_tests/tests/src/expected/CompletionRegexp.res.txt @@ -8,77 +8,126 @@ ContextPath Value[emailPattern] Path emailPattern Path Stdlib.RegExp. Path -[{ - "label": "RegExp.lastIndex", - "kind": 12, - "tags": [], +[ + { "detail": "t => int", - "documentation": {"kind": "markdown", "value": "\n`lastIndex(regexp)` returns the index the next match will start from.\n\nSee [`RegExp.lastIndex`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/lastIndex) on MDN.\n\n## Examples\n```rescript\n// Match the first word in a sentence\nlet regexp = RegExp.fromString(\"\\\\w+\")\nlet someStr = \"Many words here.\"\n\nConsole.log(regexp->RegExp.lastIndex) // Logs `0` to the console\n\nregexp->RegExp.exec(someStr)->ignore\n\nConsole.log(regexp->RegExp.lastIndex) // Logs `4` to the console\n```\n"} - }, { - "label": "RegExp.setLastIndex", + "documentation": { + "kind": "markdown", + "value": "\n`lastIndex(regexp)` returns the index the next match will start from.\n\nSee [`RegExp.lastIndex`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/lastIndex) on MDN.\n\n## Examples\n```rescript\n// Match the first word in a sentence\nlet regexp = RegExp.fromString(\"\\\\w+\")\nlet someStr = \"Many words here.\"\n\nConsole.log(regexp->RegExp.lastIndex) // Logs `0` to the console\n\nregexp->RegExp.exec(someStr)->ignore\n\nConsole.log(regexp->RegExp.lastIndex) // Logs `4` to the console\n```\n" + }, "kind": 12, - "tags": [], + "label": "RegExp.lastIndex", + "tags": [] + }, + { "detail": "(t, int) => unit", - "documentation": {"kind": "markdown", "value": "\n`setLastIndex(regexp, index)` set the index the next match will start from.\n\nSee [`RegExp.lastIndex`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/lastIndex) on MDN.\n\n## Examples\n```rescript\n// Match the first word in a sentence\nlet regexp = RegExp.fromString(\"\\\\w+\")\nlet someStr = \"Many words here.\"\n\nregexp->RegExp.setLastIndex(4)\nregexp->RegExp.exec(someStr)->ignore\n\nConsole.log(regexp->RegExp.lastIndex) // Logs `10` to the console\n```\n"} - }, { - "label": "RegExp.sticky", + "documentation": { + "kind": "markdown", + "value": "\n`setLastIndex(regexp, index)` set the index the next match will start from.\n\nSee [`RegExp.lastIndex`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/lastIndex) on MDN.\n\n## Examples\n```rescript\n// Match the first word in a sentence\nlet regexp = RegExp.fromString(\"\\\\w+\")\nlet someStr = \"Many words here.\"\n\nregexp->RegExp.setLastIndex(4)\nregexp->RegExp.exec(someStr)->ignore\n\nConsole.log(regexp->RegExp.lastIndex) // Logs `10` to the console\n```\n" + }, "kind": 12, - "tags": [], + "label": "RegExp.setLastIndex", + "tags": [] + }, + { "detail": "t => bool", - "documentation": {"kind": "markdown", "value": "\n`sticky(regexp)` returns whether the sticky (`y`) flag is set on this `RegExp`.\n\nSee [`RegExp.sticky`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/sticky) on MDN.\n\n## Examples\n```rescript\nlet regexp1 = RegExp.fromStringWithFlags(\"\\\\w+\", ~flags=\"g\")\nConsole.log(regexp1->RegExp.unicode) // Logs `false`, since `y` is not set\n\nlet regexp2 = RegExp.fromStringWithFlags(\"\\\\w+\", ~flags=\"my\")\nConsole.log(regexp2->RegExp.unicode) // Logs `true`, since `y` is set\n```\n"} - }, { - "label": "RegExp.ignore", + "documentation": { + "kind": "markdown", + "value": "\n`sticky(regexp)` returns whether the sticky (`y`) flag is set on this `RegExp`.\n\nSee [`RegExp.sticky`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/sticky) on MDN.\n\n## Examples\n```rescript\nlet regexp1 = RegExp.fromStringWithFlags(\"\\\\w+\", ~flags=\"g\")\nConsole.log(regexp1->RegExp.unicode) // Logs `false`, since `y` is not set\n\nlet regexp2 = RegExp.fromStringWithFlags(\"\\\\w+\", ~flags=\"my\")\nConsole.log(regexp2->RegExp.unicode) // Logs `true`, since `y` is set\n```\n" + }, "kind": 12, - "tags": [], + "label": "RegExp.sticky", + "tags": [] + }, + { "detail": "t => unit", - "documentation": {"kind": "markdown", "value": "\n `ignore(regExp)` ignores the provided regExp and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further.\n"} - }, { - "label": "RegExp.exec", + "documentation": { + "kind": "markdown", + "value": "\n `ignore(regExp)` ignores the provided regExp and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further.\n" + }, "kind": 12, - "tags": [], + "label": "RegExp.ignore", + "tags": [] + }, + { "detail": "(t, string) => option", - "documentation": {"kind": "markdown", "value": "\n`exec(regexp, string)` executes the provided regexp on the provided string, optionally returning a `RegExp.Result.t` if the regexp matches on the string.\n\nSee [`RegExp.exec`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/exec) on MDN.\n\n## Examples\n```rescript\n// Match the first word in a sentence\nlet regexp = RegExp.fromString(\"\\\\w+\")\n\nswitch regexp->RegExp.exec(\"ReScript is pretty cool, right?\") {\n| None => Console.log(\"Nope, no match...\")\n| Some(result) => Console.log(result->RegExp.Result.fullMatch) // Prints \"ReScript\"\n}\n```\n"} - }, { - "label": "RegExp.ignoreCase", + "documentation": { + "kind": "markdown", + "value": "\n`exec(regexp, string)` executes the provided regexp on the provided string, optionally returning a `RegExp.Result.t` if the regexp matches on the string.\n\nSee [`RegExp.exec`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/exec) on MDN.\n\n## Examples\n```rescript\n// Match the first word in a sentence\nlet regexp = RegExp.fromString(\"\\\\w+\")\n\nswitch regexp->RegExp.exec(\"ReScript is pretty cool, right?\") {\n| None => Console.log(\"Nope, no match...\")\n| Some(result) => Console.log(result->RegExp.Result.fullMatch) // Prints \"ReScript\"\n}\n```\n" + }, "kind": 12, - "tags": [], + "label": "RegExp.exec", + "tags": [] + }, + { "detail": "t => bool", - "documentation": {"kind": "markdown", "value": "\n`ignoreCase(regexp)` returns whether the ignore case (`i`) flag is set on this `RegExp`.\n\nSee [`RegExp.ignoreCase`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/ignoreCase) on MDN.\n\n## Examples\n```rescript\nlet regexp1 = RegExp.fromStringWithFlags(\"\\\\w+\", ~flags=\"g\")\nConsole.log(regexp1->RegExp.ignoreCase) // Logs `false`, since `i` is not set\n\nlet regexp2 = RegExp.fromStringWithFlags(\"\\\\w+\", ~flags=\"i\")\nConsole.log(regexp2->RegExp.ignoreCase) // Logs `true`, since `i` is set\n```\n"} - }, { - "label": "RegExp.global", + "documentation": { + "kind": "markdown", + "value": "\n`ignoreCase(regexp)` returns whether the ignore case (`i`) flag is set on this `RegExp`.\n\nSee [`RegExp.ignoreCase`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/ignoreCase) on MDN.\n\n## Examples\n```rescript\nlet regexp1 = RegExp.fromStringWithFlags(\"\\\\w+\", ~flags=\"g\")\nConsole.log(regexp1->RegExp.ignoreCase) // Logs `false`, since `i` is not set\n\nlet regexp2 = RegExp.fromStringWithFlags(\"\\\\w+\", ~flags=\"i\")\nConsole.log(regexp2->RegExp.ignoreCase) // Logs `true`, since `i` is set\n```\n" + }, "kind": 12, - "tags": [], + "label": "RegExp.ignoreCase", + "tags": [] + }, + { "detail": "t => bool", - "documentation": {"kind": "markdown", "value": "\n`global(regexp)` returns whether the global (`g`) flag is set on this `RegExp`.\n\nSee [`RegExp.global`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/global) on MDN.\n\n## Examples\n```rescript\nlet regexp1 = RegExp.fromStringWithFlags(\"\\\\w+\", ~flags=\"g\")\nConsole.log(regexp1->RegExp.global) // Logs `true`, since `g` is set\n\nlet regexp2 = RegExp.fromStringWithFlags(\"\\\\w+\", ~flags=\"i\")\nConsole.log(regexp2->RegExp.global) // Logs `false`, since `g` is not set\n```\n"} - }, { - "label": "RegExp.multiline", + "documentation": { + "kind": "markdown", + "value": "\n`global(regexp)` returns whether the global (`g`) flag is set on this `RegExp`.\n\nSee [`RegExp.global`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/global) on MDN.\n\n## Examples\n```rescript\nlet regexp1 = RegExp.fromStringWithFlags(\"\\\\w+\", ~flags=\"g\")\nConsole.log(regexp1->RegExp.global) // Logs `true`, since `g` is set\n\nlet regexp2 = RegExp.fromStringWithFlags(\"\\\\w+\", ~flags=\"i\")\nConsole.log(regexp2->RegExp.global) // Logs `false`, since `g` is not set\n```\n" + }, "kind": 12, - "tags": [], + "label": "RegExp.global", + "tags": [] + }, + { "detail": "t => bool", - "documentation": {"kind": "markdown", "value": "\n`multiline(regexp)` returns whether the multiline (`m`) flag is set on this `RegExp`.\n\nSee [`RegExp.multiline`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/multiline) on MDN.\n\n## Examples\n```rescript\nlet regexp1 = RegExp.fromStringWithFlags(\"\\\\w+\", ~flags=\"g\")\nConsole.log(regexp1->RegExp.multiline) // Logs `false`, since `m` is not set\n\nlet regexp2 = RegExp.fromStringWithFlags(\"\\\\w+\", ~flags=\"mi\")\nConsole.log(regexp2->RegExp.multiline) // Logs `true`, since `m` is set\n```\n"} - }, { - "label": "RegExp.test", + "documentation": { + "kind": "markdown", + "value": "\n`multiline(regexp)` returns whether the multiline (`m`) flag is set on this `RegExp`.\n\nSee [`RegExp.multiline`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/multiline) on MDN.\n\n## Examples\n```rescript\nlet regexp1 = RegExp.fromStringWithFlags(\"\\\\w+\", ~flags=\"g\")\nConsole.log(regexp1->RegExp.multiline) // Logs `false`, since `m` is not set\n\nlet regexp2 = RegExp.fromStringWithFlags(\"\\\\w+\", ~flags=\"mi\")\nConsole.log(regexp2->RegExp.multiline) // Logs `true`, since `m` is set\n```\n" + }, "kind": 12, - "tags": [], + "label": "RegExp.multiline", + "tags": [] + }, + { "detail": "(t, string) => bool", - "documentation": {"kind": "markdown", "value": "\n`test(regexp, string)` tests whether the provided `regexp` matches on the provided string.\n\nSee [`RegExp.test`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/test) on MDN.\n\n## Examples\n```rescript\n// Match the first word in a sentence\nlet regexp = RegExp.fromString(\"\\\\w+\")\n\nif regexp->RegExp.test(\"ReScript is cool!\") {\n Console.log(\"Yay, there's a word in there.\")\n}\n```\n"} - }, { - "label": "RegExp.unicode", + "documentation": { + "kind": "markdown", + "value": "\n`test(regexp, string)` tests whether the provided `regexp` matches on the provided string.\n\nSee [`RegExp.test`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/test) on MDN.\n\n## Examples\n```rescript\n// Match the first word in a sentence\nlet regexp = RegExp.fromString(\"\\\\w+\")\n\nif regexp->RegExp.test(\"ReScript is cool!\") {\n Console.log(\"Yay, there's a word in there.\")\n}\n```\n" + }, "kind": 12, - "tags": [], + "label": "RegExp.test", + "tags": [] + }, + { "detail": "t => bool", - "documentation": {"kind": "markdown", "value": "\n`unicode(regexp)` returns whether the unicode (`y`) flag is set on this `RegExp`.\n\nSee [`RegExp.unicode`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/unicode) on MDN.\n\n## Examples\n```rescript\nlet regexp1 = RegExp.fromStringWithFlags(\"\\\\w+\", ~flags=\"g\")\nConsole.log(regexp1->RegExp.unicode) // Logs `false`, since `u` is not set\n\nlet regexp2 = RegExp.fromStringWithFlags(\"\\\\w+\", ~flags=\"mu\")\nConsole.log(regexp2->RegExp.unicode) // Logs `true`, since `u` is set\n```\n"} - }, { - "label": "RegExp.source", + "documentation": { + "kind": "markdown", + "value": "\n`unicode(regexp)` returns whether the unicode (`y`) flag is set on this `RegExp`.\n\nSee [`RegExp.unicode`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/unicode) on MDN.\n\n## Examples\n```rescript\nlet regexp1 = RegExp.fromStringWithFlags(\"\\\\w+\", ~flags=\"g\")\nConsole.log(regexp1->RegExp.unicode) // Logs `false`, since `u` is not set\n\nlet regexp2 = RegExp.fromStringWithFlags(\"\\\\w+\", ~flags=\"mu\")\nConsole.log(regexp2->RegExp.unicode) // Logs `true`, since `u` is set\n```\n" + }, "kind": 12, - "tags": [], + "label": "RegExp.unicode", + "tags": [] + }, + { "detail": "t => string", - "documentation": {"kind": "markdown", "value": "\n`source(regexp)` returns the source text for this `RegExp`, without the two forward slashes (if present), and without any set flags.\n\nSee [`RegExp.source`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/source) on MDN.\n\n## Examples\n```rescript\nlet regexp = RegExp.fromStringWithFlags(\"\\\\w+\", ~flags=\"g\")\nConsole.log(regexp->RegExp.source) // Logs `\\w+`, the source text of the `RegExp`\n```\n"} - }, { - "label": "RegExp.flags", + "documentation": { + "kind": "markdown", + "value": "\n`source(regexp)` returns the source text for this `RegExp`, without the two forward slashes (if present), and without any set flags.\n\nSee [`RegExp.source`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/source) on MDN.\n\n## Examples\n```rescript\nlet regexp = RegExp.fromStringWithFlags(\"\\\\w+\", ~flags=\"g\")\nConsole.log(regexp->RegExp.source) // Logs `\\w+`, the source text of the `RegExp`\n```\n" + }, "kind": 12, - "tags": [], + "label": "RegExp.source", + "tags": [] + }, + { "detail": "t => string", - "documentation": {"kind": "markdown", "value": "\n`flags(regexp)` returns a string consisting of all the flags set on this `RegExp`.\n\nSee [`RegExp.flags`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/flags) on MDN.\n\n## Examples\n```rescript\nlet regexp = RegExp.fromString(\"\\\\w+\", ~flags=\"gi\")\nConsole.log(regexp->RegExp.flags) // Logs \"gi\", all the flags set on the RegExp\n```\n"} - }] + "documentation": { + "kind": "markdown", + "value": "\n`flags(regexp)` returns a string consisting of all the flags set on this `RegExp`.\n\nSee [`RegExp.flags`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/flags) on MDN.\n\n## Examples\n```rescript\nlet regexp = RegExp.fromString(\"\\\\w+\", ~flags=\"gi\")\nConsole.log(regexp->RegExp.flags) // Logs \"gi\", all the flags set on the RegExp\n```\n" + }, + "kind": 12, + "label": "RegExp.flags", + "tags": [] + } +] diff --git a/tests/analysis_tests/tests/src/expected/CompletionTaggedTemplate.res.txt b/tests/analysis_tests/tests/src/expected/CompletionTaggedTemplate.res.txt index 2cfc84238d7..7fe6d09ca6a 100644 --- a/tests/analysis_tests/tests/src/expected/CompletionTaggedTemplate.res.txt +++ b/tests/analysis_tests/tests/src/expected/CompletionTaggedTemplate.res.txt @@ -13,43 +13,59 @@ Path w CPPipe pathFromEnv:M found:true Path M. Path -[{ - "label": "->M.xyz", - "kind": 12, - "tags": [], +[ + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 13, "line": 13 }, + "start": { "character": 12, "line": 13 } + } + } + ], "detail": "(t, int) => int", - "documentation": null, - "sortText": "xyz", "insertText": "->M.xyz", - "additionalTextEdits": [{ - "range": {"start": {"line": 13, "character": 12}, "end": {"line": 13, "character": 13}}, - "newText": "" - }] - }, { - "label": "->M.b", "kind": 12, - "tags": [], + "label": "->M.xyz", + "sortText": "xyz", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 13, "line": 13 }, + "start": { "character": 12, "line": 13 } + } + } + ], "detail": "t => string", - "documentation": null, - "sortText": "b", "insertText": "->M.b", - "additionalTextEdits": [{ - "range": {"start": {"line": 13, "character": 12}, "end": {"line": 13, "character": 13}}, - "newText": "" - }] - }, { - "label": "->M.a", "kind": 12, - "tags": [], + "label": "->M.b", + "sortText": "b", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 13, "line": 13 }, + "start": { "character": 12, "line": 13 } + } + } + ], "detail": "t => int", - "documentation": null, - "sortText": "a", "insertText": "->M.a", - "additionalTextEdits": [{ - "range": {"start": {"line": 13, "character": 12}, "end": {"line": 13, "character": 13}}, - "newText": "" - }] - }] + "kind": 12, + "label": "->M.a", + "sortText": "a", + "tags": [] + } +] Complete src/CompletionTaggedTemplate.res 16:20 posCursor:[16:20] posNoWhite:[16:19] Found expr:[16:11->0:-1] @@ -67,41 +83,57 @@ Path meh CPPipe pathFromEnv:M found:true Path M. Path -[{ - "label": "->M.xyz", - "kind": 12, - "tags": [], +[ + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 20, "line": 16 }, + "start": { "character": 19, "line": 16 } + } + } + ], "detail": "(t, int) => int", - "documentation": null, - "sortText": "xyz", "insertText": "->M.xyz", - "additionalTextEdits": [{ - "range": {"start": {"line": 16, "character": 19}, "end": {"line": 16, "character": 20}}, - "newText": "" - }] - }, { - "label": "->M.b", "kind": 12, - "tags": [], + "label": "->M.xyz", + "sortText": "xyz", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 20, "line": 16 }, + "start": { "character": 19, "line": 16 } + } + } + ], "detail": "t => string", - "documentation": null, - "sortText": "b", "insertText": "->M.b", - "additionalTextEdits": [{ - "range": {"start": {"line": 16, "character": 19}, "end": {"line": 16, "character": 20}}, - "newText": "" - }] - }, { - "label": "->M.a", "kind": 12, - "tags": [], + "label": "->M.b", + "sortText": "b", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 20, "line": 16 }, + "start": { "character": 19, "line": 16 } + } + } + ], "detail": "t => int", - "documentation": null, - "sortText": "a", "insertText": "->M.a", - "additionalTextEdits": [{ - "range": {"start": {"line": 16, "character": 19}, "end": {"line": 16, "character": 20}}, - "newText": "" - }] - }] + "kind": 12, + "label": "->M.a", + "sortText": "a", + "tags": [] + } +] diff --git a/tests/analysis_tests/tests/src/expected/CompletionTypeAnnotation.res.txt b/tests/analysis_tests/tests/src/expected/CompletionTypeAnnotation.res.txt index 8a30600d10b..79dbbe34d43 100644 --- a/tests/analysis_tests/tests/src/expected/CompletionTypeAnnotation.res.txt +++ b/tests/analysis_tests/tests/src/expected/CompletionTypeAnnotation.res.txt @@ -5,16 +5,21 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Type[someRecord] Path someRecord -[{ - "label": "{}", - "kind": 12, - "tags": [], +[ + { "detail": "someRecord", - "documentation": {"kind": "markdown", "value": "```rescript\ntype someRecord = {age: int, name: string}\n```"}, - "sortText": "A", + "documentation": { + "kind": "markdown", + "value": "```rescript\ntype someRecord = {age: int, name: string}\n```" + }, "insertText": "{$0}", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 12, + "label": "{}", + "sortText": "A", + "tags": [] + } +] Complete src/CompletionTypeAnnotation.res 12:24 XXX Not found! @@ -23,19 +28,28 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Type[someRecord] Path someRecord -[{ - "label": "age", - "kind": 5, - "tags": [], +[ + { "detail": "int", - "documentation": {"kind": "markdown", "value": "```rescript\nage: int\n```\n\n```rescript\ntype someRecord = {age: int, name: string}\n```"} - }, { - "label": "name", + "documentation": { + "kind": "markdown", + "value": "```rescript\nage: int\n```\n\n```rescript\ntype someRecord = {age: int, name: string}\n```" + }, "kind": 5, - "tags": [], + "label": "age", + "tags": [] + }, + { "detail": "string", - "documentation": {"kind": "markdown", "value": "```rescript\nname: string\n```\n\n```rescript\ntype someRecord = {age: int, name: string}\n```"} - }] + "documentation": { + "kind": "markdown", + "value": "```rescript\nname: string\n```\n\n```rescript\ntype someRecord = {age: int, name: string}\n```" + }, + "kind": 5, + "label": "name", + "tags": [] + } +] Complete src/CompletionTypeAnnotation.res 15:23 XXX Not found! @@ -44,23 +58,32 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Type[someVariant] Path someVariant -[{ - "label": "One", - "kind": 4, - "tags": [], +[ + { "detail": "One", - "documentation": {"kind": "markdown", "value": "```rescript\nOne\n```\n\n```rescript\ntype someVariant = One | Two(bool)\n```"}, + "documentation": { + "kind": "markdown", + "value": "```rescript\nOne\n```\n\n```rescript\ntype someVariant = One | Two(bool)\n```" + }, "insertText": "One", - "insertTextFormat": 2 - }, { - "label": "Two(_)", + "insertTextFormat": 2, "kind": 4, - "tags": [], + "label": "One", + "tags": [] + }, + { "detail": "Two(bool)", - "documentation": {"kind": "markdown", "value": "```rescript\nTwo(bool)\n```\n\n```rescript\ntype someVariant = One | Two(bool)\n```"}, + "documentation": { + "kind": "markdown", + "value": "```rescript\nTwo(bool)\n```\n\n```rescript\ntype someVariant = One | Two(bool)\n```" + }, "insertText": "Two($0)", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 4, + "label": "Two(_)", + "tags": [] + } +] Complete src/CompletionTypeAnnotation.res 18:25 XXX Not found! @@ -69,54 +92,44 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Type[someVariant] Path someVariant -[{ - "label": "One", - "kind": 4, - "tags": [], +[ + { "detail": "One", - "documentation": {"kind": "markdown", "value": "```rescript\nOne\n```\n\n```rescript\ntype someVariant = One | Two(bool)\n```"}, - "sortText": "A One", + "documentation": { + "kind": "markdown", + "value": "```rescript\nOne\n```\n\n```rescript\ntype someVariant = One | Two(bool)\n```" + }, "insertText": "One", - "insertTextFormat": 2 - }, { - "label": "Option", - "kind": 9, - "tags": [], - "detail": "module Option", - "documentation": null - }, { - "label": "Ordering", - "kind": 9, - "tags": [], - "detail": "module Ordering", - "documentation": null - }, { - "label": "Object", - "kind": 9, - "tags": [], - "detail": "module Object", - "documentation": null - }, { - "label": "Obj", - "kind": 9, - "tags": [], - "detail": "module Obj", - "documentation": null, + "insertTextFormat": 2, + "kind": 4, + "label": "One", + "sortText": "A One", + "tags": [] + }, + { "detail": "module Option", "kind": 9, "label": "Option", "tags": [] }, + { "detail": "module Ordering", "kind": 9, "label": "Ordering", "tags": [] }, + { "detail": "module Object", "kind": 9, "label": "Object", "tags": [] }, + { "data": { "modulePath": "Obj", "filePath": "src/CompletionTypeAnnotation.res" - } - }, { - "label": "Objects", + }, + "detail": "module Obj", "kind": 9, - "tags": [], - "detail": "module Objects", - "documentation": null, + "label": "Obj", + "tags": [] + }, + { "data": { "modulePath": "Objects", "filePath": "src/CompletionTypeAnnotation.res" - } - }] + }, + "detail": "module Objects", + "kind": 9, + "label": "Objects", + "tags": [] + } +] Complete src/CompletionTypeAnnotation.res 21:27 XXX Not found! @@ -125,23 +138,32 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Type[somePolyVariant] Path somePolyVariant -[{ - "label": "#one", - "kind": 4, - "tags": [], +[ + { "detail": "#one", - "documentation": {"kind": "markdown", "value": "```rescript\n#one\n```\n\n```rescript\n[#one | #two(bool)]\n```"}, + "documentation": { + "kind": "markdown", + "value": "```rescript\n#one\n```\n\n```rescript\n[#one | #two(bool)]\n```" + }, "insertText": "#one", - "insertTextFormat": 2 - }, { - "label": "#two(_)", + "insertTextFormat": 2, "kind": 4, - "tags": [], + "label": "#one", + "tags": [] + }, + { "detail": "#two(bool)", - "documentation": {"kind": "markdown", "value": "```rescript\n#two(bool)\n```\n\n```rescript\n[#one | #two(bool)]\n```"}, + "documentation": { + "kind": "markdown", + "value": "```rescript\n#two(bool)\n```\n\n```rescript\n[#one | #two(bool)]\n```" + }, "insertText": "#two($0)", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 4, + "label": "#two(_)", + "tags": [] + } +] Complete src/CompletionTypeAnnotation.res 24:30 XXX Not found! @@ -150,15 +172,20 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Type[somePolyVariant] Path somePolyVariant -[{ - "label": "#one", - "kind": 4, - "tags": [], +[ + { "detail": "#one", - "documentation": {"kind": "markdown", "value": "```rescript\n#one\n```\n\n```rescript\n[#one | #two(bool)]\n```"}, + "documentation": { + "kind": "markdown", + "value": "```rescript\n#one\n```\n\n```rescript\n[#one | #two(bool)]\n```" + }, "insertText": "one", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 4, + "label": "#one", + "tags": [] + } +] Complete src/CompletionTypeAnnotation.res 29:20 XXX Not found! @@ -167,16 +194,17 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Type[someFunc] Path someFunc -[{ - "label": "(v1, v2) => {}", - "kind": 12, - "tags": [], +[ + { "detail": "(int, string) => bool", - "documentation": null, - "sortText": "A", "insertText": "(${1:v1}, ${2:v2}) => {${0:()}}", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 12, + "label": "(v1, v2) => {}", + "sortText": "A", + "tags": [] + } +] Complete src/CompletionTypeAnnotation.res 34:21 XXX Not found! @@ -185,15 +213,16 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Type[someTuple] Path someTuple -[{ - "label": "(_, _)", - "kind": 12, - "tags": [], +[ + { "detail": "(bool, option)", - "documentation": null, "insertText": "(${1:_}, ${2:_})", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 12, + "label": "(_, _)", + "tags": [] + } +] Complete src/CompletionTypeAnnotation.res 37:28 XXX Not found! @@ -202,33 +231,19 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Type[someTuple] Path someTuple -[{ - "label": "None", - "kind": 12, - "tags": [], - "detail": "bool", - "documentation": null - }, { - "label": "Some(_)", - "kind": 12, - "tags": [], +[ + { "detail": "bool", "kind": 12, "label": "None", "tags": [] }, + { "detail": "bool", - "documentation": null, "insertText": "Some($0)", - "insertTextFormat": 2 - }, { - "label": "Some(true)", - "kind": 4, - "tags": [], - "detail": "bool", - "documentation": null - }, { - "label": "Some(false)", - "kind": 4, - "tags": [], - "detail": "bool", - "documentation": null - }] + "insertTextFormat": 2, + "kind": 12, + "label": "Some(_)", + "tags": [] + }, + { "detail": "bool", "kind": 4, "label": "Some(true)", "tags": [] }, + { "detail": "bool", "kind": 4, "label": "Some(false)", "tags": [] } +] Complete src/CompletionTypeAnnotation.res 40:31 XXX Not found! @@ -238,37 +253,54 @@ Resolved opens 1 Stdlib ContextPath option ContextPath Type[someVariant] Path someVariant -[{ - "label": "None", - "kind": 12, - "tags": [], +[ + { "detail": "someVariant", - "documentation": {"kind": "markdown", "value": "```rescript\ntype someVariant = One | Two(bool)\n```"} - }, { - "label": "Some(_)", + "documentation": { + "kind": "markdown", + "value": "```rescript\ntype someVariant = One | Two(bool)\n```" + }, "kind": 12, - "tags": [], + "label": "None", + "tags": [] + }, + { "detail": "someVariant", - "documentation": {"kind": "markdown", "value": "```rescript\ntype someVariant = One | Two(bool)\n```"}, + "documentation": { + "kind": "markdown", + "value": "```rescript\ntype someVariant = One | Two(bool)\n```" + }, "insertText": "Some($0)", - "insertTextFormat": 2 - }, { - "label": "Some(One)", - "kind": 4, - "tags": [], + "insertTextFormat": 2, + "kind": 12, + "label": "Some(_)", + "tags": [] + }, + { "detail": "One", - "documentation": {"kind": "markdown", "value": "```rescript\nOne\n```\n\n```rescript\ntype someVariant = One | Two(bool)\n```"}, + "documentation": { + "kind": "markdown", + "value": "```rescript\nOne\n```\n\n```rescript\ntype someVariant = One | Two(bool)\n```" + }, "insertText": "Some(One)", - "insertTextFormat": 2 - }, { - "label": "Some(Two(_))", + "insertTextFormat": 2, "kind": 4, - "tags": [], + "label": "Some(One)", + "tags": [] + }, + { "detail": "Two(bool)", - "documentation": {"kind": "markdown", "value": "```rescript\nTwo(bool)\n```\n\n```rescript\ntype someVariant = One | Two(bool)\n```"}, + "documentation": { + "kind": "markdown", + "value": "```rescript\nTwo(bool)\n```\n\n```rescript\ntype someVariant = One | Two(bool)\n```" + }, "insertText": "Some(Two($0))", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 4, + "label": "Some(Two(_))", + "tags": [] + } +] Complete src/CompletionTypeAnnotation.res 43:37 XXX Not found! @@ -278,23 +310,32 @@ Resolved opens 1 Stdlib ContextPath option ContextPath Type[someVariant] Path someVariant -[{ - "label": "One", - "kind": 4, - "tags": [], +[ + { "detail": "One", - "documentation": {"kind": "markdown", "value": "```rescript\nOne\n```\n\n```rescript\ntype someVariant = One | Two(bool)\n```"}, + "documentation": { + "kind": "markdown", + "value": "```rescript\nOne\n```\n\n```rescript\ntype someVariant = One | Two(bool)\n```" + }, "insertText": "One", - "insertTextFormat": 2 - }, { - "label": "Two(_)", + "insertTextFormat": 2, "kind": 4, - "tags": [], + "label": "One", + "tags": [] + }, + { "detail": "Two(bool)", - "documentation": {"kind": "markdown", "value": "```rescript\nTwo(bool)\n```\n\n```rescript\ntype someVariant = One | Two(bool)\n```"}, + "documentation": { + "kind": "markdown", + "value": "```rescript\nTwo(bool)\n```\n\n```rescript\ntype someVariant = One | Two(bool)\n```" + }, "insertText": "Two($0)", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 4, + "label": "Two(_)", + "tags": [] + } +] Complete src/CompletionTypeAnnotation.res 46:30 XXX Not found! @@ -304,16 +345,21 @@ Resolved opens 1 Stdlib ContextPath array ContextPath Type[someVariant] Path someVariant -[{ - "label": "[]", - "kind": 12, - "tags": [], +[ + { "detail": "someVariant", - "documentation": {"kind": "markdown", "value": "```rescript\ntype someVariant = One | Two(bool)\n```"}, - "sortText": "A", + "documentation": { + "kind": "markdown", + "value": "```rescript\ntype someVariant = One | Two(bool)\n```" + }, "insertText": "[$0]", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 12, + "label": "[]", + "sortText": "A", + "tags": [] + } +] Complete src/CompletionTypeAnnotation.res 49:32 XXX Not found! @@ -323,23 +369,32 @@ Resolved opens 1 Stdlib ContextPath array ContextPath Type[someVariant] Path someVariant -[{ - "label": "One", - "kind": 4, - "tags": [], +[ + { "detail": "One", - "documentation": {"kind": "markdown", "value": "```rescript\nOne\n```\n\n```rescript\ntype someVariant = One | Two(bool)\n```"}, + "documentation": { + "kind": "markdown", + "value": "```rescript\nOne\n```\n\n```rescript\ntype someVariant = One | Two(bool)\n```" + }, "insertText": "One", - "insertTextFormat": 2 - }, { - "label": "Two(_)", + "insertTextFormat": 2, "kind": 4, - "tags": [], + "label": "One", + "tags": [] + }, + { "detail": "Two(bool)", - "documentation": {"kind": "markdown", "value": "```rescript\nTwo(bool)\n```\n\n```rescript\ntype someVariant = One | Two(bool)\n```"}, + "documentation": { + "kind": "markdown", + "value": "```rescript\nTwo(bool)\n```\n\n```rescript\ntype someVariant = One | Two(bool)\n```" + }, "insertText": "Two($0)", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 4, + "label": "Two(_)", + "tags": [] + } +] Complete src/CompletionTypeAnnotation.res 52:38 XXX Not found! @@ -350,16 +405,21 @@ ContextPath array> ContextPath option ContextPath Type[someVariant] Path someVariant -[{ - "label": "[]", - "kind": 12, - "tags": [], +[ + { "detail": "option", - "documentation": {"kind": "markdown", "value": "```rescript\noption\n```"}, - "sortText": "A", + "documentation": { + "kind": "markdown", + "value": "```rescript\noption\n```" + }, "insertText": "[$0]", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 12, + "label": "[]", + "sortText": "A", + "tags": [] + } +] Complete src/CompletionTypeAnnotation.res 55:45 XXX Not found! @@ -370,21 +430,30 @@ ContextPath option> ContextPath array ContextPath Type[someVariant] Path someVariant -[{ - "label": "One", - "kind": 4, - "tags": [], +[ + { "detail": "One", - "documentation": {"kind": "markdown", "value": "```rescript\nOne\n```\n\n```rescript\ntype someVariant = One | Two(bool)\n```"}, + "documentation": { + "kind": "markdown", + "value": "```rescript\nOne\n```\n\n```rescript\ntype someVariant = One | Two(bool)\n```" + }, "insertText": "One", - "insertTextFormat": 2 - }, { - "label": "Two(_)", + "insertTextFormat": 2, "kind": 4, - "tags": [], + "label": "One", + "tags": [] + }, + { "detail": "Two(bool)", - "documentation": {"kind": "markdown", "value": "```rescript\nTwo(bool)\n```\n\n```rescript\ntype someVariant = One | Two(bool)\n```"}, + "documentation": { + "kind": "markdown", + "value": "```rescript\nTwo(bool)\n```\n\n```rescript\ntype someVariant = One | Two(bool)\n```" + }, "insertText": "Two($0)", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 4, + "label": "Two(_)", + "tags": [] + } +] diff --git a/tests/analysis_tests/tests/src/expected/CompletionTypeT.res.txt b/tests/analysis_tests/tests/src/expected/CompletionTypeT.res.txt index 9adbcead38a..e09021182eb 100644 --- a/tests/analysis_tests/tests/src/expected/CompletionTypeT.res.txt +++ b/tests/analysis_tests/tests/src/expected/CompletionTypeT.res.txt @@ -5,29 +5,38 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Value[date] Path date -[{ - "label": "None", - "kind": 12, - "tags": [], +[ + { "detail": "Date.t", - "documentation": {"kind": "markdown", "value": "\nA type representing a JavaScript date.\n"} - }, { - "label": "Some(_)", + "documentation": { + "kind": "markdown", + "value": "\nA type representing a JavaScript date.\n" + }, "kind": 12, - "tags": [], + "label": "None", + "tags": [] + }, + { "detail": "Date.t", - "documentation": {"kind": "markdown", "value": "\nA type representing a JavaScript date.\n"}, + "documentation": { + "kind": "markdown", + "value": "\nA type representing a JavaScript date.\n" + }, "insertText": "Some(${1:_})", - "insertTextFormat": 2 - }, { - "label": "Some(date)", - "kind": 4, - "tags": [], + "insertTextFormat": 2, + "kind": 12, + "label": "Some(_)", + "tags": [] + }, + { "detail": "date", - "documentation": null, "insertText": "Some(${0:date})", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 4, + "label": "Some(date)", + "tags": [] + } +] Complete src/CompletionTypeT.res 7:27 XXX Not found! @@ -36,77 +45,78 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Type[withDate] Path withDate -[{ - "label": "Date.makeWithYMD()", - "kind": 12, - "tags": [], +[ + { "detail": "(~year: int, ~month: int, ~day: int) => t", - "documentation": null, "insertText": "Date.makeWithYMD($0)", - "insertTextFormat": 2 - }, { - "label": "Date.makeWithYMDHM()", + "insertTextFormat": 2, "kind": 12, - "tags": [], + "label": "Date.makeWithYMD()", + "tags": [] + }, + { "detail": "(\n ~year: int,\n ~month: int,\n ~day: int,\n ~hours: int,\n ~minutes: int,\n) => t", - "documentation": null, "insertText": "Date.makeWithYMDHM($0)", - "insertTextFormat": 2 - }, { - "label": "Date.make()", + "insertTextFormat": 2, "kind": 12, - "tags": [], + "label": "Date.makeWithYMDHM()", + "tags": [] + }, + { "detail": "unit => t", - "documentation": null, "insertText": "Date.make($0)", - "insertTextFormat": 2 - }, { - "label": "Date.fromTime()", + "insertTextFormat": 2, "kind": 12, - "tags": [], + "label": "Date.make()", + "tags": [] + }, + { "detail": "msSinceEpoch => t", - "documentation": null, "insertText": "Date.fromTime($0)", - "insertTextFormat": 2 - }, { - "label": "Date.fromString()", + "insertTextFormat": 2, "kind": 12, - "tags": [], + "label": "Date.fromTime()", + "tags": [] + }, + { "detail": "string => t", - "documentation": null, "insertText": "Date.fromString($0)", - "insertTextFormat": 2 - }, { - "label": "Date.makeWithYMDHMSM()", + "insertTextFormat": 2, "kind": 12, - "tags": [], + "label": "Date.fromString()", + "tags": [] + }, + { "detail": "(\n ~year: int,\n ~month: int,\n ~day: int,\n ~hours: int,\n ~minutes: int,\n ~seconds: int,\n ~milliseconds: int,\n) => t", - "documentation": null, "insertText": "Date.makeWithYMDHMSM($0)", - "insertTextFormat": 2 - }, { - "label": "Date.makeWithYM()", + "insertTextFormat": 2, "kind": 12, - "tags": [], + "label": "Date.makeWithYMDHMSM()", + "tags": [] + }, + { "detail": "(~year: int, ~month: int) => t", - "documentation": null, "insertText": "Date.makeWithYM($0)", - "insertTextFormat": 2 - }, { - "label": "Date.makeWithYMDHMS()", + "insertTextFormat": 2, "kind": 12, - "tags": [], + "label": "Date.makeWithYM()", + "tags": [] + }, + { "detail": "(\n ~year: int,\n ~month: int,\n ~day: int,\n ~hours: int,\n ~minutes: int,\n ~seconds: int,\n) => t", - "documentation": null, "insertText": "Date.makeWithYMDHMS($0)", - "insertTextFormat": 2 - }, { - "label": "Date.makeWithYMDH()", + "insertTextFormat": 2, "kind": 12, - "tags": [], + "label": "Date.makeWithYMDHMS()", + "tags": [] + }, + { "detail": "(~year: int, ~month: int, ~day: int, ~hours: int) => t", - "documentation": null, "insertText": "Date.makeWithYMDH($0)", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 12, + "label": "Date.makeWithYMDH()", + "tags": [] + } +] diff --git a/tests/analysis_tests/tests/src/expected/CompletionTypedArrays.res.txt b/tests/analysis_tests/tests/src/expected/CompletionTypedArrays.res.txt index ee9e5f9972d..c9dff580bac 100644 --- a/tests/analysis_tests/tests/src/expected/CompletionTypedArrays.res.txt +++ b/tests/analysis_tests/tests/src/expected/CompletionTypedArrays.res.txt @@ -14,679 +14,1188 @@ CPPipe pathFromEnv:Stdlib.BigInt64Array found:false Path Stdlib.BigInt64Array. Path Stdlib.TypedArray. Path -[{ - "label": "->BigInt64Array.ignore", - "kind": 12, - "tags": [], +[ + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 17, "line": 1 }, + "start": { "character": 16, "line": 1 } + } + } + ], "detail": "t => unit", - "documentation": {"kind": "markdown", "value": "\n `ignore(bigIntArray)` ignores the provided bigIntArray and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further.\n"}, - "sortText": "ignore", + "documentation": { + "kind": "markdown", + "value": "\n `ignore(bigIntArray)` ignores the provided bigIntArray and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further.\n" + }, "insertText": "->BigInt64Array.ignore", - "additionalTextEdits": [{ - "range": {"start": {"line": 1, "character": 16}, "end": {"line": 1, "character": 17}}, - "newText": "" - }] - }, { - "label": "->TypedArray.findLastIndexWithIndex", "kind": 12, - "tags": [], + "label": "->BigInt64Array.ignore", + "sortText": "ignore", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 17, "line": 1 }, + "start": { "character": 16, "line": 1 } + } + } + ], "detail": "(t<'a>, ('a, int) => bool) => int", - "documentation": {"kind": "markdown", "value": "\n`findLastIndexWithIndex(typedArray, predicate)` is the indexed variant of `findLastIndex`.\n"}, - "sortText": "findLastIndexWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`findLastIndexWithIndex(typedArray, predicate)` is the indexed variant of `findLastIndex`.\n" + }, "insertText": "->TypedArray.findLastIndexWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 1, "character": 16}, "end": {"line": 1, "character": 17}}, - "newText": "" - }] - }, { - "label": "->TypedArray.lastIndexOf", "kind": 12, - "tags": [], + "label": "->TypedArray.findLastIndexWithIndex", + "sortText": "findLastIndexWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 17, "line": 1 }, + "start": { "character": 16, "line": 1 } + } + } + ], "detail": "(t<'a>, 'a) => int", - "documentation": {"kind": "markdown", "value": "\n`lastIndexOf(typedArray, value)` returns the last index of `value`, or `-1` if not found.\n\nSee [`TypedArray.prototype.lastIndexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/lastIndexOf) on MDN.\n"}, - "sortText": "lastIndexOf", + "documentation": { + "kind": "markdown", + "value": "\n`lastIndexOf(typedArray, value)` returns the last index of `value`, or `-1` if not found.\n\nSee [`TypedArray.prototype.lastIndexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/lastIndexOf) on MDN.\n" + }, "insertText": "->TypedArray.lastIndexOf", - "additionalTextEdits": [{ - "range": {"start": {"line": 1, "character": 16}, "end": {"line": 1, "character": 17}}, - "newText": "" - }] - }, { - "label": "->TypedArray.findLastWithIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.lastIndexOf", + "sortText": "lastIndexOf", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 17, "line": 1 }, + "start": { "character": 16, "line": 1 } + } + } + ], "detail": "(t<'a>, ('a, int) => bool) => option<'a>", - "documentation": {"kind": "markdown", "value": "\n`findLastWithIndex(typedArray, predicate)` is the indexed variant of `findLast`.\n"}, - "sortText": "findLastWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`findLastWithIndex(typedArray, predicate)` is the indexed variant of `findLast`.\n" + }, "insertText": "->TypedArray.findLastWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 1, "character": 16}, "end": {"line": 1, "character": 17}}, - "newText": "" - }] - }, { - "label": "->TypedArray.findLast", "kind": 12, - "tags": [], + "label": "->TypedArray.findLastWithIndex", + "sortText": "findLastWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 17, "line": 1 }, + "start": { "character": 16, "line": 1 } + } + } + ], "detail": "(t<'a>, 'a => bool) => option<'a>", - "documentation": {"kind": "markdown", "value": "\n`findLast(typedArray, predicate)` returns the last element that satisfies `predicate`.\n\nSee [`TypedArray.prototype.findLast`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/findLast) on MDN.\n"}, - "sortText": "findLast", + "documentation": { + "kind": "markdown", + "value": "\n`findLast(typedArray, predicate)` returns the last element that satisfies `predicate`.\n\nSee [`TypedArray.prototype.findLast`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/findLast) on MDN.\n" + }, "insertText": "->TypedArray.findLast", - "additionalTextEdits": [{ - "range": {"start": {"line": 1, "character": 16}, "end": {"line": 1, "character": 17}}, - "newText": "" - }] - }, { - "label": "->TypedArray.filter", "kind": 12, - "tags": [], + "label": "->TypedArray.findLast", + "sortText": "findLast", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 17, "line": 1 }, + "start": { "character": 16, "line": 1 } + } + } + ], "detail": "(t<'a>, 'a => bool) => t<'a>", - "documentation": {"kind": "markdown", "value": "\n`filter(typedArray, predicate)` returns a new typed array containing only elements that satisfy `predicate`.\n\nSee [`TypedArray.prototype.filter`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/filter) on MDN.\n"}, - "sortText": "filter", + "documentation": { + "kind": "markdown", + "value": "\n`filter(typedArray, predicate)` returns a new typed array containing only elements that satisfy `predicate`.\n\nSee [`TypedArray.prototype.filter`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/filter) on MDN.\n" + }, "insertText": "->TypedArray.filter", - "additionalTextEdits": [{ - "range": {"start": {"line": 1, "character": 16}, "end": {"line": 1, "character": 17}}, - "newText": "" - }] - }, { - "label": "->TypedArray.byteLength", "kind": 12, - "tags": [], + "label": "->TypedArray.filter", + "sortText": "filter", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 17, "line": 1 }, + "start": { "character": 16, "line": 1 } + } + } + ], "detail": "t<'a> => int", - "documentation": {"kind": "markdown", "value": "\n`byteLength(typedArray)` returns the length in bytes of the view.\n\nSee [`TypedArray.prototype.byteLength`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/byteLength) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2])\nTypedArray.byteLength(view) == 8\n```\n"}, - "sortText": "byteLength", + "documentation": { + "kind": "markdown", + "value": "\n`byteLength(typedArray)` returns the length in bytes of the view.\n\nSee [`TypedArray.prototype.byteLength`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/byteLength) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2])\nTypedArray.byteLength(view) == 8\n```\n" + }, "insertText": "->TypedArray.byteLength", - "additionalTextEdits": [{ - "range": {"start": {"line": 1, "character": 16}, "end": {"line": 1, "character": 17}}, - "newText": "" - }] - }, { - "label": "->TypedArray.ignore", "kind": 12, - "tags": [], + "label": "->TypedArray.byteLength", + "sortText": "byteLength", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 17, "line": 1 }, + "start": { "character": 16, "line": 1 } + } + } + ], "detail": "t<'a> => unit", - "documentation": {"kind": "markdown", "value": "\n `ignore(typedArray)` ignores the provided typedArray and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further.\n"}, - "sortText": "ignore", + "documentation": { + "kind": "markdown", + "value": "\n `ignore(typedArray)` ignores the provided typedArray and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further.\n" + }, "insertText": "->TypedArray.ignore", - "additionalTextEdits": [{ - "range": {"start": {"line": 1, "character": 16}, "end": {"line": 1, "character": 17}}, - "newText": "" - }] - }, { - "label": "->TypedArray.reduceRightWithIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.ignore", + "sortText": "ignore", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 17, "line": 1 }, + "start": { "character": 16, "line": 1 } + } + } + ], "detail": "(t<'a>, ('b, 'a, int) => 'b, 'b) => 'b", - "documentation": {"kind": "markdown", "value": "\n`reduceRightWithIndex(typedArray, reducer, initial)` is the indexed variant of `reduceRight`.\n"}, - "sortText": "reduceRightWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`reduceRightWithIndex(typedArray, reducer, initial)` is the indexed variant of `reduceRight`.\n" + }, "insertText": "->TypedArray.reduceRightWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 1, "character": 16}, "end": {"line": 1, "character": 17}}, - "newText": "" - }] - }, { - "label": "->TypedArray.reduceRight", "kind": 12, - "tags": [], + "label": "->TypedArray.reduceRightWithIndex", + "sortText": "reduceRightWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 17, "line": 1 }, + "start": { "character": 16, "line": 1 } + } + } + ], "detail": "(t<'a>, ('b, 'a) => 'b, 'b) => 'b", - "documentation": {"kind": "markdown", "value": "\n`reduceRight(typedArray, reducer, initial)` is like `reduce` but processes the elements from right to left.\n\nSee [`TypedArray.prototype.reduceRight`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/reduceRight) on MDN.\n"}, - "sortText": "reduceRight", + "documentation": { + "kind": "markdown", + "value": "\n`reduceRight(typedArray, reducer, initial)` is like `reduce` but processes the elements from right to left.\n\nSee [`TypedArray.prototype.reduceRight`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/reduceRight) on MDN.\n" + }, "insertText": "->TypedArray.reduceRight", - "additionalTextEdits": [{ - "range": {"start": {"line": 1, "character": 16}, "end": {"line": 1, "character": 17}}, - "newText": "" - }] - }, { - "label": "->TypedArray.joinWith", "kind": 12, - "tags": [], + "label": "->TypedArray.reduceRight", + "sortText": "reduceRight", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 17, "line": 1 }, + "start": { "character": 16, "line": 1 } + } + } + ], "detail": "(t<'a>, string) => string", - "documentation": {"kind": "markdown", "value": "\n`joinWith(typedArray, separator)` returns a string formed by the elements joined with `separator`.\n\nSee [`TypedArray.prototype.join`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/join) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nTypedArray.joinWith(view, \"-\") == \"1-2-3\"\n```\n"}, - "sortText": "joinWith", + "documentation": { + "kind": "markdown", + "value": "\n`joinWith(typedArray, separator)` returns a string formed by the elements joined with `separator`.\n\nSee [`TypedArray.prototype.join`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/join) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nTypedArray.joinWith(view, \"-\") == \"1-2-3\"\n```\n" + }, "insertText": "->TypedArray.joinWith", - "additionalTextEdits": [{ - "range": {"start": {"line": 1, "character": 16}, "end": {"line": 1, "character": 17}}, - "newText": "" - }] - }, { - "label": "->TypedArray.buffer", "kind": 12, - "tags": [], + "label": "->TypedArray.joinWith", + "sortText": "joinWith", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 17, "line": 1 }, + "start": { "character": 16, "line": 1 } + } + } + ], "detail": "t<'a> => ArrayBuffer.t", - "documentation": {"kind": "markdown", "value": "\n`buffer(typedArray)` returns the underlying `ArrayBuffer` backing this view.\n\nSee [`TypedArray.prototype.buffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/buffer) on MDN.\n"}, - "sortText": "buffer", + "documentation": { + "kind": "markdown", + "value": "\n`buffer(typedArray)` returns the underlying `ArrayBuffer` backing this view.\n\nSee [`TypedArray.prototype.buffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/buffer) on MDN.\n" + }, "insertText": "->TypedArray.buffer", - "additionalTextEdits": [{ - "range": {"start": {"line": 1, "character": 16}, "end": {"line": 1, "character": 17}}, - "newText": "" - }] - }, { - "label": "->TypedArray.reduce", "kind": 12, - "tags": [], + "label": "->TypedArray.buffer", + "sortText": "buffer", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 17, "line": 1 }, + "start": { "character": 16, "line": 1 } + } + } + ], "detail": "(t<'a>, ('b, 'a) => 'b, 'b) => 'b", - "documentation": {"kind": "markdown", "value": "\n`reduce(typedArray, reducer, initial)` combines the elements from left to right using `reducer`.\n\nSee [`TypedArray.prototype.reduce`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/reduce) on MDN.\n"}, - "sortText": "reduce", + "documentation": { + "kind": "markdown", + "value": "\n`reduce(typedArray, reducer, initial)` combines the elements from left to right using `reducer`.\n\nSee [`TypedArray.prototype.reduce`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/reduce) on MDN.\n" + }, "insertText": "->TypedArray.reduce", - "additionalTextEdits": [{ - "range": {"start": {"line": 1, "character": 16}, "end": {"line": 1, "character": 17}}, - "newText": "" - }] - }, { - "label": "->TypedArray.forEachWithIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.reduce", + "sortText": "reduce", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 17, "line": 1 }, + "start": { "character": 16, "line": 1 } + } + } + ], "detail": "(t<'a>, ('a, int) => unit) => unit", - "documentation": {"kind": "markdown", "value": "\n`forEachWithIndex(typedArray, f)` runs `f` for every element, also providing the index.\n"}, - "sortText": "forEachWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`forEachWithIndex(typedArray, f)` runs `f` for every element, also providing the index.\n" + }, "insertText": "->TypedArray.forEachWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 1, "character": 16}, "end": {"line": 1, "character": 17}}, - "newText": "" - }] - }, { - "label": "->TypedArray.copy", "kind": 12, - "tags": [], + "label": "->TypedArray.forEachWithIndex", + "sortText": "forEachWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 17, "line": 1 }, + "start": { "character": 16, "line": 1 } + } + } + ], "detail": "t<'a> => t<'a>", - "documentation": {"kind": "markdown", "value": "\n`copy(typedArray)` produces a shallow copy of the typed array.\n"}, - "sortText": "copy", + "documentation": { + "kind": "markdown", + "value": "\n`copy(typedArray)` produces a shallow copy of the typed array.\n" + }, "insertText": "->TypedArray.copy", - "additionalTextEdits": [{ - "range": {"start": {"line": 1, "character": 16}, "end": {"line": 1, "character": 17}}, - "newText": "" - }] - }, { - "label": "->TypedArray.someWithIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.copy", + "sortText": "copy", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 17, "line": 1 }, + "start": { "character": 16, "line": 1 } + } + } + ], "detail": "(t<'a>, ('a, int) => bool) => bool", - "documentation": {"kind": "markdown", "value": "\n`someWithIndex(typedArray, predicate)` behaves like `some`, but `predicate` also receives the element index.\n"}, - "sortText": "someWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`someWithIndex(typedArray, predicate)` behaves like `some`, but `predicate` also receives the element index.\n" + }, "insertText": "->TypedArray.someWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 1, "character": 16}, "end": {"line": 1, "character": 17}}, - "newText": "" - }] - }, { - "label": "->TypedArray.findIndexWithIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.someWithIndex", + "sortText": "someWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 17, "line": 1 }, + "start": { "character": 16, "line": 1 } + } + } + ], "detail": "(t<'a>, ('a, int) => bool) => int", - "documentation": {"kind": "markdown", "value": "\n`findIndexWithIndex(typedArray, predicate)` is the indexed variant of `findIndex`.\n"}, - "sortText": "findIndexWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`findIndexWithIndex(typedArray, predicate)` is the indexed variant of `findIndex`.\n" + }, "insertText": "->TypedArray.findIndexWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 1, "character": 16}, "end": {"line": 1, "character": 17}}, - "newText": "" - }] - }, { - "label": "->TypedArray.sliceToEnd", "kind": 12, - "tags": [1], + "label": "->TypedArray.findIndexWithIndex", + "sortText": "findIndexWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 17, "line": 1 }, + "start": { "character": 16, "line": 1 } + } + } + ], + "deprecated": true, "detail": "(t<'a>, ~start: int) => t<'a>", - "documentation": {"kind": "markdown", "value": "Deprecated: Use `slice` instead\n\n\n`sliceToEnd(typedArray, ~start)` returns the elements from `start` through the end in a new typed array.\n"}, - "sortText": "sliceToEnd", + "documentation": { + "kind": "markdown", + "value": "Deprecated: Use `slice` instead\n\n\n`sliceToEnd(typedArray, ~start)` returns the elements from `start` through the end in a new typed array.\n" + }, "insertText": "->TypedArray.sliceToEnd", - "additionalTextEdits": [{ - "range": {"start": {"line": 1, "character": 16}, "end": {"line": 1, "character": 17}}, - "newText": "" - }] - }, { - "label": "->TypedArray.slice", "kind": 12, - "tags": [], + "label": "->TypedArray.sliceToEnd", + "sortText": "sliceToEnd", + "tags": [ 1 ] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 17, "line": 1 }, + "start": { "character": 16, "line": 1 } + } + } + ], "detail": "(t<'a>, ~start: int, ~end: int=?) => t<'a>", - "documentation": {"kind": "markdown", "value": "\n`slice(typedArray, ~start, ~end)` returns a new typed array containing the elements in `[start, end)`.\n\nSee [`TypedArray.prototype.slice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/slice) on MDN.\n"}, - "sortText": "slice", + "documentation": { + "kind": "markdown", + "value": "\n`slice(typedArray, ~start, ~end)` returns a new typed array containing the elements in `[start, end)`.\n\nSee [`TypedArray.prototype.slice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/slice) on MDN.\n" + }, "insertText": "->TypedArray.slice", - "additionalTextEdits": [{ - "range": {"start": {"line": 1, "character": 16}, "end": {"line": 1, "character": 17}}, - "newText": "" - }] - }, { - "label": "->TypedArray.findLastIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.slice", + "sortText": "slice", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 17, "line": 1 }, + "start": { "character": 16, "line": 1 } + } + } + ], "detail": "(t<'a>, 'a => bool) => int", - "documentation": {"kind": "markdown", "value": "\n`findLastIndex(typedArray, predicate)` returns the index of the last matching element, or `-1` if none do.\n\nSee [`TypedArray.prototype.findLastIndex`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/findLastIndex) on MDN.\n"}, - "sortText": "findLastIndex", + "documentation": { + "kind": "markdown", + "value": "\n`findLastIndex(typedArray, predicate)` returns the index of the last matching element, or `-1` if none do.\n\nSee [`TypedArray.prototype.findLastIndex`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/findLastIndex) on MDN.\n" + }, "insertText": "->TypedArray.findLastIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 1, "character": 16}, "end": {"line": 1, "character": 17}}, - "newText": "" - }] - }, { - "label": "->TypedArray.includes", "kind": 12, - "tags": [], + "label": "->TypedArray.findLastIndex", + "sortText": "findLastIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 17, "line": 1 }, + "start": { "character": 16, "line": 1 } + } + } + ], "detail": "(t<'a>, 'a) => bool", - "documentation": {"kind": "markdown", "value": "\n`includes(typedArray, value)` returns `true` if `value` occurs in the typed array.\n\nSee [`TypedArray.prototype.includes`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/includes) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nTypedArray.includes(view, 2) == true\nTypedArray.includes(view, 10) == false\n```\n"}, - "sortText": "includes", + "documentation": { + "kind": "markdown", + "value": "\n`includes(typedArray, value)` returns `true` if `value` occurs in the typed array.\n\nSee [`TypedArray.prototype.includes`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/includes) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nTypedArray.includes(view, 2) == true\nTypedArray.includes(view, 10) == false\n```\n" + }, "insertText": "->TypedArray.includes", - "additionalTextEdits": [{ - "range": {"start": {"line": 1, "character": 16}, "end": {"line": 1, "character": 17}}, - "newText": "" - }] - }, { - "label": "->TypedArray.fillToEnd", "kind": 12, - "tags": [1], + "label": "->TypedArray.includes", + "sortText": "includes", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 17, "line": 1 }, + "start": { "character": 16, "line": 1 } + } + } + ], + "deprecated": true, "detail": "(t<'a>, 'a, ~start: int) => t<'a>", - "documentation": {"kind": "markdown", "value": "Deprecated: Use `fill` instead\n\n\n`fillToEnd(typedArray, value, ~start)` fills from `start` through the end with `value`.\n\nBeware this will *mutate* the typed array.\n"}, - "sortText": "fillToEnd", + "documentation": { + "kind": "markdown", + "value": "Deprecated: Use `fill` instead\n\n\n`fillToEnd(typedArray, value, ~start)` fills from `start` through the end with `value`.\n\nBeware this will *mutate* the typed array.\n" + }, "insertText": "->TypedArray.fillToEnd", - "additionalTextEdits": [{ - "range": {"start": {"line": 1, "character": 16}, "end": {"line": 1, "character": 17}}, - "newText": "" - }] - }, { - "label": "->TypedArray.fillAll", "kind": 12, - "tags": [], + "label": "->TypedArray.fillToEnd", + "sortText": "fillToEnd", + "tags": [ 1 ] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 17, "line": 1 }, + "start": { "character": 16, "line": 1 } + } + } + ], "detail": "(t<'a>, 'a) => t<'a>", - "documentation": {"kind": "markdown", "value": "\n`fillAll(typedArray, value)` fills every element with `value`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.fill`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/fill) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nlet _ = TypedArray.fillAll(view, 9)\nTypedArray.toString(view) == \"9,9,9\"\n```\n"}, - "sortText": "fillAll", + "documentation": { + "kind": "markdown", + "value": "\n`fillAll(typedArray, value)` fills every element with `value`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.fill`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/fill) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nlet _ = TypedArray.fillAll(view, 9)\nTypedArray.toString(view) == \"9,9,9\"\n```\n" + }, "insertText": "->TypedArray.fillAll", - "additionalTextEdits": [{ - "range": {"start": {"line": 1, "character": 16}, "end": {"line": 1, "character": 17}}, - "newText": "" - }] - }, { - "label": "->TypedArray.find", "kind": 12, - "tags": [], + "label": "->TypedArray.fillAll", + "sortText": "fillAll", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 17, "line": 1 }, + "start": { "character": 16, "line": 1 } + } + } + ], "detail": "(t<'a>, 'a => bool) => option<'a>", - "documentation": {"kind": "markdown", "value": "\n`find(typedArray, predicate)` returns the first element that satisfies `predicate`, or `None` if nothing matches.\n\nSee [`TypedArray.prototype.find`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/find) on MDN.\n"}, - "sortText": "find", + "documentation": { + "kind": "markdown", + "value": "\n`find(typedArray, predicate)` returns the first element that satisfies `predicate`, or `None` if nothing matches.\n\nSee [`TypedArray.prototype.find`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/find) on MDN.\n" + }, "insertText": "->TypedArray.find", - "additionalTextEdits": [{ - "range": {"start": {"line": 1, "character": 16}, "end": {"line": 1, "character": 17}}, - "newText": "" - }] - }, { - "label": "->TypedArray.subarrayToEnd", "kind": 12, - "tags": [1], + "label": "->TypedArray.find", + "sortText": "find", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 17, "line": 1 }, + "start": { "character": 16, "line": 1 } + } + } + ], + "deprecated": true, "detail": "(t<'a>, ~start: int) => t<'a>", - "documentation": {"kind": "markdown", "value": "Deprecated: Use `subarray` instead\n\n\n`subarrayToEnd(typedArray, ~start)` returns a new view from `start` to the end of the buffer.\n"}, - "sortText": "subarrayToEnd", + "documentation": { + "kind": "markdown", + "value": "Deprecated: Use `subarray` instead\n\n\n`subarrayToEnd(typedArray, ~start)` returns a new view from `start` to the end of the buffer.\n" + }, "insertText": "->TypedArray.subarrayToEnd", - "additionalTextEdits": [{ - "range": {"start": {"line": 1, "character": 16}, "end": {"line": 1, "character": 17}}, - "newText": "" - }] - }, { - "label": "->TypedArray.set", "kind": 12, - "tags": [], + "label": "->TypedArray.subarrayToEnd", + "sortText": "subarrayToEnd", + "tags": [ 1 ] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 17, "line": 1 }, + "start": { "character": 16, "line": 1 } + } + } + ], "detail": "(t<'a>, int, 'a) => unit", - "documentation": {"kind": "markdown", "value": "\n`set(typedArray, index, item)` sets the provided `item` at `index` of `typedArray`.\n\nBeware this will *mutate* the array.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2])\nTypedArray.set(view, 1, 5)\nTypedArray.get(view, 1) == Some(5)\n```\n"}, - "sortText": "set", + "documentation": { + "kind": "markdown", + "value": "\n`set(typedArray, index, item)` sets the provided `item` at `index` of `typedArray`.\n\nBeware this will *mutate* the array.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2])\nTypedArray.set(view, 1, 5)\nTypedArray.get(view, 1) == Some(5)\n```\n" + }, "insertText": "->TypedArray.set", - "additionalTextEdits": [{ - "range": {"start": {"line": 1, "character": 16}, "end": {"line": 1, "character": 17}}, - "newText": "" - }] - }, { - "label": "->TypedArray.toLocaleString", "kind": 12, - "tags": [], + "label": "->TypedArray.set", + "sortText": "set", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 17, "line": 1 }, + "start": { "character": 16, "line": 1 } + } + } + ], "detail": "t<'a> => string", - "documentation": {"kind": "markdown", "value": "\n`toLocaleString(typedArray)` concatenates the elements using locale-aware formatting.\n\nSee [`TypedArray.prototype.toLocaleString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/toLocaleString) on MDN.\n"}, - "sortText": "toLocaleString", + "documentation": { + "kind": "markdown", + "value": "\n`toLocaleString(typedArray)` concatenates the elements using locale-aware formatting.\n\nSee [`TypedArray.prototype.toLocaleString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/toLocaleString) on MDN.\n" + }, "insertText": "->TypedArray.toLocaleString", - "additionalTextEdits": [{ - "range": {"start": {"line": 1, "character": 16}, "end": {"line": 1, "character": 17}}, - "newText": "" - }] - }, { - "label": "->TypedArray.lastIndexOfFrom", "kind": 12, - "tags": [], + "label": "->TypedArray.toLocaleString", + "sortText": "toLocaleString", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 17, "line": 1 }, + "start": { "character": 16, "line": 1 } + } + } + ], "detail": "(t<'a>, 'a, int) => int", - "documentation": {"kind": "markdown", "value": "\n`lastIndexOfFrom(typedArray, value, fromIndex)` searches backwards starting at `fromIndex`.\n"}, - "sortText": "lastIndexOfFrom", + "documentation": { + "kind": "markdown", + "value": "\n`lastIndexOfFrom(typedArray, value, fromIndex)` searches backwards starting at `fromIndex`.\n" + }, "insertText": "->TypedArray.lastIndexOfFrom", - "additionalTextEdits": [{ - "range": {"start": {"line": 1, "character": 16}, "end": {"line": 1, "character": 17}}, - "newText": "" - }] - }, { - "label": "->TypedArray.findIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.lastIndexOfFrom", + "sortText": "lastIndexOfFrom", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 17, "line": 1 }, + "start": { "character": 16, "line": 1 } + } + } + ], "detail": "(t<'a>, 'a => bool) => int", - "documentation": {"kind": "markdown", "value": "\n`findIndex(typedArray, predicate)` returns the index of the first element that satisfies `predicate`, or `-1` if none do.\n\nSee [`TypedArray.prototype.findIndex`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/findIndex) on MDN.\n"}, - "sortText": "findIndex", + "documentation": { + "kind": "markdown", + "value": "\n`findIndex(typedArray, predicate)` returns the index of the first element that satisfies `predicate`, or `-1` if none do.\n\nSee [`TypedArray.prototype.findIndex`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/findIndex) on MDN.\n" + }, "insertText": "->TypedArray.findIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 1, "character": 16}, "end": {"line": 1, "character": 17}}, - "newText": "" - }] - }, { - "label": "->TypedArray.filterWithIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.findIndex", + "sortText": "findIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 17, "line": 1 }, + "start": { "character": 16, "line": 1 } + } + } + ], "detail": "(t<'a>, ('a, int) => bool) => t<'a>", - "documentation": {"kind": "markdown", "value": "\n`filterWithIndex(typedArray, predicate)` behaves like `filter` but also passes the index to `predicate`.\n"}, - "sortText": "filterWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`filterWithIndex(typedArray, predicate)` behaves like `filter` but also passes the index to `predicate`.\n" + }, "insertText": "->TypedArray.filterWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 1, "character": 16}, "end": {"line": 1, "character": 17}}, - "newText": "" - }] - }, { - "label": "->TypedArray.sort", "kind": 12, - "tags": [], + "label": "->TypedArray.filterWithIndex", + "sortText": "filterWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 17, "line": 1 }, + "start": { "character": 16, "line": 1 } + } + } + ], "detail": "(t<'a>, ('a, 'a) => Ordering.t) => unit", - "documentation": {"kind": "markdown", "value": "\n`sort(typedArray, comparator)` sorts the values in place using `comparator`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.sort`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/sort) on MDN.\n"}, - "sortText": "sort", + "documentation": { + "kind": "markdown", + "value": "\n`sort(typedArray, comparator)` sorts the values in place using `comparator`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.sort`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/sort) on MDN.\n" + }, "insertText": "->TypedArray.sort", - "additionalTextEdits": [{ - "range": {"start": {"line": 1, "character": 16}, "end": {"line": 1, "character": 17}}, - "newText": "" - }] - }, { - "label": "->TypedArray.mapWithIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.sort", + "sortText": "sort", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 17, "line": 1 }, + "start": { "character": 16, "line": 1 } + } + } + ], "detail": "(t<'a>, ('a, int) => 'b) => t<'b>", - "documentation": {"kind": "markdown", "value": "\n`mapWithIndex(typedArray, f)` behaves like `map`, but `f` also receives the index.\n"}, - "sortText": "mapWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`mapWithIndex(typedArray, f)` behaves like `map`, but `f` also receives the index.\n" + }, "insertText": "->TypedArray.mapWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 1, "character": 16}, "end": {"line": 1, "character": 17}}, - "newText": "" - }] - }, { - "label": "->TypedArray.every", "kind": 12, - "tags": [], + "label": "->TypedArray.mapWithIndex", + "sortText": "mapWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 17, "line": 1 }, + "start": { "character": 16, "line": 1 } + } + } + ], "detail": "(t<'a>, 'a => bool) => bool", - "documentation": {"kind": "markdown", "value": "\n`every(typedArray, predicate)` returns `true` if `predicate` returns `true` for every element.\n\nSee [`TypedArray.prototype.every`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/every) on MDN.\n"}, - "sortText": "every", + "documentation": { + "kind": "markdown", + "value": "\n`every(typedArray, predicate)` returns `true` if `predicate` returns `true` for every element.\n\nSee [`TypedArray.prototype.every`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/every) on MDN.\n" + }, "insertText": "->TypedArray.every", - "additionalTextEdits": [{ - "range": {"start": {"line": 1, "character": 16}, "end": {"line": 1, "character": 17}}, - "newText": "" - }] - }, { - "label": "->TypedArray.length", "kind": 12, - "tags": [], + "label": "->TypedArray.every", + "sortText": "every", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 17, "line": 1 }, + "start": { "character": 16, "line": 1 } + } + } + ], "detail": "t<'a> => int", - "documentation": {"kind": "markdown", "value": "\n`length(typedArray)` returns the number of elements.\n\nSee [`TypedArray.prototype.length`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/length) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nTypedArray.length(view) == 3\n```\n"}, - "sortText": "length", + "documentation": { + "kind": "markdown", + "value": "\n`length(typedArray)` returns the number of elements.\n\nSee [`TypedArray.prototype.length`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/length) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nTypedArray.length(view) == 3\n```\n" + }, "insertText": "->TypedArray.length", - "additionalTextEdits": [{ - "range": {"start": {"line": 1, "character": 16}, "end": {"line": 1, "character": 17}}, - "newText": "" - }] - }, { - "label": "->TypedArray.indexOf", "kind": 12, - "tags": [], + "label": "->TypedArray.length", + "sortText": "length", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 17, "line": 1 }, + "start": { "character": 16, "line": 1 } + } + } + ], "detail": "(t<'a>, 'a) => int", - "documentation": {"kind": "markdown", "value": "\n`indexOf(typedArray, value)` returns the first index of `value`, or `-1` when not found.\n\nSee [`TypedArray.prototype.indexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/indexOf) on MDN.\n"}, - "sortText": "indexOf", + "documentation": { + "kind": "markdown", + "value": "\n`indexOf(typedArray, value)` returns the first index of `value`, or `-1` when not found.\n\nSee [`TypedArray.prototype.indexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/indexOf) on MDN.\n" + }, "insertText": "->TypedArray.indexOf", - "additionalTextEdits": [{ - "range": {"start": {"line": 1, "character": 16}, "end": {"line": 1, "character": 17}}, - "newText": "" - }] - }, { - "label": "->TypedArray.copyWithinToEnd", "kind": 12, - "tags": [1], + "label": "->TypedArray.indexOf", + "sortText": "indexOf", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 17, "line": 1 }, + "start": { "character": 16, "line": 1 } + } + } + ], + "deprecated": true, "detail": "(t<'a>, ~target: int, ~start: int) => array<'a>", - "documentation": {"kind": "markdown", "value": "Deprecated: Use `copyWithin` instead\n\n\n`copyWithinToEnd(typedArray, ~target, ~start)` copies values from `start` through the end of the view into the range beginning at `target`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.copyWithin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/copyWithin) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3, 4])\nlet _ = TypedArray.copyWithinToEnd(view, ~target=0, ~start=2)\nTypedArray.toString(view) == \"3,4,3,4\"\n```\n"}, - "sortText": "copyWithinToEnd", + "documentation": { + "kind": "markdown", + "value": "Deprecated: Use `copyWithin` instead\n\n\n`copyWithinToEnd(typedArray, ~target, ~start)` copies values from `start` through the end of the view into the range beginning at `target`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.copyWithin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/copyWithin) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3, 4])\nlet _ = TypedArray.copyWithinToEnd(view, ~target=0, ~start=2)\nTypedArray.toString(view) == \"3,4,3,4\"\n```\n" + }, "insertText": "->TypedArray.copyWithinToEnd", - "additionalTextEdits": [{ - "range": {"start": {"line": 1, "character": 16}, "end": {"line": 1, "character": 17}}, - "newText": "" - }] - }, { - "label": "->TypedArray.some", "kind": 12, - "tags": [], + "label": "->TypedArray.copyWithinToEnd", + "sortText": "copyWithinToEnd", + "tags": [ 1 ] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 17, "line": 1 }, + "start": { "character": 16, "line": 1 } + } + } + ], "detail": "(t<'a>, 'a => bool) => bool", - "documentation": {"kind": "markdown", "value": "\n`some(typedArray, predicate)` returns `true` if `predicate` returns `true` for at least one element.\n\nSee [`TypedArray.prototype.some`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/some) on MDN.\n"}, - "sortText": "some", + "documentation": { + "kind": "markdown", + "value": "\n`some(typedArray, predicate)` returns `true` if `predicate` returns `true` for at least one element.\n\nSee [`TypedArray.prototype.some`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/some) on MDN.\n" + }, "insertText": "->TypedArray.some", - "additionalTextEdits": [{ - "range": {"start": {"line": 1, "character": 16}, "end": {"line": 1, "character": 17}}, - "newText": "" - }] - }, { - "label": "->TypedArray.reduceWithIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.some", + "sortText": "some", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 17, "line": 1 }, + "start": { "character": 16, "line": 1 } + } + } + ], "detail": "(t<'a>, ('b, 'a, int) => 'b, 'b) => 'b", - "documentation": {"kind": "markdown", "value": "\n`reduceWithIndex(typedArray, reducer, initial)` is the indexed variant of `reduce`.\n"}, - "sortText": "reduceWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`reduceWithIndex(typedArray, reducer, initial)` is the indexed variant of `reduce`.\n" + }, "insertText": "->TypedArray.reduceWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 1, "character": 16}, "end": {"line": 1, "character": 17}}, - "newText": "" - }] - }, { - "label": "->TypedArray.map", "kind": 12, - "tags": [], + "label": "->TypedArray.reduceWithIndex", + "sortText": "reduceWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 17, "line": 1 }, + "start": { "character": 16, "line": 1 } + } + } + ], "detail": "(t<'a>, 'a => 'b) => t<'b>", - "documentation": {"kind": "markdown", "value": "\n`map(typedArray, f)` returns a new typed array whose elements are produced by applying `f` to each element.\n\nSee [`TypedArray.prototype.map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/map) on MDN.\n"}, - "sortText": "map", + "documentation": { + "kind": "markdown", + "value": "\n`map(typedArray, f)` returns a new typed array whose elements are produced by applying `f` to each element.\n\nSee [`TypedArray.prototype.map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/map) on MDN.\n" + }, "insertText": "->TypedArray.map", - "additionalTextEdits": [{ - "range": {"start": {"line": 1, "character": 16}, "end": {"line": 1, "character": 17}}, - "newText": "" - }] - }, { - "label": "->TypedArray.toSorted", "kind": 12, - "tags": [], + "label": "->TypedArray.map", + "sortText": "map", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 17, "line": 1 }, + "start": { "character": 16, "line": 1 } + } + } + ], "detail": "(t<'a>, ('a, 'a) => Ordering.t) => t<'a>", - "documentation": {"kind": "markdown", "value": "\n`toSorted(typedArray, comparator)` returns a new typed array containing the sorted values, leaving the original untouched.\n\nSee [`TypedArray.prototype.toSorted`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/toSorted) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([3, 1, 2])\nlet sorted = TypedArray.toSorted(view, Int.compare)\nTypedArray.toString(sorted) == \"1,2,3\"\nTypedArray.toString(view) == \"3,1,2\"\n```\n"}, - "sortText": "toSorted", + "documentation": { + "kind": "markdown", + "value": "\n`toSorted(typedArray, comparator)` returns a new typed array containing the sorted values, leaving the original untouched.\n\nSee [`TypedArray.prototype.toSorted`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/toSorted) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([3, 1, 2])\nlet sorted = TypedArray.toSorted(view, Int.compare)\nTypedArray.toString(sorted) == \"1,2,3\"\nTypedArray.toString(view) == \"3,1,2\"\n```\n" + }, "insertText": "->TypedArray.toSorted", - "additionalTextEdits": [{ - "range": {"start": {"line": 1, "character": 16}, "end": {"line": 1, "character": 17}}, - "newText": "" - }] - }, { - "label": "->TypedArray.copyAllWithin", "kind": 12, - "tags": [], + "label": "->TypedArray.toSorted", + "sortText": "toSorted", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 17, "line": 1 }, + "start": { "character": 16, "line": 1 } + } + } + ], "detail": "(t<'a>, ~target: int) => array<'a>", - "documentation": {"kind": "markdown", "value": "\n`copyAllWithin(typedArray, ~target)` copies values starting at index `0` over the positions beginning at `target`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.copyWithin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/copyWithin) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([10, 20, 30])\nlet _ = TypedArray.copyAllWithin(view, ~target=1)\nTypedArray.toString(view) == \"10,10,20\"\n```\n"}, - "sortText": "copyAllWithin", + "documentation": { + "kind": "markdown", + "value": "\n`copyAllWithin(typedArray, ~target)` copies values starting at index `0` over the positions beginning at `target`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.copyWithin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/copyWithin) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([10, 20, 30])\nlet _ = TypedArray.copyAllWithin(view, ~target=1)\nTypedArray.toString(view) == \"10,10,20\"\n```\n" + }, "insertText": "->TypedArray.copyAllWithin", - "additionalTextEdits": [{ - "range": {"start": {"line": 1, "character": 16}, "end": {"line": 1, "character": 17}}, - "newText": "" - }] - }, { - "label": "->TypedArray.subarray", "kind": 12, - "tags": [], + "label": "->TypedArray.copyAllWithin", + "sortText": "copyAllWithin", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 17, "line": 1 }, + "start": { "character": 16, "line": 1 } + } + } + ], "detail": "(t<'a>, ~start: int, ~end: int=?) => t<'a>", - "documentation": {"kind": "markdown", "value": "\n`subarray(typedArray, ~start, ~end)` returns a new view referencing the same buffer over `[start, end)`.\n\nSee [`TypedArray.prototype.subarray`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/subarray) on MDN.\n"}, - "sortText": "subarray", + "documentation": { + "kind": "markdown", + "value": "\n`subarray(typedArray, ~start, ~end)` returns a new view referencing the same buffer over `[start, end)`.\n\nSee [`TypedArray.prototype.subarray`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/subarray) on MDN.\n" + }, "insertText": "->TypedArray.subarray", - "additionalTextEdits": [{ - "range": {"start": {"line": 1, "character": 16}, "end": {"line": 1, "character": 17}}, - "newText": "" - }] - }, { - "label": "->TypedArray.setArray", "kind": 12, - "tags": [], + "label": "->TypedArray.subarray", + "sortText": "subarray", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 17, "line": 1 }, + "start": { "character": 16, "line": 1 } + } + } + ], "detail": "(t<'a>, array<'a>) => unit", - "documentation": {"kind": "markdown", "value": "\n`setArray(target, source)` copies the values from `source` into `target`, mutating it.\n\nSee [`TypedArray.prototype.set`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/set) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([0, 0])\nTypedArray.setArray(view, [1, 2])\nTypedArray.toString(view) == \"1,2\"\n```\n"}, - "sortText": "setArray", + "documentation": { + "kind": "markdown", + "value": "\n`setArray(target, source)` copies the values from `source` into `target`, mutating it.\n\nSee [`TypedArray.prototype.set`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/set) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([0, 0])\nTypedArray.setArray(view, [1, 2])\nTypedArray.toString(view) == \"1,2\"\n```\n" + }, "insertText": "->TypedArray.setArray", - "additionalTextEdits": [{ - "range": {"start": {"line": 1, "character": 16}, "end": {"line": 1, "character": 17}}, - "newText": "" - }] - }, { - "label": "->TypedArray.get", "kind": 12, - "tags": [], + "label": "->TypedArray.setArray", + "sortText": "setArray", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 17, "line": 1 }, + "start": { "character": 16, "line": 1 } + } + } + ], "detail": "(t<'a>, int) => option<'a>", - "documentation": {"kind": "markdown", "value": "\n`get(typedArray, index)` returns the element at `index` of `typedArray`.\nReturns `None` if the index does not exist in the typed array. Equivalent to doing `typedArray[index]` in JavaScript.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nTypedArray.get(view, 0) == Some(1)\nTypedArray.get(view, 10) == None\n```\n"}, - "sortText": "get", + "documentation": { + "kind": "markdown", + "value": "\n`get(typedArray, index)` returns the element at `index` of `typedArray`.\nReturns `None` if the index does not exist in the typed array. Equivalent to doing `typedArray[index]` in JavaScript.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nTypedArray.get(view, 0) == Some(1)\nTypedArray.get(view, 10) == None\n```\n" + }, "insertText": "->TypedArray.get", - "additionalTextEdits": [{ - "range": {"start": {"line": 1, "character": 16}, "end": {"line": 1, "character": 17}}, - "newText": "" - }] - }, { - "label": "->TypedArray.with", "kind": 12, - "tags": [], + "label": "->TypedArray.get", + "sortText": "get", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 17, "line": 1 }, + "start": { "character": 16, "line": 1 } + } + } + ], "detail": "(t<'a>, int, 'a) => t<'a>", - "documentation": {"kind": "markdown", "value": "\n`with(typedArray, index, value)` returns a new typed array where the element at `index` is replaced with `value`.\n\nSee [`TypedArray.prototype.with`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/with) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nlet updated = TypedArray.with(view, 1, 10)\nTypedArray.toString(updated) == \"1,10,3\"\nTypedArray.toString(view) == \"1,2,3\"\n```\n"}, - "sortText": "with", + "documentation": { + "kind": "markdown", + "value": "\n`with(typedArray, index, value)` returns a new typed array where the element at `index` is replaced with `value`.\n\nSee [`TypedArray.prototype.with`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/with) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nlet updated = TypedArray.with(view, 1, 10)\nTypedArray.toString(updated) == \"1,10,3\"\nTypedArray.toString(view) == \"1,2,3\"\n```\n" + }, "insertText": "->TypedArray.with", - "additionalTextEdits": [{ - "range": {"start": {"line": 1, "character": 16}, "end": {"line": 1, "character": 17}}, - "newText": "" - }] - }, { - "label": "->TypedArray.toReversed", "kind": 12, - "tags": [], + "label": "->TypedArray.with", + "sortText": "with", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 17, "line": 1 }, + "start": { "character": 16, "line": 1 } + } + } + ], "detail": "t<'a> => t<'a>", - "documentation": {"kind": "markdown", "value": "\n`toReversed(typedArray)` returns a new typed array with the elements in reverse order, leaving the original untouched.\n\nSee [`TypedArray.prototype.toReversed`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/toReversed) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nlet reversed = TypedArray.toReversed(view)\nTypedArray.toString(reversed) == \"3,2,1\"\nTypedArray.toString(view) == \"1,2,3\"\n```\n"}, - "sortText": "toReversed", + "documentation": { + "kind": "markdown", + "value": "\n`toReversed(typedArray)` returns a new typed array with the elements in reverse order, leaving the original untouched.\n\nSee [`TypedArray.prototype.toReversed`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/toReversed) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nlet reversed = TypedArray.toReversed(view)\nTypedArray.toString(reversed) == \"3,2,1\"\nTypedArray.toString(view) == \"1,2,3\"\n```\n" + }, "insertText": "->TypedArray.toReversed", - "additionalTextEdits": [{ - "range": {"start": {"line": 1, "character": 16}, "end": {"line": 1, "character": 17}}, - "newText": "" - }] - }, { - "label": "->TypedArray.copyWithin", "kind": 12, - "tags": [], + "label": "->TypedArray.toReversed", + "sortText": "toReversed", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 17, "line": 1 }, + "start": { "character": 16, "line": 1 } + } + } + ], "detail": "(t<'a>, ~target: int, ~start: int, ~end: int=?) => array<'a>", - "documentation": {"kind": "markdown", "value": "\n`copyWithin(typedArray, ~target, ~start, ~end)` copies the section `[start, end)` onto the range beginning at `target`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.copyWithin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/copyWithin) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3, 4])\nlet _ = TypedArray.copyWithin(view, ~target=1, ~start=2, ~end=4)\nTypedArray.toString(view) == \"1,3,4,4\"\n```\n"}, - "sortText": "copyWithin", + "documentation": { + "kind": "markdown", + "value": "\n`copyWithin(typedArray, ~target, ~start, ~end)` copies the section `[start, end)` onto the range beginning at `target`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.copyWithin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/copyWithin) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3, 4])\nlet _ = TypedArray.copyWithin(view, ~target=1, ~start=2, ~end=4)\nTypedArray.toString(view) == \"1,3,4,4\"\n```\n" + }, "insertText": "->TypedArray.copyWithin", - "additionalTextEdits": [{ - "range": {"start": {"line": 1, "character": 16}, "end": {"line": 1, "character": 17}}, - "newText": "" - }] - }, { - "label": "->TypedArray.everyWithIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.copyWithin", + "sortText": "copyWithin", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 17, "line": 1 }, + "start": { "character": 16, "line": 1 } + } + } + ], "detail": "(t<'a>, ('a, int) => bool) => bool", - "documentation": {"kind": "markdown", "value": "\n`everyWithIndex(typedArray, checker)` is like `every` but provides the element index to `checker`.\n"}, - "sortText": "everyWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`everyWithIndex(typedArray, checker)` is like `every` but provides the element index to `checker`.\n" + }, "insertText": "->TypedArray.everyWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 1, "character": 16}, "end": {"line": 1, "character": 17}}, - "newText": "" - }] - }, { - "label": "->TypedArray.toString", "kind": 12, - "tags": [], + "label": "->TypedArray.everyWithIndex", + "sortText": "everyWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 17, "line": 1 }, + "start": { "character": 16, "line": 1 } + } + } + ], "detail": "t<'a> => string", - "documentation": {"kind": "markdown", "value": "\n`toString(typedArray)` returns a comma-separated string of the elements.\n\nSee [`TypedArray.prototype.toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/toString) on MDN.\n\n## Examples\n\n```rescript\nInt32Array.fromArray([1, 2])->TypedArray.toString == \"1,2\"\n```\n"}, - "sortText": "toString", + "documentation": { + "kind": "markdown", + "value": "\n`toString(typedArray)` returns a comma-separated string of the elements.\n\nSee [`TypedArray.prototype.toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/toString) on MDN.\n\n## Examples\n\n```rescript\nInt32Array.fromArray([1, 2])->TypedArray.toString == \"1,2\"\n```\n" + }, "insertText": "->TypedArray.toString", - "additionalTextEdits": [{ - "range": {"start": {"line": 1, "character": 16}, "end": {"line": 1, "character": 17}}, - "newText": "" - }] - }, { - "label": "->TypedArray.setArrayFrom", "kind": 12, - "tags": [], + "label": "->TypedArray.toString", + "sortText": "toString", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 17, "line": 1 }, + "start": { "character": 16, "line": 1 } + } + } + ], "detail": "(t<'a>, array<'a>, int) => unit", - "documentation": {"kind": "markdown", "value": "\n`setArrayFrom(target, source, index)` copies `source` into `target` starting at `index`.\n\nSee [`TypedArray.prototype.set`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/set) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([0, 0, 0])\nTypedArray.setArrayFrom(view, [5, 6], 1)\nTypedArray.toString(view) == \"0,5,6\"\n```\n"}, - "sortText": "setArrayFrom", + "documentation": { + "kind": "markdown", + "value": "\n`setArrayFrom(target, source, index)` copies `source` into `target` starting at `index`.\n\nSee [`TypedArray.prototype.set`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/set) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([0, 0, 0])\nTypedArray.setArrayFrom(view, [5, 6], 1)\nTypedArray.toString(view) == \"0,5,6\"\n```\n" + }, "insertText": "->TypedArray.setArrayFrom", - "additionalTextEdits": [{ - "range": {"start": {"line": 1, "character": 16}, "end": {"line": 1, "character": 17}}, - "newText": "" - }] - }, { - "label": "->TypedArray.forEach", "kind": 12, - "tags": [], + "label": "->TypedArray.setArrayFrom", + "sortText": "setArrayFrom", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 17, "line": 1 }, + "start": { "character": 16, "line": 1 } + } + } + ], "detail": "(t<'a>, 'a => unit) => unit", - "documentation": {"kind": "markdown", "value": "\n`forEach(typedArray, f)` runs `f` for every element in order.\n\nSee [`TypedArray.prototype.forEach`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/forEach) on MDN.\n"}, - "sortText": "forEach", + "documentation": { + "kind": "markdown", + "value": "\n`forEach(typedArray, f)` runs `f` for every element in order.\n\nSee [`TypedArray.prototype.forEach`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/forEach) on MDN.\n" + }, "insertText": "->TypedArray.forEach", - "additionalTextEdits": [{ - "range": {"start": {"line": 1, "character": 16}, "end": {"line": 1, "character": 17}}, - "newText": "" - }] - }, { - "label": "->TypedArray.findWithIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.forEach", + "sortText": "forEach", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 17, "line": 1 }, + "start": { "character": 16, "line": 1 } + } + } + ], "detail": "(t<'a>, ('a, int) => bool) => option<'a>", - "documentation": {"kind": "markdown", "value": "\n`findWithIndex(typedArray, predicate)` behaves like `find`, but `predicate` also receives the index.\n"}, - "sortText": "findWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`findWithIndex(typedArray, predicate)` behaves like `find`, but `predicate` also receives the index.\n" + }, "insertText": "->TypedArray.findWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 1, "character": 16}, "end": {"line": 1, "character": 17}}, - "newText": "" - }] - }, { - "label": "->TypedArray.fill", "kind": 12, - "tags": [], + "label": "->TypedArray.findWithIndex", + "sortText": "findWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 17, "line": 1 }, + "start": { "character": 16, "line": 1 } + } + } + ], "detail": "(t<'a>, 'a, ~start: int, ~end: int=?) => t<'a>", - "documentation": {"kind": "markdown", "value": "\n`fill(typedArray, value, ~start, ~end)` fills the half-open interval `[start, end)` with `value`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.fill`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/fill) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3, 4])\nlet _ = TypedArray.fill(view, 0, ~start=1, ~end=3)\nTypedArray.toString(view) == \"1,0,0,4\"\n```\n"}, - "sortText": "fill", + "documentation": { + "kind": "markdown", + "value": "\n`fill(typedArray, value, ~start, ~end)` fills the half-open interval `[start, end)` with `value`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.fill`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/fill) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3, 4])\nlet _ = TypedArray.fill(view, 0, ~start=1, ~end=3)\nTypedArray.toString(view) == \"1,0,0,4\"\n```\n" + }, "insertText": "->TypedArray.fill", - "additionalTextEdits": [{ - "range": {"start": {"line": 1, "character": 16}, "end": {"line": 1, "character": 17}}, - "newText": "" - }] - }, { - "label": "->TypedArray.indexOfFrom", "kind": 12, - "tags": [], + "label": "->TypedArray.fill", + "sortText": "fill", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 17, "line": 1 }, + "start": { "character": 16, "line": 1 } + } + } + ], "detail": "(t<'a>, 'a, int) => int", - "documentation": {"kind": "markdown", "value": "\n`indexOfFrom(typedArray, value, fromIndex)` searches for `value` starting at `fromIndex`.\n"}, - "sortText": "indexOfFrom", + "documentation": { + "kind": "markdown", + "value": "\n`indexOfFrom(typedArray, value, fromIndex)` searches for `value` starting at `fromIndex`.\n" + }, "insertText": "->TypedArray.indexOfFrom", - "additionalTextEdits": [{ - "range": {"start": {"line": 1, "character": 16}, "end": {"line": 1, "character": 17}}, - "newText": "" - }] - }, { - "label": "->TypedArray.reverse", "kind": 12, - "tags": [], + "label": "->TypedArray.indexOfFrom", + "sortText": "indexOfFrom", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 17, "line": 1 }, + "start": { "character": 16, "line": 1 } + } + } + ], "detail": "t<'a> => unit", - "documentation": {"kind": "markdown", "value": "\n`reverse(typedArray)` reverses the elements of the view in place.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.reverse`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/reverse) on MDN.\n"}, - "sortText": "reverse", + "documentation": { + "kind": "markdown", + "value": "\n`reverse(typedArray)` reverses the elements of the view in place.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.reverse`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/reverse) on MDN.\n" + }, "insertText": "->TypedArray.reverse", - "additionalTextEdits": [{ - "range": {"start": {"line": 1, "character": 16}, "end": {"line": 1, "character": 17}}, - "newText": "" - }] - }, { - "label": "->TypedArray.byteOffset", "kind": 12, - "tags": [], + "label": "->TypedArray.reverse", + "sortText": "reverse", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 17, "line": 1 }, + "start": { "character": 16, "line": 1 } + } + } + ], "detail": "t<'a> => int", - "documentation": {"kind": "markdown", "value": "\n`byteOffset(typedArray)` returns the offset in bytes from the start of the buffer.\n\nSee [`TypedArray.prototype.byteOffset`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/byteOffset) on MDN.\n"}, - "sortText": "byteOffset", + "documentation": { + "kind": "markdown", + "value": "\n`byteOffset(typedArray)` returns the offset in bytes from the start of the buffer.\n\nSee [`TypedArray.prototype.byteOffset`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/byteOffset) on MDN.\n" + }, "insertText": "->TypedArray.byteOffset", - "additionalTextEdits": [{ - "range": {"start": {"line": 1, "character": 16}, "end": {"line": 1, "character": 17}}, - "newText": "" - }] - }] + "kind": 12, + "label": "->TypedArray.byteOffset", + "sortText": "byteOffset", + "tags": [] + } +] Complete src/CompletionTypedArrays.res 5:18 posCursor:[5:18] posNoWhite:[5:17] Found expr:[5:3->5:18] @@ -704,679 +1213,1188 @@ CPPipe pathFromEnv:Stdlib.BigUint64Array found:false Path Stdlib.BigUint64Array. Path Stdlib.TypedArray. Path -[{ - "label": "->BigUint64Array.ignore", - "kind": 12, - "tags": [], +[ + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 18, "line": 5 }, + "start": { "character": 17, "line": 5 } + } + } + ], "detail": "t => unit", - "documentation": {"kind": "markdown", "value": "\n `ignore(bigUintArray)` ignores the provided bigUintArray and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further.\n"}, - "sortText": "ignore", + "documentation": { + "kind": "markdown", + "value": "\n `ignore(bigUintArray)` ignores the provided bigUintArray and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further.\n" + }, "insertText": "->BigUint64Array.ignore", - "additionalTextEdits": [{ - "range": {"start": {"line": 5, "character": 17}, "end": {"line": 5, "character": 18}}, - "newText": "" - }] - }, { - "label": "->TypedArray.findLastIndexWithIndex", "kind": 12, - "tags": [], + "label": "->BigUint64Array.ignore", + "sortText": "ignore", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 18, "line": 5 }, + "start": { "character": 17, "line": 5 } + } + } + ], "detail": "(t<'a>, ('a, int) => bool) => int", - "documentation": {"kind": "markdown", "value": "\n`findLastIndexWithIndex(typedArray, predicate)` is the indexed variant of `findLastIndex`.\n"}, - "sortText": "findLastIndexWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`findLastIndexWithIndex(typedArray, predicate)` is the indexed variant of `findLastIndex`.\n" + }, "insertText": "->TypedArray.findLastIndexWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 5, "character": 17}, "end": {"line": 5, "character": 18}}, - "newText": "" - }] - }, { - "label": "->TypedArray.lastIndexOf", "kind": 12, - "tags": [], + "label": "->TypedArray.findLastIndexWithIndex", + "sortText": "findLastIndexWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 18, "line": 5 }, + "start": { "character": 17, "line": 5 } + } + } + ], "detail": "(t<'a>, 'a) => int", - "documentation": {"kind": "markdown", "value": "\n`lastIndexOf(typedArray, value)` returns the last index of `value`, or `-1` if not found.\n\nSee [`TypedArray.prototype.lastIndexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/lastIndexOf) on MDN.\n"}, - "sortText": "lastIndexOf", + "documentation": { + "kind": "markdown", + "value": "\n`lastIndexOf(typedArray, value)` returns the last index of `value`, or `-1` if not found.\n\nSee [`TypedArray.prototype.lastIndexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/lastIndexOf) on MDN.\n" + }, "insertText": "->TypedArray.lastIndexOf", - "additionalTextEdits": [{ - "range": {"start": {"line": 5, "character": 17}, "end": {"line": 5, "character": 18}}, - "newText": "" - }] - }, { - "label": "->TypedArray.findLastWithIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.lastIndexOf", + "sortText": "lastIndexOf", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 18, "line": 5 }, + "start": { "character": 17, "line": 5 } + } + } + ], "detail": "(t<'a>, ('a, int) => bool) => option<'a>", - "documentation": {"kind": "markdown", "value": "\n`findLastWithIndex(typedArray, predicate)` is the indexed variant of `findLast`.\n"}, - "sortText": "findLastWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`findLastWithIndex(typedArray, predicate)` is the indexed variant of `findLast`.\n" + }, "insertText": "->TypedArray.findLastWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 5, "character": 17}, "end": {"line": 5, "character": 18}}, - "newText": "" - }] - }, { - "label": "->TypedArray.findLast", "kind": 12, - "tags": [], + "label": "->TypedArray.findLastWithIndex", + "sortText": "findLastWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 18, "line": 5 }, + "start": { "character": 17, "line": 5 } + } + } + ], "detail": "(t<'a>, 'a => bool) => option<'a>", - "documentation": {"kind": "markdown", "value": "\n`findLast(typedArray, predicate)` returns the last element that satisfies `predicate`.\n\nSee [`TypedArray.prototype.findLast`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/findLast) on MDN.\n"}, - "sortText": "findLast", + "documentation": { + "kind": "markdown", + "value": "\n`findLast(typedArray, predicate)` returns the last element that satisfies `predicate`.\n\nSee [`TypedArray.prototype.findLast`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/findLast) on MDN.\n" + }, "insertText": "->TypedArray.findLast", - "additionalTextEdits": [{ - "range": {"start": {"line": 5, "character": 17}, "end": {"line": 5, "character": 18}}, - "newText": "" - }] - }, { - "label": "->TypedArray.filter", "kind": 12, - "tags": [], + "label": "->TypedArray.findLast", + "sortText": "findLast", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 18, "line": 5 }, + "start": { "character": 17, "line": 5 } + } + } + ], "detail": "(t<'a>, 'a => bool) => t<'a>", - "documentation": {"kind": "markdown", "value": "\n`filter(typedArray, predicate)` returns a new typed array containing only elements that satisfy `predicate`.\n\nSee [`TypedArray.prototype.filter`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/filter) on MDN.\n"}, - "sortText": "filter", + "documentation": { + "kind": "markdown", + "value": "\n`filter(typedArray, predicate)` returns a new typed array containing only elements that satisfy `predicate`.\n\nSee [`TypedArray.prototype.filter`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/filter) on MDN.\n" + }, "insertText": "->TypedArray.filter", - "additionalTextEdits": [{ - "range": {"start": {"line": 5, "character": 17}, "end": {"line": 5, "character": 18}}, - "newText": "" - }] - }, { - "label": "->TypedArray.byteLength", "kind": 12, - "tags": [], + "label": "->TypedArray.filter", + "sortText": "filter", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 18, "line": 5 }, + "start": { "character": 17, "line": 5 } + } + } + ], "detail": "t<'a> => int", - "documentation": {"kind": "markdown", "value": "\n`byteLength(typedArray)` returns the length in bytes of the view.\n\nSee [`TypedArray.prototype.byteLength`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/byteLength) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2])\nTypedArray.byteLength(view) == 8\n```\n"}, - "sortText": "byteLength", + "documentation": { + "kind": "markdown", + "value": "\n`byteLength(typedArray)` returns the length in bytes of the view.\n\nSee [`TypedArray.prototype.byteLength`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/byteLength) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2])\nTypedArray.byteLength(view) == 8\n```\n" + }, "insertText": "->TypedArray.byteLength", - "additionalTextEdits": [{ - "range": {"start": {"line": 5, "character": 17}, "end": {"line": 5, "character": 18}}, - "newText": "" - }] - }, { - "label": "->TypedArray.ignore", "kind": 12, - "tags": [], + "label": "->TypedArray.byteLength", + "sortText": "byteLength", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 18, "line": 5 }, + "start": { "character": 17, "line": 5 } + } + } + ], "detail": "t<'a> => unit", - "documentation": {"kind": "markdown", "value": "\n `ignore(typedArray)` ignores the provided typedArray and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further.\n"}, - "sortText": "ignore", + "documentation": { + "kind": "markdown", + "value": "\n `ignore(typedArray)` ignores the provided typedArray and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further.\n" + }, "insertText": "->TypedArray.ignore", - "additionalTextEdits": [{ - "range": {"start": {"line": 5, "character": 17}, "end": {"line": 5, "character": 18}}, - "newText": "" - }] - }, { - "label": "->TypedArray.reduceRightWithIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.ignore", + "sortText": "ignore", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 18, "line": 5 }, + "start": { "character": 17, "line": 5 } + } + } + ], "detail": "(t<'a>, ('b, 'a, int) => 'b, 'b) => 'b", - "documentation": {"kind": "markdown", "value": "\n`reduceRightWithIndex(typedArray, reducer, initial)` is the indexed variant of `reduceRight`.\n"}, - "sortText": "reduceRightWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`reduceRightWithIndex(typedArray, reducer, initial)` is the indexed variant of `reduceRight`.\n" + }, "insertText": "->TypedArray.reduceRightWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 5, "character": 17}, "end": {"line": 5, "character": 18}}, - "newText": "" - }] - }, { - "label": "->TypedArray.reduceRight", "kind": 12, - "tags": [], + "label": "->TypedArray.reduceRightWithIndex", + "sortText": "reduceRightWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 18, "line": 5 }, + "start": { "character": 17, "line": 5 } + } + } + ], "detail": "(t<'a>, ('b, 'a) => 'b, 'b) => 'b", - "documentation": {"kind": "markdown", "value": "\n`reduceRight(typedArray, reducer, initial)` is like `reduce` but processes the elements from right to left.\n\nSee [`TypedArray.prototype.reduceRight`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/reduceRight) on MDN.\n"}, - "sortText": "reduceRight", + "documentation": { + "kind": "markdown", + "value": "\n`reduceRight(typedArray, reducer, initial)` is like `reduce` but processes the elements from right to left.\n\nSee [`TypedArray.prototype.reduceRight`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/reduceRight) on MDN.\n" + }, "insertText": "->TypedArray.reduceRight", - "additionalTextEdits": [{ - "range": {"start": {"line": 5, "character": 17}, "end": {"line": 5, "character": 18}}, - "newText": "" - }] - }, { - "label": "->TypedArray.joinWith", "kind": 12, - "tags": [], + "label": "->TypedArray.reduceRight", + "sortText": "reduceRight", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 18, "line": 5 }, + "start": { "character": 17, "line": 5 } + } + } + ], "detail": "(t<'a>, string) => string", - "documentation": {"kind": "markdown", "value": "\n`joinWith(typedArray, separator)` returns a string formed by the elements joined with `separator`.\n\nSee [`TypedArray.prototype.join`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/join) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nTypedArray.joinWith(view, \"-\") == \"1-2-3\"\n```\n"}, - "sortText": "joinWith", + "documentation": { + "kind": "markdown", + "value": "\n`joinWith(typedArray, separator)` returns a string formed by the elements joined with `separator`.\n\nSee [`TypedArray.prototype.join`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/join) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nTypedArray.joinWith(view, \"-\") == \"1-2-3\"\n```\n" + }, "insertText": "->TypedArray.joinWith", - "additionalTextEdits": [{ - "range": {"start": {"line": 5, "character": 17}, "end": {"line": 5, "character": 18}}, - "newText": "" - }] - }, { - "label": "->TypedArray.buffer", "kind": 12, - "tags": [], + "label": "->TypedArray.joinWith", + "sortText": "joinWith", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 18, "line": 5 }, + "start": { "character": 17, "line": 5 } + } + } + ], "detail": "t<'a> => ArrayBuffer.t", - "documentation": {"kind": "markdown", "value": "\n`buffer(typedArray)` returns the underlying `ArrayBuffer` backing this view.\n\nSee [`TypedArray.prototype.buffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/buffer) on MDN.\n"}, - "sortText": "buffer", + "documentation": { + "kind": "markdown", + "value": "\n`buffer(typedArray)` returns the underlying `ArrayBuffer` backing this view.\n\nSee [`TypedArray.prototype.buffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/buffer) on MDN.\n" + }, "insertText": "->TypedArray.buffer", - "additionalTextEdits": [{ - "range": {"start": {"line": 5, "character": 17}, "end": {"line": 5, "character": 18}}, - "newText": "" - }] - }, { - "label": "->TypedArray.reduce", "kind": 12, - "tags": [], + "label": "->TypedArray.buffer", + "sortText": "buffer", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 18, "line": 5 }, + "start": { "character": 17, "line": 5 } + } + } + ], "detail": "(t<'a>, ('b, 'a) => 'b, 'b) => 'b", - "documentation": {"kind": "markdown", "value": "\n`reduce(typedArray, reducer, initial)` combines the elements from left to right using `reducer`.\n\nSee [`TypedArray.prototype.reduce`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/reduce) on MDN.\n"}, - "sortText": "reduce", + "documentation": { + "kind": "markdown", + "value": "\n`reduce(typedArray, reducer, initial)` combines the elements from left to right using `reducer`.\n\nSee [`TypedArray.prototype.reduce`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/reduce) on MDN.\n" + }, "insertText": "->TypedArray.reduce", - "additionalTextEdits": [{ - "range": {"start": {"line": 5, "character": 17}, "end": {"line": 5, "character": 18}}, - "newText": "" - }] - }, { - "label": "->TypedArray.forEachWithIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.reduce", + "sortText": "reduce", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 18, "line": 5 }, + "start": { "character": 17, "line": 5 } + } + } + ], "detail": "(t<'a>, ('a, int) => unit) => unit", - "documentation": {"kind": "markdown", "value": "\n`forEachWithIndex(typedArray, f)` runs `f` for every element, also providing the index.\n"}, - "sortText": "forEachWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`forEachWithIndex(typedArray, f)` runs `f` for every element, also providing the index.\n" + }, "insertText": "->TypedArray.forEachWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 5, "character": 17}, "end": {"line": 5, "character": 18}}, - "newText": "" - }] - }, { - "label": "->TypedArray.copy", "kind": 12, - "tags": [], + "label": "->TypedArray.forEachWithIndex", + "sortText": "forEachWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 18, "line": 5 }, + "start": { "character": 17, "line": 5 } + } + } + ], "detail": "t<'a> => t<'a>", - "documentation": {"kind": "markdown", "value": "\n`copy(typedArray)` produces a shallow copy of the typed array.\n"}, - "sortText": "copy", + "documentation": { + "kind": "markdown", + "value": "\n`copy(typedArray)` produces a shallow copy of the typed array.\n" + }, "insertText": "->TypedArray.copy", - "additionalTextEdits": [{ - "range": {"start": {"line": 5, "character": 17}, "end": {"line": 5, "character": 18}}, - "newText": "" - }] - }, { - "label": "->TypedArray.someWithIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.copy", + "sortText": "copy", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 18, "line": 5 }, + "start": { "character": 17, "line": 5 } + } + } + ], "detail": "(t<'a>, ('a, int) => bool) => bool", - "documentation": {"kind": "markdown", "value": "\n`someWithIndex(typedArray, predicate)` behaves like `some`, but `predicate` also receives the element index.\n"}, - "sortText": "someWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`someWithIndex(typedArray, predicate)` behaves like `some`, but `predicate` also receives the element index.\n" + }, "insertText": "->TypedArray.someWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 5, "character": 17}, "end": {"line": 5, "character": 18}}, - "newText": "" - }] - }, { - "label": "->TypedArray.findIndexWithIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.someWithIndex", + "sortText": "someWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 18, "line": 5 }, + "start": { "character": 17, "line": 5 } + } + } + ], "detail": "(t<'a>, ('a, int) => bool) => int", - "documentation": {"kind": "markdown", "value": "\n`findIndexWithIndex(typedArray, predicate)` is the indexed variant of `findIndex`.\n"}, - "sortText": "findIndexWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`findIndexWithIndex(typedArray, predicate)` is the indexed variant of `findIndex`.\n" + }, "insertText": "->TypedArray.findIndexWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 5, "character": 17}, "end": {"line": 5, "character": 18}}, - "newText": "" - }] - }, { - "label": "->TypedArray.sliceToEnd", "kind": 12, - "tags": [1], + "label": "->TypedArray.findIndexWithIndex", + "sortText": "findIndexWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 18, "line": 5 }, + "start": { "character": 17, "line": 5 } + } + } + ], + "deprecated": true, "detail": "(t<'a>, ~start: int) => t<'a>", - "documentation": {"kind": "markdown", "value": "Deprecated: Use `slice` instead\n\n\n`sliceToEnd(typedArray, ~start)` returns the elements from `start` through the end in a new typed array.\n"}, - "sortText": "sliceToEnd", + "documentation": { + "kind": "markdown", + "value": "Deprecated: Use `slice` instead\n\n\n`sliceToEnd(typedArray, ~start)` returns the elements from `start` through the end in a new typed array.\n" + }, "insertText": "->TypedArray.sliceToEnd", - "additionalTextEdits": [{ - "range": {"start": {"line": 5, "character": 17}, "end": {"line": 5, "character": 18}}, - "newText": "" - }] - }, { - "label": "->TypedArray.slice", "kind": 12, - "tags": [], + "label": "->TypedArray.sliceToEnd", + "sortText": "sliceToEnd", + "tags": [ 1 ] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 18, "line": 5 }, + "start": { "character": 17, "line": 5 } + } + } + ], "detail": "(t<'a>, ~start: int, ~end: int=?) => t<'a>", - "documentation": {"kind": "markdown", "value": "\n`slice(typedArray, ~start, ~end)` returns a new typed array containing the elements in `[start, end)`.\n\nSee [`TypedArray.prototype.slice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/slice) on MDN.\n"}, - "sortText": "slice", + "documentation": { + "kind": "markdown", + "value": "\n`slice(typedArray, ~start, ~end)` returns a new typed array containing the elements in `[start, end)`.\n\nSee [`TypedArray.prototype.slice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/slice) on MDN.\n" + }, "insertText": "->TypedArray.slice", - "additionalTextEdits": [{ - "range": {"start": {"line": 5, "character": 17}, "end": {"line": 5, "character": 18}}, - "newText": "" - }] - }, { - "label": "->TypedArray.findLastIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.slice", + "sortText": "slice", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 18, "line": 5 }, + "start": { "character": 17, "line": 5 } + } + } + ], "detail": "(t<'a>, 'a => bool) => int", - "documentation": {"kind": "markdown", "value": "\n`findLastIndex(typedArray, predicate)` returns the index of the last matching element, or `-1` if none do.\n\nSee [`TypedArray.prototype.findLastIndex`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/findLastIndex) on MDN.\n"}, - "sortText": "findLastIndex", + "documentation": { + "kind": "markdown", + "value": "\n`findLastIndex(typedArray, predicate)` returns the index of the last matching element, or `-1` if none do.\n\nSee [`TypedArray.prototype.findLastIndex`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/findLastIndex) on MDN.\n" + }, "insertText": "->TypedArray.findLastIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 5, "character": 17}, "end": {"line": 5, "character": 18}}, - "newText": "" - }] - }, { - "label": "->TypedArray.includes", "kind": 12, - "tags": [], + "label": "->TypedArray.findLastIndex", + "sortText": "findLastIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 18, "line": 5 }, + "start": { "character": 17, "line": 5 } + } + } + ], "detail": "(t<'a>, 'a) => bool", - "documentation": {"kind": "markdown", "value": "\n`includes(typedArray, value)` returns `true` if `value` occurs in the typed array.\n\nSee [`TypedArray.prototype.includes`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/includes) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nTypedArray.includes(view, 2) == true\nTypedArray.includes(view, 10) == false\n```\n"}, - "sortText": "includes", + "documentation": { + "kind": "markdown", + "value": "\n`includes(typedArray, value)` returns `true` if `value` occurs in the typed array.\n\nSee [`TypedArray.prototype.includes`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/includes) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nTypedArray.includes(view, 2) == true\nTypedArray.includes(view, 10) == false\n```\n" + }, "insertText": "->TypedArray.includes", - "additionalTextEdits": [{ - "range": {"start": {"line": 5, "character": 17}, "end": {"line": 5, "character": 18}}, - "newText": "" - }] - }, { - "label": "->TypedArray.fillToEnd", "kind": 12, - "tags": [1], + "label": "->TypedArray.includes", + "sortText": "includes", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 18, "line": 5 }, + "start": { "character": 17, "line": 5 } + } + } + ], + "deprecated": true, "detail": "(t<'a>, 'a, ~start: int) => t<'a>", - "documentation": {"kind": "markdown", "value": "Deprecated: Use `fill` instead\n\n\n`fillToEnd(typedArray, value, ~start)` fills from `start` through the end with `value`.\n\nBeware this will *mutate* the typed array.\n"}, - "sortText": "fillToEnd", + "documentation": { + "kind": "markdown", + "value": "Deprecated: Use `fill` instead\n\n\n`fillToEnd(typedArray, value, ~start)` fills from `start` through the end with `value`.\n\nBeware this will *mutate* the typed array.\n" + }, "insertText": "->TypedArray.fillToEnd", - "additionalTextEdits": [{ - "range": {"start": {"line": 5, "character": 17}, "end": {"line": 5, "character": 18}}, - "newText": "" - }] - }, { - "label": "->TypedArray.fillAll", "kind": 12, - "tags": [], + "label": "->TypedArray.fillToEnd", + "sortText": "fillToEnd", + "tags": [ 1 ] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 18, "line": 5 }, + "start": { "character": 17, "line": 5 } + } + } + ], "detail": "(t<'a>, 'a) => t<'a>", - "documentation": {"kind": "markdown", "value": "\n`fillAll(typedArray, value)` fills every element with `value`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.fill`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/fill) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nlet _ = TypedArray.fillAll(view, 9)\nTypedArray.toString(view) == \"9,9,9\"\n```\n"}, - "sortText": "fillAll", + "documentation": { + "kind": "markdown", + "value": "\n`fillAll(typedArray, value)` fills every element with `value`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.fill`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/fill) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nlet _ = TypedArray.fillAll(view, 9)\nTypedArray.toString(view) == \"9,9,9\"\n```\n" + }, "insertText": "->TypedArray.fillAll", - "additionalTextEdits": [{ - "range": {"start": {"line": 5, "character": 17}, "end": {"line": 5, "character": 18}}, - "newText": "" - }] - }, { - "label": "->TypedArray.find", "kind": 12, - "tags": [], + "label": "->TypedArray.fillAll", + "sortText": "fillAll", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 18, "line": 5 }, + "start": { "character": 17, "line": 5 } + } + } + ], "detail": "(t<'a>, 'a => bool) => option<'a>", - "documentation": {"kind": "markdown", "value": "\n`find(typedArray, predicate)` returns the first element that satisfies `predicate`, or `None` if nothing matches.\n\nSee [`TypedArray.prototype.find`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/find) on MDN.\n"}, - "sortText": "find", + "documentation": { + "kind": "markdown", + "value": "\n`find(typedArray, predicate)` returns the first element that satisfies `predicate`, or `None` if nothing matches.\n\nSee [`TypedArray.prototype.find`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/find) on MDN.\n" + }, "insertText": "->TypedArray.find", - "additionalTextEdits": [{ - "range": {"start": {"line": 5, "character": 17}, "end": {"line": 5, "character": 18}}, - "newText": "" - }] - }, { - "label": "->TypedArray.subarrayToEnd", "kind": 12, - "tags": [1], + "label": "->TypedArray.find", + "sortText": "find", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 18, "line": 5 }, + "start": { "character": 17, "line": 5 } + } + } + ], + "deprecated": true, "detail": "(t<'a>, ~start: int) => t<'a>", - "documentation": {"kind": "markdown", "value": "Deprecated: Use `subarray` instead\n\n\n`subarrayToEnd(typedArray, ~start)` returns a new view from `start` to the end of the buffer.\n"}, - "sortText": "subarrayToEnd", + "documentation": { + "kind": "markdown", + "value": "Deprecated: Use `subarray` instead\n\n\n`subarrayToEnd(typedArray, ~start)` returns a new view from `start` to the end of the buffer.\n" + }, "insertText": "->TypedArray.subarrayToEnd", - "additionalTextEdits": [{ - "range": {"start": {"line": 5, "character": 17}, "end": {"line": 5, "character": 18}}, - "newText": "" - }] - }, { - "label": "->TypedArray.set", "kind": 12, - "tags": [], + "label": "->TypedArray.subarrayToEnd", + "sortText": "subarrayToEnd", + "tags": [ 1 ] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 18, "line": 5 }, + "start": { "character": 17, "line": 5 } + } + } + ], "detail": "(t<'a>, int, 'a) => unit", - "documentation": {"kind": "markdown", "value": "\n`set(typedArray, index, item)` sets the provided `item` at `index` of `typedArray`.\n\nBeware this will *mutate* the array.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2])\nTypedArray.set(view, 1, 5)\nTypedArray.get(view, 1) == Some(5)\n```\n"}, - "sortText": "set", + "documentation": { + "kind": "markdown", + "value": "\n`set(typedArray, index, item)` sets the provided `item` at `index` of `typedArray`.\n\nBeware this will *mutate* the array.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2])\nTypedArray.set(view, 1, 5)\nTypedArray.get(view, 1) == Some(5)\n```\n" + }, "insertText": "->TypedArray.set", - "additionalTextEdits": [{ - "range": {"start": {"line": 5, "character": 17}, "end": {"line": 5, "character": 18}}, - "newText": "" - }] - }, { - "label": "->TypedArray.toLocaleString", "kind": 12, - "tags": [], + "label": "->TypedArray.set", + "sortText": "set", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 18, "line": 5 }, + "start": { "character": 17, "line": 5 } + } + } + ], "detail": "t<'a> => string", - "documentation": {"kind": "markdown", "value": "\n`toLocaleString(typedArray)` concatenates the elements using locale-aware formatting.\n\nSee [`TypedArray.prototype.toLocaleString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/toLocaleString) on MDN.\n"}, - "sortText": "toLocaleString", + "documentation": { + "kind": "markdown", + "value": "\n`toLocaleString(typedArray)` concatenates the elements using locale-aware formatting.\n\nSee [`TypedArray.prototype.toLocaleString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/toLocaleString) on MDN.\n" + }, "insertText": "->TypedArray.toLocaleString", - "additionalTextEdits": [{ - "range": {"start": {"line": 5, "character": 17}, "end": {"line": 5, "character": 18}}, - "newText": "" - }] - }, { - "label": "->TypedArray.lastIndexOfFrom", "kind": 12, - "tags": [], + "label": "->TypedArray.toLocaleString", + "sortText": "toLocaleString", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 18, "line": 5 }, + "start": { "character": 17, "line": 5 } + } + } + ], "detail": "(t<'a>, 'a, int) => int", - "documentation": {"kind": "markdown", "value": "\n`lastIndexOfFrom(typedArray, value, fromIndex)` searches backwards starting at `fromIndex`.\n"}, - "sortText": "lastIndexOfFrom", + "documentation": { + "kind": "markdown", + "value": "\n`lastIndexOfFrom(typedArray, value, fromIndex)` searches backwards starting at `fromIndex`.\n" + }, "insertText": "->TypedArray.lastIndexOfFrom", - "additionalTextEdits": [{ - "range": {"start": {"line": 5, "character": 17}, "end": {"line": 5, "character": 18}}, - "newText": "" - }] - }, { - "label": "->TypedArray.findIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.lastIndexOfFrom", + "sortText": "lastIndexOfFrom", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 18, "line": 5 }, + "start": { "character": 17, "line": 5 } + } + } + ], "detail": "(t<'a>, 'a => bool) => int", - "documentation": {"kind": "markdown", "value": "\n`findIndex(typedArray, predicate)` returns the index of the first element that satisfies `predicate`, or `-1` if none do.\n\nSee [`TypedArray.prototype.findIndex`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/findIndex) on MDN.\n"}, - "sortText": "findIndex", + "documentation": { + "kind": "markdown", + "value": "\n`findIndex(typedArray, predicate)` returns the index of the first element that satisfies `predicate`, or `-1` if none do.\n\nSee [`TypedArray.prototype.findIndex`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/findIndex) on MDN.\n" + }, "insertText": "->TypedArray.findIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 5, "character": 17}, "end": {"line": 5, "character": 18}}, - "newText": "" - }] - }, { - "label": "->TypedArray.filterWithIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.findIndex", + "sortText": "findIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 18, "line": 5 }, + "start": { "character": 17, "line": 5 } + } + } + ], "detail": "(t<'a>, ('a, int) => bool) => t<'a>", - "documentation": {"kind": "markdown", "value": "\n`filterWithIndex(typedArray, predicate)` behaves like `filter` but also passes the index to `predicate`.\n"}, - "sortText": "filterWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`filterWithIndex(typedArray, predicate)` behaves like `filter` but also passes the index to `predicate`.\n" + }, "insertText": "->TypedArray.filterWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 5, "character": 17}, "end": {"line": 5, "character": 18}}, - "newText": "" - }] - }, { - "label": "->TypedArray.sort", "kind": 12, - "tags": [], + "label": "->TypedArray.filterWithIndex", + "sortText": "filterWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 18, "line": 5 }, + "start": { "character": 17, "line": 5 } + } + } + ], "detail": "(t<'a>, ('a, 'a) => Ordering.t) => unit", - "documentation": {"kind": "markdown", "value": "\n`sort(typedArray, comparator)` sorts the values in place using `comparator`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.sort`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/sort) on MDN.\n"}, - "sortText": "sort", + "documentation": { + "kind": "markdown", + "value": "\n`sort(typedArray, comparator)` sorts the values in place using `comparator`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.sort`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/sort) on MDN.\n" + }, "insertText": "->TypedArray.sort", - "additionalTextEdits": [{ - "range": {"start": {"line": 5, "character": 17}, "end": {"line": 5, "character": 18}}, - "newText": "" - }] - }, { - "label": "->TypedArray.mapWithIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.sort", + "sortText": "sort", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 18, "line": 5 }, + "start": { "character": 17, "line": 5 } + } + } + ], "detail": "(t<'a>, ('a, int) => 'b) => t<'b>", - "documentation": {"kind": "markdown", "value": "\n`mapWithIndex(typedArray, f)` behaves like `map`, but `f` also receives the index.\n"}, - "sortText": "mapWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`mapWithIndex(typedArray, f)` behaves like `map`, but `f` also receives the index.\n" + }, "insertText": "->TypedArray.mapWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 5, "character": 17}, "end": {"line": 5, "character": 18}}, - "newText": "" - }] - }, { - "label": "->TypedArray.every", "kind": 12, - "tags": [], + "label": "->TypedArray.mapWithIndex", + "sortText": "mapWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 18, "line": 5 }, + "start": { "character": 17, "line": 5 } + } + } + ], "detail": "(t<'a>, 'a => bool) => bool", - "documentation": {"kind": "markdown", "value": "\n`every(typedArray, predicate)` returns `true` if `predicate` returns `true` for every element.\n\nSee [`TypedArray.prototype.every`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/every) on MDN.\n"}, - "sortText": "every", + "documentation": { + "kind": "markdown", + "value": "\n`every(typedArray, predicate)` returns `true` if `predicate` returns `true` for every element.\n\nSee [`TypedArray.prototype.every`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/every) on MDN.\n" + }, "insertText": "->TypedArray.every", - "additionalTextEdits": [{ - "range": {"start": {"line": 5, "character": 17}, "end": {"line": 5, "character": 18}}, - "newText": "" - }] - }, { - "label": "->TypedArray.length", "kind": 12, - "tags": [], + "label": "->TypedArray.every", + "sortText": "every", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 18, "line": 5 }, + "start": { "character": 17, "line": 5 } + } + } + ], "detail": "t<'a> => int", - "documentation": {"kind": "markdown", "value": "\n`length(typedArray)` returns the number of elements.\n\nSee [`TypedArray.prototype.length`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/length) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nTypedArray.length(view) == 3\n```\n"}, - "sortText": "length", + "documentation": { + "kind": "markdown", + "value": "\n`length(typedArray)` returns the number of elements.\n\nSee [`TypedArray.prototype.length`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/length) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nTypedArray.length(view) == 3\n```\n" + }, "insertText": "->TypedArray.length", - "additionalTextEdits": [{ - "range": {"start": {"line": 5, "character": 17}, "end": {"line": 5, "character": 18}}, - "newText": "" - }] - }, { - "label": "->TypedArray.indexOf", "kind": 12, - "tags": [], + "label": "->TypedArray.length", + "sortText": "length", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 18, "line": 5 }, + "start": { "character": 17, "line": 5 } + } + } + ], "detail": "(t<'a>, 'a) => int", - "documentation": {"kind": "markdown", "value": "\n`indexOf(typedArray, value)` returns the first index of `value`, or `-1` when not found.\n\nSee [`TypedArray.prototype.indexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/indexOf) on MDN.\n"}, - "sortText": "indexOf", + "documentation": { + "kind": "markdown", + "value": "\n`indexOf(typedArray, value)` returns the first index of `value`, or `-1` when not found.\n\nSee [`TypedArray.prototype.indexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/indexOf) on MDN.\n" + }, "insertText": "->TypedArray.indexOf", - "additionalTextEdits": [{ - "range": {"start": {"line": 5, "character": 17}, "end": {"line": 5, "character": 18}}, - "newText": "" - }] - }, { - "label": "->TypedArray.copyWithinToEnd", "kind": 12, - "tags": [1], + "label": "->TypedArray.indexOf", + "sortText": "indexOf", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 18, "line": 5 }, + "start": { "character": 17, "line": 5 } + } + } + ], + "deprecated": true, "detail": "(t<'a>, ~target: int, ~start: int) => array<'a>", - "documentation": {"kind": "markdown", "value": "Deprecated: Use `copyWithin` instead\n\n\n`copyWithinToEnd(typedArray, ~target, ~start)` copies values from `start` through the end of the view into the range beginning at `target`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.copyWithin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/copyWithin) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3, 4])\nlet _ = TypedArray.copyWithinToEnd(view, ~target=0, ~start=2)\nTypedArray.toString(view) == \"3,4,3,4\"\n```\n"}, - "sortText": "copyWithinToEnd", + "documentation": { + "kind": "markdown", + "value": "Deprecated: Use `copyWithin` instead\n\n\n`copyWithinToEnd(typedArray, ~target, ~start)` copies values from `start` through the end of the view into the range beginning at `target`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.copyWithin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/copyWithin) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3, 4])\nlet _ = TypedArray.copyWithinToEnd(view, ~target=0, ~start=2)\nTypedArray.toString(view) == \"3,4,3,4\"\n```\n" + }, "insertText": "->TypedArray.copyWithinToEnd", - "additionalTextEdits": [{ - "range": {"start": {"line": 5, "character": 17}, "end": {"line": 5, "character": 18}}, - "newText": "" - }] - }, { - "label": "->TypedArray.some", "kind": 12, - "tags": [], + "label": "->TypedArray.copyWithinToEnd", + "sortText": "copyWithinToEnd", + "tags": [ 1 ] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 18, "line": 5 }, + "start": { "character": 17, "line": 5 } + } + } + ], "detail": "(t<'a>, 'a => bool) => bool", - "documentation": {"kind": "markdown", "value": "\n`some(typedArray, predicate)` returns `true` if `predicate` returns `true` for at least one element.\n\nSee [`TypedArray.prototype.some`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/some) on MDN.\n"}, - "sortText": "some", + "documentation": { + "kind": "markdown", + "value": "\n`some(typedArray, predicate)` returns `true` if `predicate` returns `true` for at least one element.\n\nSee [`TypedArray.prototype.some`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/some) on MDN.\n" + }, "insertText": "->TypedArray.some", - "additionalTextEdits": [{ - "range": {"start": {"line": 5, "character": 17}, "end": {"line": 5, "character": 18}}, - "newText": "" - }] - }, { - "label": "->TypedArray.reduceWithIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.some", + "sortText": "some", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 18, "line": 5 }, + "start": { "character": 17, "line": 5 } + } + } + ], "detail": "(t<'a>, ('b, 'a, int) => 'b, 'b) => 'b", - "documentation": {"kind": "markdown", "value": "\n`reduceWithIndex(typedArray, reducer, initial)` is the indexed variant of `reduce`.\n"}, - "sortText": "reduceWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`reduceWithIndex(typedArray, reducer, initial)` is the indexed variant of `reduce`.\n" + }, "insertText": "->TypedArray.reduceWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 5, "character": 17}, "end": {"line": 5, "character": 18}}, - "newText": "" - }] - }, { - "label": "->TypedArray.map", "kind": 12, - "tags": [], + "label": "->TypedArray.reduceWithIndex", + "sortText": "reduceWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 18, "line": 5 }, + "start": { "character": 17, "line": 5 } + } + } + ], "detail": "(t<'a>, 'a => 'b) => t<'b>", - "documentation": {"kind": "markdown", "value": "\n`map(typedArray, f)` returns a new typed array whose elements are produced by applying `f` to each element.\n\nSee [`TypedArray.prototype.map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/map) on MDN.\n"}, - "sortText": "map", + "documentation": { + "kind": "markdown", + "value": "\n`map(typedArray, f)` returns a new typed array whose elements are produced by applying `f` to each element.\n\nSee [`TypedArray.prototype.map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/map) on MDN.\n" + }, "insertText": "->TypedArray.map", - "additionalTextEdits": [{ - "range": {"start": {"line": 5, "character": 17}, "end": {"line": 5, "character": 18}}, - "newText": "" - }] - }, { - "label": "->TypedArray.toSorted", "kind": 12, - "tags": [], + "label": "->TypedArray.map", + "sortText": "map", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 18, "line": 5 }, + "start": { "character": 17, "line": 5 } + } + } + ], "detail": "(t<'a>, ('a, 'a) => Ordering.t) => t<'a>", - "documentation": {"kind": "markdown", "value": "\n`toSorted(typedArray, comparator)` returns a new typed array containing the sorted values, leaving the original untouched.\n\nSee [`TypedArray.prototype.toSorted`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/toSorted) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([3, 1, 2])\nlet sorted = TypedArray.toSorted(view, Int.compare)\nTypedArray.toString(sorted) == \"1,2,3\"\nTypedArray.toString(view) == \"3,1,2\"\n```\n"}, - "sortText": "toSorted", + "documentation": { + "kind": "markdown", + "value": "\n`toSorted(typedArray, comparator)` returns a new typed array containing the sorted values, leaving the original untouched.\n\nSee [`TypedArray.prototype.toSorted`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/toSorted) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([3, 1, 2])\nlet sorted = TypedArray.toSorted(view, Int.compare)\nTypedArray.toString(sorted) == \"1,2,3\"\nTypedArray.toString(view) == \"3,1,2\"\n```\n" + }, "insertText": "->TypedArray.toSorted", - "additionalTextEdits": [{ - "range": {"start": {"line": 5, "character": 17}, "end": {"line": 5, "character": 18}}, - "newText": "" - }] - }, { - "label": "->TypedArray.copyAllWithin", "kind": 12, - "tags": [], + "label": "->TypedArray.toSorted", + "sortText": "toSorted", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 18, "line": 5 }, + "start": { "character": 17, "line": 5 } + } + } + ], "detail": "(t<'a>, ~target: int) => array<'a>", - "documentation": {"kind": "markdown", "value": "\n`copyAllWithin(typedArray, ~target)` copies values starting at index `0` over the positions beginning at `target`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.copyWithin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/copyWithin) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([10, 20, 30])\nlet _ = TypedArray.copyAllWithin(view, ~target=1)\nTypedArray.toString(view) == \"10,10,20\"\n```\n"}, - "sortText": "copyAllWithin", + "documentation": { + "kind": "markdown", + "value": "\n`copyAllWithin(typedArray, ~target)` copies values starting at index `0` over the positions beginning at `target`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.copyWithin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/copyWithin) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([10, 20, 30])\nlet _ = TypedArray.copyAllWithin(view, ~target=1)\nTypedArray.toString(view) == \"10,10,20\"\n```\n" + }, "insertText": "->TypedArray.copyAllWithin", - "additionalTextEdits": [{ - "range": {"start": {"line": 5, "character": 17}, "end": {"line": 5, "character": 18}}, - "newText": "" - }] - }, { - "label": "->TypedArray.subarray", "kind": 12, - "tags": [], + "label": "->TypedArray.copyAllWithin", + "sortText": "copyAllWithin", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 18, "line": 5 }, + "start": { "character": 17, "line": 5 } + } + } + ], "detail": "(t<'a>, ~start: int, ~end: int=?) => t<'a>", - "documentation": {"kind": "markdown", "value": "\n`subarray(typedArray, ~start, ~end)` returns a new view referencing the same buffer over `[start, end)`.\n\nSee [`TypedArray.prototype.subarray`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/subarray) on MDN.\n"}, - "sortText": "subarray", + "documentation": { + "kind": "markdown", + "value": "\n`subarray(typedArray, ~start, ~end)` returns a new view referencing the same buffer over `[start, end)`.\n\nSee [`TypedArray.prototype.subarray`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/subarray) on MDN.\n" + }, "insertText": "->TypedArray.subarray", - "additionalTextEdits": [{ - "range": {"start": {"line": 5, "character": 17}, "end": {"line": 5, "character": 18}}, - "newText": "" - }] - }, { - "label": "->TypedArray.setArray", "kind": 12, - "tags": [], + "label": "->TypedArray.subarray", + "sortText": "subarray", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 18, "line": 5 }, + "start": { "character": 17, "line": 5 } + } + } + ], "detail": "(t<'a>, array<'a>) => unit", - "documentation": {"kind": "markdown", "value": "\n`setArray(target, source)` copies the values from `source` into `target`, mutating it.\n\nSee [`TypedArray.prototype.set`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/set) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([0, 0])\nTypedArray.setArray(view, [1, 2])\nTypedArray.toString(view) == \"1,2\"\n```\n"}, - "sortText": "setArray", + "documentation": { + "kind": "markdown", + "value": "\n`setArray(target, source)` copies the values from `source` into `target`, mutating it.\n\nSee [`TypedArray.prototype.set`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/set) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([0, 0])\nTypedArray.setArray(view, [1, 2])\nTypedArray.toString(view) == \"1,2\"\n```\n" + }, "insertText": "->TypedArray.setArray", - "additionalTextEdits": [{ - "range": {"start": {"line": 5, "character": 17}, "end": {"line": 5, "character": 18}}, - "newText": "" - }] - }, { - "label": "->TypedArray.get", "kind": 12, - "tags": [], + "label": "->TypedArray.setArray", + "sortText": "setArray", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 18, "line": 5 }, + "start": { "character": 17, "line": 5 } + } + } + ], "detail": "(t<'a>, int) => option<'a>", - "documentation": {"kind": "markdown", "value": "\n`get(typedArray, index)` returns the element at `index` of `typedArray`.\nReturns `None` if the index does not exist in the typed array. Equivalent to doing `typedArray[index]` in JavaScript.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nTypedArray.get(view, 0) == Some(1)\nTypedArray.get(view, 10) == None\n```\n"}, - "sortText": "get", + "documentation": { + "kind": "markdown", + "value": "\n`get(typedArray, index)` returns the element at `index` of `typedArray`.\nReturns `None` if the index does not exist in the typed array. Equivalent to doing `typedArray[index]` in JavaScript.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nTypedArray.get(view, 0) == Some(1)\nTypedArray.get(view, 10) == None\n```\n" + }, "insertText": "->TypedArray.get", - "additionalTextEdits": [{ - "range": {"start": {"line": 5, "character": 17}, "end": {"line": 5, "character": 18}}, - "newText": "" - }] - }, { - "label": "->TypedArray.with", "kind": 12, - "tags": [], + "label": "->TypedArray.get", + "sortText": "get", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 18, "line": 5 }, + "start": { "character": 17, "line": 5 } + } + } + ], "detail": "(t<'a>, int, 'a) => t<'a>", - "documentation": {"kind": "markdown", "value": "\n`with(typedArray, index, value)` returns a new typed array where the element at `index` is replaced with `value`.\n\nSee [`TypedArray.prototype.with`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/with) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nlet updated = TypedArray.with(view, 1, 10)\nTypedArray.toString(updated) == \"1,10,3\"\nTypedArray.toString(view) == \"1,2,3\"\n```\n"}, - "sortText": "with", + "documentation": { + "kind": "markdown", + "value": "\n`with(typedArray, index, value)` returns a new typed array where the element at `index` is replaced with `value`.\n\nSee [`TypedArray.prototype.with`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/with) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nlet updated = TypedArray.with(view, 1, 10)\nTypedArray.toString(updated) == \"1,10,3\"\nTypedArray.toString(view) == \"1,2,3\"\n```\n" + }, "insertText": "->TypedArray.with", - "additionalTextEdits": [{ - "range": {"start": {"line": 5, "character": 17}, "end": {"line": 5, "character": 18}}, - "newText": "" - }] - }, { - "label": "->TypedArray.toReversed", "kind": 12, - "tags": [], + "label": "->TypedArray.with", + "sortText": "with", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 18, "line": 5 }, + "start": { "character": 17, "line": 5 } + } + } + ], "detail": "t<'a> => t<'a>", - "documentation": {"kind": "markdown", "value": "\n`toReversed(typedArray)` returns a new typed array with the elements in reverse order, leaving the original untouched.\n\nSee [`TypedArray.prototype.toReversed`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/toReversed) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nlet reversed = TypedArray.toReversed(view)\nTypedArray.toString(reversed) == \"3,2,1\"\nTypedArray.toString(view) == \"1,2,3\"\n```\n"}, - "sortText": "toReversed", + "documentation": { + "kind": "markdown", + "value": "\n`toReversed(typedArray)` returns a new typed array with the elements in reverse order, leaving the original untouched.\n\nSee [`TypedArray.prototype.toReversed`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/toReversed) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nlet reversed = TypedArray.toReversed(view)\nTypedArray.toString(reversed) == \"3,2,1\"\nTypedArray.toString(view) == \"1,2,3\"\n```\n" + }, "insertText": "->TypedArray.toReversed", - "additionalTextEdits": [{ - "range": {"start": {"line": 5, "character": 17}, "end": {"line": 5, "character": 18}}, - "newText": "" - }] - }, { - "label": "->TypedArray.copyWithin", "kind": 12, - "tags": [], + "label": "->TypedArray.toReversed", + "sortText": "toReversed", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 18, "line": 5 }, + "start": { "character": 17, "line": 5 } + } + } + ], "detail": "(t<'a>, ~target: int, ~start: int, ~end: int=?) => array<'a>", - "documentation": {"kind": "markdown", "value": "\n`copyWithin(typedArray, ~target, ~start, ~end)` copies the section `[start, end)` onto the range beginning at `target`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.copyWithin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/copyWithin) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3, 4])\nlet _ = TypedArray.copyWithin(view, ~target=1, ~start=2, ~end=4)\nTypedArray.toString(view) == \"1,3,4,4\"\n```\n"}, - "sortText": "copyWithin", + "documentation": { + "kind": "markdown", + "value": "\n`copyWithin(typedArray, ~target, ~start, ~end)` copies the section `[start, end)` onto the range beginning at `target`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.copyWithin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/copyWithin) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3, 4])\nlet _ = TypedArray.copyWithin(view, ~target=1, ~start=2, ~end=4)\nTypedArray.toString(view) == \"1,3,4,4\"\n```\n" + }, "insertText": "->TypedArray.copyWithin", - "additionalTextEdits": [{ - "range": {"start": {"line": 5, "character": 17}, "end": {"line": 5, "character": 18}}, - "newText": "" - }] - }, { - "label": "->TypedArray.everyWithIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.copyWithin", + "sortText": "copyWithin", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 18, "line": 5 }, + "start": { "character": 17, "line": 5 } + } + } + ], "detail": "(t<'a>, ('a, int) => bool) => bool", - "documentation": {"kind": "markdown", "value": "\n`everyWithIndex(typedArray, checker)` is like `every` but provides the element index to `checker`.\n"}, - "sortText": "everyWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`everyWithIndex(typedArray, checker)` is like `every` but provides the element index to `checker`.\n" + }, "insertText": "->TypedArray.everyWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 5, "character": 17}, "end": {"line": 5, "character": 18}}, - "newText": "" - }] - }, { - "label": "->TypedArray.toString", "kind": 12, - "tags": [], + "label": "->TypedArray.everyWithIndex", + "sortText": "everyWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 18, "line": 5 }, + "start": { "character": 17, "line": 5 } + } + } + ], "detail": "t<'a> => string", - "documentation": {"kind": "markdown", "value": "\n`toString(typedArray)` returns a comma-separated string of the elements.\n\nSee [`TypedArray.prototype.toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/toString) on MDN.\n\n## Examples\n\n```rescript\nInt32Array.fromArray([1, 2])->TypedArray.toString == \"1,2\"\n```\n"}, - "sortText": "toString", + "documentation": { + "kind": "markdown", + "value": "\n`toString(typedArray)` returns a comma-separated string of the elements.\n\nSee [`TypedArray.prototype.toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/toString) on MDN.\n\n## Examples\n\n```rescript\nInt32Array.fromArray([1, 2])->TypedArray.toString == \"1,2\"\n```\n" + }, "insertText": "->TypedArray.toString", - "additionalTextEdits": [{ - "range": {"start": {"line": 5, "character": 17}, "end": {"line": 5, "character": 18}}, - "newText": "" - }] - }, { - "label": "->TypedArray.setArrayFrom", "kind": 12, - "tags": [], + "label": "->TypedArray.toString", + "sortText": "toString", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 18, "line": 5 }, + "start": { "character": 17, "line": 5 } + } + } + ], "detail": "(t<'a>, array<'a>, int) => unit", - "documentation": {"kind": "markdown", "value": "\n`setArrayFrom(target, source, index)` copies `source` into `target` starting at `index`.\n\nSee [`TypedArray.prototype.set`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/set) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([0, 0, 0])\nTypedArray.setArrayFrom(view, [5, 6], 1)\nTypedArray.toString(view) == \"0,5,6\"\n```\n"}, - "sortText": "setArrayFrom", + "documentation": { + "kind": "markdown", + "value": "\n`setArrayFrom(target, source, index)` copies `source` into `target` starting at `index`.\n\nSee [`TypedArray.prototype.set`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/set) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([0, 0, 0])\nTypedArray.setArrayFrom(view, [5, 6], 1)\nTypedArray.toString(view) == \"0,5,6\"\n```\n" + }, "insertText": "->TypedArray.setArrayFrom", - "additionalTextEdits": [{ - "range": {"start": {"line": 5, "character": 17}, "end": {"line": 5, "character": 18}}, - "newText": "" - }] - }, { - "label": "->TypedArray.forEach", "kind": 12, - "tags": [], + "label": "->TypedArray.setArrayFrom", + "sortText": "setArrayFrom", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 18, "line": 5 }, + "start": { "character": 17, "line": 5 } + } + } + ], "detail": "(t<'a>, 'a => unit) => unit", - "documentation": {"kind": "markdown", "value": "\n`forEach(typedArray, f)` runs `f` for every element in order.\n\nSee [`TypedArray.prototype.forEach`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/forEach) on MDN.\n"}, - "sortText": "forEach", + "documentation": { + "kind": "markdown", + "value": "\n`forEach(typedArray, f)` runs `f` for every element in order.\n\nSee [`TypedArray.prototype.forEach`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/forEach) on MDN.\n" + }, "insertText": "->TypedArray.forEach", - "additionalTextEdits": [{ - "range": {"start": {"line": 5, "character": 17}, "end": {"line": 5, "character": 18}}, - "newText": "" - }] - }, { - "label": "->TypedArray.findWithIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.forEach", + "sortText": "forEach", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 18, "line": 5 }, + "start": { "character": 17, "line": 5 } + } + } + ], "detail": "(t<'a>, ('a, int) => bool) => option<'a>", - "documentation": {"kind": "markdown", "value": "\n`findWithIndex(typedArray, predicate)` behaves like `find`, but `predicate` also receives the index.\n"}, - "sortText": "findWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`findWithIndex(typedArray, predicate)` behaves like `find`, but `predicate` also receives the index.\n" + }, "insertText": "->TypedArray.findWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 5, "character": 17}, "end": {"line": 5, "character": 18}}, - "newText": "" - }] - }, { - "label": "->TypedArray.fill", "kind": 12, - "tags": [], + "label": "->TypedArray.findWithIndex", + "sortText": "findWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 18, "line": 5 }, + "start": { "character": 17, "line": 5 } + } + } + ], "detail": "(t<'a>, 'a, ~start: int, ~end: int=?) => t<'a>", - "documentation": {"kind": "markdown", "value": "\n`fill(typedArray, value, ~start, ~end)` fills the half-open interval `[start, end)` with `value`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.fill`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/fill) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3, 4])\nlet _ = TypedArray.fill(view, 0, ~start=1, ~end=3)\nTypedArray.toString(view) == \"1,0,0,4\"\n```\n"}, - "sortText": "fill", + "documentation": { + "kind": "markdown", + "value": "\n`fill(typedArray, value, ~start, ~end)` fills the half-open interval `[start, end)` with `value`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.fill`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/fill) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3, 4])\nlet _ = TypedArray.fill(view, 0, ~start=1, ~end=3)\nTypedArray.toString(view) == \"1,0,0,4\"\n```\n" + }, "insertText": "->TypedArray.fill", - "additionalTextEdits": [{ - "range": {"start": {"line": 5, "character": 17}, "end": {"line": 5, "character": 18}}, - "newText": "" - }] - }, { - "label": "->TypedArray.indexOfFrom", "kind": 12, - "tags": [], + "label": "->TypedArray.fill", + "sortText": "fill", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 18, "line": 5 }, + "start": { "character": 17, "line": 5 } + } + } + ], "detail": "(t<'a>, 'a, int) => int", - "documentation": {"kind": "markdown", "value": "\n`indexOfFrom(typedArray, value, fromIndex)` searches for `value` starting at `fromIndex`.\n"}, - "sortText": "indexOfFrom", + "documentation": { + "kind": "markdown", + "value": "\n`indexOfFrom(typedArray, value, fromIndex)` searches for `value` starting at `fromIndex`.\n" + }, "insertText": "->TypedArray.indexOfFrom", - "additionalTextEdits": [{ - "range": {"start": {"line": 5, "character": 17}, "end": {"line": 5, "character": 18}}, - "newText": "" - }] - }, { - "label": "->TypedArray.reverse", "kind": 12, - "tags": [], + "label": "->TypedArray.indexOfFrom", + "sortText": "indexOfFrom", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 18, "line": 5 }, + "start": { "character": 17, "line": 5 } + } + } + ], "detail": "t<'a> => unit", - "documentation": {"kind": "markdown", "value": "\n`reverse(typedArray)` reverses the elements of the view in place.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.reverse`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/reverse) on MDN.\n"}, - "sortText": "reverse", + "documentation": { + "kind": "markdown", + "value": "\n`reverse(typedArray)` reverses the elements of the view in place.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.reverse`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/reverse) on MDN.\n" + }, "insertText": "->TypedArray.reverse", - "additionalTextEdits": [{ - "range": {"start": {"line": 5, "character": 17}, "end": {"line": 5, "character": 18}}, - "newText": "" - }] - }, { - "label": "->TypedArray.byteOffset", "kind": 12, - "tags": [], + "label": "->TypedArray.reverse", + "sortText": "reverse", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 18, "line": 5 }, + "start": { "character": 17, "line": 5 } + } + } + ], "detail": "t<'a> => int", - "documentation": {"kind": "markdown", "value": "\n`byteOffset(typedArray)` returns the offset in bytes from the start of the buffer.\n\nSee [`TypedArray.prototype.byteOffset`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/byteOffset) on MDN.\n"}, - "sortText": "byteOffset", + "documentation": { + "kind": "markdown", + "value": "\n`byteOffset(typedArray)` returns the offset in bytes from the start of the buffer.\n\nSee [`TypedArray.prototype.byteOffset`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/byteOffset) on MDN.\n" + }, "insertText": "->TypedArray.byteOffset", - "additionalTextEdits": [{ - "range": {"start": {"line": 5, "character": 17}, "end": {"line": 5, "character": 18}}, - "newText": "" - }] - }] + "kind": 12, + "label": "->TypedArray.byteOffset", + "sortText": "byteOffset", + "tags": [] + } +] Complete src/CompletionTypedArrays.res 9:16 posCursor:[9:16] posNoWhite:[9:15] Found expr:[9:3->9:16] @@ -1394,679 +2412,1188 @@ CPPipe pathFromEnv:Stdlib.Float32Array found:false Path Stdlib.Float32Array. Path Stdlib.TypedArray. Path -[{ - "label": "->Float32Array.ignore", - "kind": 12, - "tags": [], +[ + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 9 }, + "start": { "character": 15, "line": 9 } + } + } + ], "detail": "t => unit", - "documentation": {"kind": "markdown", "value": "\n `ignore(floatArray)` ignores the provided floatArray and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further.\n"}, - "sortText": "ignore", + "documentation": { + "kind": "markdown", + "value": "\n `ignore(floatArray)` ignores the provided floatArray and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further.\n" + }, "insertText": "->Float32Array.ignore", - "additionalTextEdits": [{ - "range": {"start": {"line": 9, "character": 15}, "end": {"line": 9, "character": 16}}, - "newText": "" - }] - }, { - "label": "->TypedArray.findLastIndexWithIndex", "kind": 12, - "tags": [], + "label": "->Float32Array.ignore", + "sortText": "ignore", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 9 }, + "start": { "character": 15, "line": 9 } + } + } + ], "detail": "(t<'a>, ('a, int) => bool) => int", - "documentation": {"kind": "markdown", "value": "\n`findLastIndexWithIndex(typedArray, predicate)` is the indexed variant of `findLastIndex`.\n"}, - "sortText": "findLastIndexWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`findLastIndexWithIndex(typedArray, predicate)` is the indexed variant of `findLastIndex`.\n" + }, "insertText": "->TypedArray.findLastIndexWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 9, "character": 15}, "end": {"line": 9, "character": 16}}, - "newText": "" - }] - }, { - "label": "->TypedArray.lastIndexOf", "kind": 12, - "tags": [], + "label": "->TypedArray.findLastIndexWithIndex", + "sortText": "findLastIndexWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 9 }, + "start": { "character": 15, "line": 9 } + } + } + ], "detail": "(t<'a>, 'a) => int", - "documentation": {"kind": "markdown", "value": "\n`lastIndexOf(typedArray, value)` returns the last index of `value`, or `-1` if not found.\n\nSee [`TypedArray.prototype.lastIndexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/lastIndexOf) on MDN.\n"}, - "sortText": "lastIndexOf", + "documentation": { + "kind": "markdown", + "value": "\n`lastIndexOf(typedArray, value)` returns the last index of `value`, or `-1` if not found.\n\nSee [`TypedArray.prototype.lastIndexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/lastIndexOf) on MDN.\n" + }, "insertText": "->TypedArray.lastIndexOf", - "additionalTextEdits": [{ - "range": {"start": {"line": 9, "character": 15}, "end": {"line": 9, "character": 16}}, - "newText": "" - }] - }, { - "label": "->TypedArray.findLastWithIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.lastIndexOf", + "sortText": "lastIndexOf", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 9 }, + "start": { "character": 15, "line": 9 } + } + } + ], "detail": "(t<'a>, ('a, int) => bool) => option<'a>", - "documentation": {"kind": "markdown", "value": "\n`findLastWithIndex(typedArray, predicate)` is the indexed variant of `findLast`.\n"}, - "sortText": "findLastWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`findLastWithIndex(typedArray, predicate)` is the indexed variant of `findLast`.\n" + }, "insertText": "->TypedArray.findLastWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 9, "character": 15}, "end": {"line": 9, "character": 16}}, - "newText": "" - }] - }, { - "label": "->TypedArray.findLast", "kind": 12, - "tags": [], + "label": "->TypedArray.findLastWithIndex", + "sortText": "findLastWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 9 }, + "start": { "character": 15, "line": 9 } + } + } + ], "detail": "(t<'a>, 'a => bool) => option<'a>", - "documentation": {"kind": "markdown", "value": "\n`findLast(typedArray, predicate)` returns the last element that satisfies `predicate`.\n\nSee [`TypedArray.prototype.findLast`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/findLast) on MDN.\n"}, - "sortText": "findLast", + "documentation": { + "kind": "markdown", + "value": "\n`findLast(typedArray, predicate)` returns the last element that satisfies `predicate`.\n\nSee [`TypedArray.prototype.findLast`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/findLast) on MDN.\n" + }, "insertText": "->TypedArray.findLast", - "additionalTextEdits": [{ - "range": {"start": {"line": 9, "character": 15}, "end": {"line": 9, "character": 16}}, - "newText": "" - }] - }, { - "label": "->TypedArray.filter", "kind": 12, - "tags": [], + "label": "->TypedArray.findLast", + "sortText": "findLast", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 9 }, + "start": { "character": 15, "line": 9 } + } + } + ], "detail": "(t<'a>, 'a => bool) => t<'a>", - "documentation": {"kind": "markdown", "value": "\n`filter(typedArray, predicate)` returns a new typed array containing only elements that satisfy `predicate`.\n\nSee [`TypedArray.prototype.filter`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/filter) on MDN.\n"}, - "sortText": "filter", + "documentation": { + "kind": "markdown", + "value": "\n`filter(typedArray, predicate)` returns a new typed array containing only elements that satisfy `predicate`.\n\nSee [`TypedArray.prototype.filter`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/filter) on MDN.\n" + }, "insertText": "->TypedArray.filter", - "additionalTextEdits": [{ - "range": {"start": {"line": 9, "character": 15}, "end": {"line": 9, "character": 16}}, - "newText": "" - }] - }, { - "label": "->TypedArray.byteLength", "kind": 12, - "tags": [], + "label": "->TypedArray.filter", + "sortText": "filter", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 9 }, + "start": { "character": 15, "line": 9 } + } + } + ], "detail": "t<'a> => int", - "documentation": {"kind": "markdown", "value": "\n`byteLength(typedArray)` returns the length in bytes of the view.\n\nSee [`TypedArray.prototype.byteLength`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/byteLength) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2])\nTypedArray.byteLength(view) == 8\n```\n"}, - "sortText": "byteLength", + "documentation": { + "kind": "markdown", + "value": "\n`byteLength(typedArray)` returns the length in bytes of the view.\n\nSee [`TypedArray.prototype.byteLength`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/byteLength) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2])\nTypedArray.byteLength(view) == 8\n```\n" + }, "insertText": "->TypedArray.byteLength", - "additionalTextEdits": [{ - "range": {"start": {"line": 9, "character": 15}, "end": {"line": 9, "character": 16}}, - "newText": "" - }] - }, { - "label": "->TypedArray.ignore", "kind": 12, - "tags": [], + "label": "->TypedArray.byteLength", + "sortText": "byteLength", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 9 }, + "start": { "character": 15, "line": 9 } + } + } + ], "detail": "t<'a> => unit", - "documentation": {"kind": "markdown", "value": "\n `ignore(typedArray)` ignores the provided typedArray and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further.\n"}, - "sortText": "ignore", + "documentation": { + "kind": "markdown", + "value": "\n `ignore(typedArray)` ignores the provided typedArray and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further.\n" + }, "insertText": "->TypedArray.ignore", - "additionalTextEdits": [{ - "range": {"start": {"line": 9, "character": 15}, "end": {"line": 9, "character": 16}}, - "newText": "" - }] - }, { - "label": "->TypedArray.reduceRightWithIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.ignore", + "sortText": "ignore", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 9 }, + "start": { "character": 15, "line": 9 } + } + } + ], "detail": "(t<'a>, ('b, 'a, int) => 'b, 'b) => 'b", - "documentation": {"kind": "markdown", "value": "\n`reduceRightWithIndex(typedArray, reducer, initial)` is the indexed variant of `reduceRight`.\n"}, - "sortText": "reduceRightWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`reduceRightWithIndex(typedArray, reducer, initial)` is the indexed variant of `reduceRight`.\n" + }, "insertText": "->TypedArray.reduceRightWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 9, "character": 15}, "end": {"line": 9, "character": 16}}, - "newText": "" - }] - }, { - "label": "->TypedArray.reduceRight", "kind": 12, - "tags": [], + "label": "->TypedArray.reduceRightWithIndex", + "sortText": "reduceRightWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 9 }, + "start": { "character": 15, "line": 9 } + } + } + ], "detail": "(t<'a>, ('b, 'a) => 'b, 'b) => 'b", - "documentation": {"kind": "markdown", "value": "\n`reduceRight(typedArray, reducer, initial)` is like `reduce` but processes the elements from right to left.\n\nSee [`TypedArray.prototype.reduceRight`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/reduceRight) on MDN.\n"}, - "sortText": "reduceRight", + "documentation": { + "kind": "markdown", + "value": "\n`reduceRight(typedArray, reducer, initial)` is like `reduce` but processes the elements from right to left.\n\nSee [`TypedArray.prototype.reduceRight`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/reduceRight) on MDN.\n" + }, "insertText": "->TypedArray.reduceRight", - "additionalTextEdits": [{ - "range": {"start": {"line": 9, "character": 15}, "end": {"line": 9, "character": 16}}, - "newText": "" - }] - }, { - "label": "->TypedArray.joinWith", "kind": 12, - "tags": [], + "label": "->TypedArray.reduceRight", + "sortText": "reduceRight", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 9 }, + "start": { "character": 15, "line": 9 } + } + } + ], "detail": "(t<'a>, string) => string", - "documentation": {"kind": "markdown", "value": "\n`joinWith(typedArray, separator)` returns a string formed by the elements joined with `separator`.\n\nSee [`TypedArray.prototype.join`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/join) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nTypedArray.joinWith(view, \"-\") == \"1-2-3\"\n```\n"}, - "sortText": "joinWith", + "documentation": { + "kind": "markdown", + "value": "\n`joinWith(typedArray, separator)` returns a string formed by the elements joined with `separator`.\n\nSee [`TypedArray.prototype.join`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/join) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nTypedArray.joinWith(view, \"-\") == \"1-2-3\"\n```\n" + }, "insertText": "->TypedArray.joinWith", - "additionalTextEdits": [{ - "range": {"start": {"line": 9, "character": 15}, "end": {"line": 9, "character": 16}}, - "newText": "" - }] - }, { - "label": "->TypedArray.buffer", "kind": 12, - "tags": [], + "label": "->TypedArray.joinWith", + "sortText": "joinWith", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 9 }, + "start": { "character": 15, "line": 9 } + } + } + ], "detail": "t<'a> => ArrayBuffer.t", - "documentation": {"kind": "markdown", "value": "\n`buffer(typedArray)` returns the underlying `ArrayBuffer` backing this view.\n\nSee [`TypedArray.prototype.buffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/buffer) on MDN.\n"}, - "sortText": "buffer", + "documentation": { + "kind": "markdown", + "value": "\n`buffer(typedArray)` returns the underlying `ArrayBuffer` backing this view.\n\nSee [`TypedArray.prototype.buffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/buffer) on MDN.\n" + }, "insertText": "->TypedArray.buffer", - "additionalTextEdits": [{ - "range": {"start": {"line": 9, "character": 15}, "end": {"line": 9, "character": 16}}, - "newText": "" - }] - }, { - "label": "->TypedArray.reduce", "kind": 12, - "tags": [], + "label": "->TypedArray.buffer", + "sortText": "buffer", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 9 }, + "start": { "character": 15, "line": 9 } + } + } + ], "detail": "(t<'a>, ('b, 'a) => 'b, 'b) => 'b", - "documentation": {"kind": "markdown", "value": "\n`reduce(typedArray, reducer, initial)` combines the elements from left to right using `reducer`.\n\nSee [`TypedArray.prototype.reduce`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/reduce) on MDN.\n"}, - "sortText": "reduce", + "documentation": { + "kind": "markdown", + "value": "\n`reduce(typedArray, reducer, initial)` combines the elements from left to right using `reducer`.\n\nSee [`TypedArray.prototype.reduce`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/reduce) on MDN.\n" + }, "insertText": "->TypedArray.reduce", - "additionalTextEdits": [{ - "range": {"start": {"line": 9, "character": 15}, "end": {"line": 9, "character": 16}}, - "newText": "" - }] - }, { - "label": "->TypedArray.forEachWithIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.reduce", + "sortText": "reduce", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 9 }, + "start": { "character": 15, "line": 9 } + } + } + ], "detail": "(t<'a>, ('a, int) => unit) => unit", - "documentation": {"kind": "markdown", "value": "\n`forEachWithIndex(typedArray, f)` runs `f` for every element, also providing the index.\n"}, - "sortText": "forEachWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`forEachWithIndex(typedArray, f)` runs `f` for every element, also providing the index.\n" + }, "insertText": "->TypedArray.forEachWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 9, "character": 15}, "end": {"line": 9, "character": 16}}, - "newText": "" - }] - }, { - "label": "->TypedArray.copy", "kind": 12, - "tags": [], + "label": "->TypedArray.forEachWithIndex", + "sortText": "forEachWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 9 }, + "start": { "character": 15, "line": 9 } + } + } + ], "detail": "t<'a> => t<'a>", - "documentation": {"kind": "markdown", "value": "\n`copy(typedArray)` produces a shallow copy of the typed array.\n"}, - "sortText": "copy", + "documentation": { + "kind": "markdown", + "value": "\n`copy(typedArray)` produces a shallow copy of the typed array.\n" + }, "insertText": "->TypedArray.copy", - "additionalTextEdits": [{ - "range": {"start": {"line": 9, "character": 15}, "end": {"line": 9, "character": 16}}, - "newText": "" - }] - }, { - "label": "->TypedArray.someWithIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.copy", + "sortText": "copy", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 9 }, + "start": { "character": 15, "line": 9 } + } + } + ], "detail": "(t<'a>, ('a, int) => bool) => bool", - "documentation": {"kind": "markdown", "value": "\n`someWithIndex(typedArray, predicate)` behaves like `some`, but `predicate` also receives the element index.\n"}, - "sortText": "someWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`someWithIndex(typedArray, predicate)` behaves like `some`, but `predicate` also receives the element index.\n" + }, "insertText": "->TypedArray.someWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 9, "character": 15}, "end": {"line": 9, "character": 16}}, - "newText": "" - }] - }, { - "label": "->TypedArray.findIndexWithIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.someWithIndex", + "sortText": "someWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 9 }, + "start": { "character": 15, "line": 9 } + } + } + ], "detail": "(t<'a>, ('a, int) => bool) => int", - "documentation": {"kind": "markdown", "value": "\n`findIndexWithIndex(typedArray, predicate)` is the indexed variant of `findIndex`.\n"}, - "sortText": "findIndexWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`findIndexWithIndex(typedArray, predicate)` is the indexed variant of `findIndex`.\n" + }, "insertText": "->TypedArray.findIndexWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 9, "character": 15}, "end": {"line": 9, "character": 16}}, - "newText": "" - }] - }, { - "label": "->TypedArray.sliceToEnd", "kind": 12, - "tags": [1], + "label": "->TypedArray.findIndexWithIndex", + "sortText": "findIndexWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 9 }, + "start": { "character": 15, "line": 9 } + } + } + ], + "deprecated": true, "detail": "(t<'a>, ~start: int) => t<'a>", - "documentation": {"kind": "markdown", "value": "Deprecated: Use `slice` instead\n\n\n`sliceToEnd(typedArray, ~start)` returns the elements from `start` through the end in a new typed array.\n"}, - "sortText": "sliceToEnd", + "documentation": { + "kind": "markdown", + "value": "Deprecated: Use `slice` instead\n\n\n`sliceToEnd(typedArray, ~start)` returns the elements from `start` through the end in a new typed array.\n" + }, "insertText": "->TypedArray.sliceToEnd", - "additionalTextEdits": [{ - "range": {"start": {"line": 9, "character": 15}, "end": {"line": 9, "character": 16}}, - "newText": "" - }] - }, { - "label": "->TypedArray.slice", "kind": 12, - "tags": [], + "label": "->TypedArray.sliceToEnd", + "sortText": "sliceToEnd", + "tags": [ 1 ] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 9 }, + "start": { "character": 15, "line": 9 } + } + } + ], "detail": "(t<'a>, ~start: int, ~end: int=?) => t<'a>", - "documentation": {"kind": "markdown", "value": "\n`slice(typedArray, ~start, ~end)` returns a new typed array containing the elements in `[start, end)`.\n\nSee [`TypedArray.prototype.slice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/slice) on MDN.\n"}, - "sortText": "slice", + "documentation": { + "kind": "markdown", + "value": "\n`slice(typedArray, ~start, ~end)` returns a new typed array containing the elements in `[start, end)`.\n\nSee [`TypedArray.prototype.slice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/slice) on MDN.\n" + }, "insertText": "->TypedArray.slice", - "additionalTextEdits": [{ - "range": {"start": {"line": 9, "character": 15}, "end": {"line": 9, "character": 16}}, - "newText": "" - }] - }, { - "label": "->TypedArray.findLastIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.slice", + "sortText": "slice", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 9 }, + "start": { "character": 15, "line": 9 } + } + } + ], "detail": "(t<'a>, 'a => bool) => int", - "documentation": {"kind": "markdown", "value": "\n`findLastIndex(typedArray, predicate)` returns the index of the last matching element, or `-1` if none do.\n\nSee [`TypedArray.prototype.findLastIndex`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/findLastIndex) on MDN.\n"}, - "sortText": "findLastIndex", + "documentation": { + "kind": "markdown", + "value": "\n`findLastIndex(typedArray, predicate)` returns the index of the last matching element, or `-1` if none do.\n\nSee [`TypedArray.prototype.findLastIndex`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/findLastIndex) on MDN.\n" + }, "insertText": "->TypedArray.findLastIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 9, "character": 15}, "end": {"line": 9, "character": 16}}, - "newText": "" - }] - }, { - "label": "->TypedArray.includes", "kind": 12, - "tags": [], + "label": "->TypedArray.findLastIndex", + "sortText": "findLastIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 9 }, + "start": { "character": 15, "line": 9 } + } + } + ], "detail": "(t<'a>, 'a) => bool", - "documentation": {"kind": "markdown", "value": "\n`includes(typedArray, value)` returns `true` if `value` occurs in the typed array.\n\nSee [`TypedArray.prototype.includes`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/includes) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nTypedArray.includes(view, 2) == true\nTypedArray.includes(view, 10) == false\n```\n"}, - "sortText": "includes", + "documentation": { + "kind": "markdown", + "value": "\n`includes(typedArray, value)` returns `true` if `value` occurs in the typed array.\n\nSee [`TypedArray.prototype.includes`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/includes) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nTypedArray.includes(view, 2) == true\nTypedArray.includes(view, 10) == false\n```\n" + }, "insertText": "->TypedArray.includes", - "additionalTextEdits": [{ - "range": {"start": {"line": 9, "character": 15}, "end": {"line": 9, "character": 16}}, - "newText": "" - }] - }, { - "label": "->TypedArray.fillToEnd", "kind": 12, - "tags": [1], + "label": "->TypedArray.includes", + "sortText": "includes", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 9 }, + "start": { "character": 15, "line": 9 } + } + } + ], + "deprecated": true, "detail": "(t<'a>, 'a, ~start: int) => t<'a>", - "documentation": {"kind": "markdown", "value": "Deprecated: Use `fill` instead\n\n\n`fillToEnd(typedArray, value, ~start)` fills from `start` through the end with `value`.\n\nBeware this will *mutate* the typed array.\n"}, - "sortText": "fillToEnd", + "documentation": { + "kind": "markdown", + "value": "Deprecated: Use `fill` instead\n\n\n`fillToEnd(typedArray, value, ~start)` fills from `start` through the end with `value`.\n\nBeware this will *mutate* the typed array.\n" + }, "insertText": "->TypedArray.fillToEnd", - "additionalTextEdits": [{ - "range": {"start": {"line": 9, "character": 15}, "end": {"line": 9, "character": 16}}, - "newText": "" - }] - }, { - "label": "->TypedArray.fillAll", "kind": 12, - "tags": [], + "label": "->TypedArray.fillToEnd", + "sortText": "fillToEnd", + "tags": [ 1 ] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 9 }, + "start": { "character": 15, "line": 9 } + } + } + ], "detail": "(t<'a>, 'a) => t<'a>", - "documentation": {"kind": "markdown", "value": "\n`fillAll(typedArray, value)` fills every element with `value`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.fill`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/fill) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nlet _ = TypedArray.fillAll(view, 9)\nTypedArray.toString(view) == \"9,9,9\"\n```\n"}, - "sortText": "fillAll", + "documentation": { + "kind": "markdown", + "value": "\n`fillAll(typedArray, value)` fills every element with `value`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.fill`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/fill) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nlet _ = TypedArray.fillAll(view, 9)\nTypedArray.toString(view) == \"9,9,9\"\n```\n" + }, "insertText": "->TypedArray.fillAll", - "additionalTextEdits": [{ - "range": {"start": {"line": 9, "character": 15}, "end": {"line": 9, "character": 16}}, - "newText": "" - }] - }, { - "label": "->TypedArray.find", "kind": 12, - "tags": [], + "label": "->TypedArray.fillAll", + "sortText": "fillAll", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 9 }, + "start": { "character": 15, "line": 9 } + } + } + ], "detail": "(t<'a>, 'a => bool) => option<'a>", - "documentation": {"kind": "markdown", "value": "\n`find(typedArray, predicate)` returns the first element that satisfies `predicate`, or `None` if nothing matches.\n\nSee [`TypedArray.prototype.find`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/find) on MDN.\n"}, - "sortText": "find", + "documentation": { + "kind": "markdown", + "value": "\n`find(typedArray, predicate)` returns the first element that satisfies `predicate`, or `None` if nothing matches.\n\nSee [`TypedArray.prototype.find`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/find) on MDN.\n" + }, "insertText": "->TypedArray.find", - "additionalTextEdits": [{ - "range": {"start": {"line": 9, "character": 15}, "end": {"line": 9, "character": 16}}, - "newText": "" - }] - }, { - "label": "->TypedArray.subarrayToEnd", "kind": 12, - "tags": [1], + "label": "->TypedArray.find", + "sortText": "find", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 9 }, + "start": { "character": 15, "line": 9 } + } + } + ], + "deprecated": true, "detail": "(t<'a>, ~start: int) => t<'a>", - "documentation": {"kind": "markdown", "value": "Deprecated: Use `subarray` instead\n\n\n`subarrayToEnd(typedArray, ~start)` returns a new view from `start` to the end of the buffer.\n"}, - "sortText": "subarrayToEnd", + "documentation": { + "kind": "markdown", + "value": "Deprecated: Use `subarray` instead\n\n\n`subarrayToEnd(typedArray, ~start)` returns a new view from `start` to the end of the buffer.\n" + }, "insertText": "->TypedArray.subarrayToEnd", - "additionalTextEdits": [{ - "range": {"start": {"line": 9, "character": 15}, "end": {"line": 9, "character": 16}}, - "newText": "" - }] - }, { - "label": "->TypedArray.set", "kind": 12, - "tags": [], + "label": "->TypedArray.subarrayToEnd", + "sortText": "subarrayToEnd", + "tags": [ 1 ] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 9 }, + "start": { "character": 15, "line": 9 } + } + } + ], "detail": "(t<'a>, int, 'a) => unit", - "documentation": {"kind": "markdown", "value": "\n`set(typedArray, index, item)` sets the provided `item` at `index` of `typedArray`.\n\nBeware this will *mutate* the array.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2])\nTypedArray.set(view, 1, 5)\nTypedArray.get(view, 1) == Some(5)\n```\n"}, - "sortText": "set", + "documentation": { + "kind": "markdown", + "value": "\n`set(typedArray, index, item)` sets the provided `item` at `index` of `typedArray`.\n\nBeware this will *mutate* the array.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2])\nTypedArray.set(view, 1, 5)\nTypedArray.get(view, 1) == Some(5)\n```\n" + }, "insertText": "->TypedArray.set", - "additionalTextEdits": [{ - "range": {"start": {"line": 9, "character": 15}, "end": {"line": 9, "character": 16}}, - "newText": "" - }] - }, { - "label": "->TypedArray.toLocaleString", "kind": 12, - "tags": [], + "label": "->TypedArray.set", + "sortText": "set", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 9 }, + "start": { "character": 15, "line": 9 } + } + } + ], "detail": "t<'a> => string", - "documentation": {"kind": "markdown", "value": "\n`toLocaleString(typedArray)` concatenates the elements using locale-aware formatting.\n\nSee [`TypedArray.prototype.toLocaleString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/toLocaleString) on MDN.\n"}, - "sortText": "toLocaleString", + "documentation": { + "kind": "markdown", + "value": "\n`toLocaleString(typedArray)` concatenates the elements using locale-aware formatting.\n\nSee [`TypedArray.prototype.toLocaleString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/toLocaleString) on MDN.\n" + }, "insertText": "->TypedArray.toLocaleString", - "additionalTextEdits": [{ - "range": {"start": {"line": 9, "character": 15}, "end": {"line": 9, "character": 16}}, - "newText": "" - }] - }, { - "label": "->TypedArray.lastIndexOfFrom", "kind": 12, - "tags": [], + "label": "->TypedArray.toLocaleString", + "sortText": "toLocaleString", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 9 }, + "start": { "character": 15, "line": 9 } + } + } + ], "detail": "(t<'a>, 'a, int) => int", - "documentation": {"kind": "markdown", "value": "\n`lastIndexOfFrom(typedArray, value, fromIndex)` searches backwards starting at `fromIndex`.\n"}, - "sortText": "lastIndexOfFrom", + "documentation": { + "kind": "markdown", + "value": "\n`lastIndexOfFrom(typedArray, value, fromIndex)` searches backwards starting at `fromIndex`.\n" + }, "insertText": "->TypedArray.lastIndexOfFrom", - "additionalTextEdits": [{ - "range": {"start": {"line": 9, "character": 15}, "end": {"line": 9, "character": 16}}, - "newText": "" - }] - }, { - "label": "->TypedArray.findIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.lastIndexOfFrom", + "sortText": "lastIndexOfFrom", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 9 }, + "start": { "character": 15, "line": 9 } + } + } + ], "detail": "(t<'a>, 'a => bool) => int", - "documentation": {"kind": "markdown", "value": "\n`findIndex(typedArray, predicate)` returns the index of the first element that satisfies `predicate`, or `-1` if none do.\n\nSee [`TypedArray.prototype.findIndex`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/findIndex) on MDN.\n"}, - "sortText": "findIndex", + "documentation": { + "kind": "markdown", + "value": "\n`findIndex(typedArray, predicate)` returns the index of the first element that satisfies `predicate`, or `-1` if none do.\n\nSee [`TypedArray.prototype.findIndex`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/findIndex) on MDN.\n" + }, "insertText": "->TypedArray.findIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 9, "character": 15}, "end": {"line": 9, "character": 16}}, - "newText": "" - }] - }, { - "label": "->TypedArray.filterWithIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.findIndex", + "sortText": "findIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 9 }, + "start": { "character": 15, "line": 9 } + } + } + ], "detail": "(t<'a>, ('a, int) => bool) => t<'a>", - "documentation": {"kind": "markdown", "value": "\n`filterWithIndex(typedArray, predicate)` behaves like `filter` but also passes the index to `predicate`.\n"}, - "sortText": "filterWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`filterWithIndex(typedArray, predicate)` behaves like `filter` but also passes the index to `predicate`.\n" + }, "insertText": "->TypedArray.filterWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 9, "character": 15}, "end": {"line": 9, "character": 16}}, - "newText": "" - }] - }, { - "label": "->TypedArray.sort", "kind": 12, - "tags": [], + "label": "->TypedArray.filterWithIndex", + "sortText": "filterWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 9 }, + "start": { "character": 15, "line": 9 } + } + } + ], "detail": "(t<'a>, ('a, 'a) => Ordering.t) => unit", - "documentation": {"kind": "markdown", "value": "\n`sort(typedArray, comparator)` sorts the values in place using `comparator`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.sort`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/sort) on MDN.\n"}, - "sortText": "sort", + "documentation": { + "kind": "markdown", + "value": "\n`sort(typedArray, comparator)` sorts the values in place using `comparator`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.sort`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/sort) on MDN.\n" + }, "insertText": "->TypedArray.sort", - "additionalTextEdits": [{ - "range": {"start": {"line": 9, "character": 15}, "end": {"line": 9, "character": 16}}, - "newText": "" - }] - }, { - "label": "->TypedArray.mapWithIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.sort", + "sortText": "sort", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 9 }, + "start": { "character": 15, "line": 9 } + } + } + ], "detail": "(t<'a>, ('a, int) => 'b) => t<'b>", - "documentation": {"kind": "markdown", "value": "\n`mapWithIndex(typedArray, f)` behaves like `map`, but `f` also receives the index.\n"}, - "sortText": "mapWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`mapWithIndex(typedArray, f)` behaves like `map`, but `f` also receives the index.\n" + }, "insertText": "->TypedArray.mapWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 9, "character": 15}, "end": {"line": 9, "character": 16}}, - "newText": "" - }] - }, { - "label": "->TypedArray.every", "kind": 12, - "tags": [], + "label": "->TypedArray.mapWithIndex", + "sortText": "mapWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 9 }, + "start": { "character": 15, "line": 9 } + } + } + ], "detail": "(t<'a>, 'a => bool) => bool", - "documentation": {"kind": "markdown", "value": "\n`every(typedArray, predicate)` returns `true` if `predicate` returns `true` for every element.\n\nSee [`TypedArray.prototype.every`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/every) on MDN.\n"}, - "sortText": "every", + "documentation": { + "kind": "markdown", + "value": "\n`every(typedArray, predicate)` returns `true` if `predicate` returns `true` for every element.\n\nSee [`TypedArray.prototype.every`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/every) on MDN.\n" + }, "insertText": "->TypedArray.every", - "additionalTextEdits": [{ - "range": {"start": {"line": 9, "character": 15}, "end": {"line": 9, "character": 16}}, - "newText": "" - }] - }, { - "label": "->TypedArray.length", "kind": 12, - "tags": [], + "label": "->TypedArray.every", + "sortText": "every", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 9 }, + "start": { "character": 15, "line": 9 } + } + } + ], "detail": "t<'a> => int", - "documentation": {"kind": "markdown", "value": "\n`length(typedArray)` returns the number of elements.\n\nSee [`TypedArray.prototype.length`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/length) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nTypedArray.length(view) == 3\n```\n"}, - "sortText": "length", + "documentation": { + "kind": "markdown", + "value": "\n`length(typedArray)` returns the number of elements.\n\nSee [`TypedArray.prototype.length`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/length) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nTypedArray.length(view) == 3\n```\n" + }, "insertText": "->TypedArray.length", - "additionalTextEdits": [{ - "range": {"start": {"line": 9, "character": 15}, "end": {"line": 9, "character": 16}}, - "newText": "" - }] - }, { - "label": "->TypedArray.indexOf", "kind": 12, - "tags": [], + "label": "->TypedArray.length", + "sortText": "length", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 9 }, + "start": { "character": 15, "line": 9 } + } + } + ], "detail": "(t<'a>, 'a) => int", - "documentation": {"kind": "markdown", "value": "\n`indexOf(typedArray, value)` returns the first index of `value`, or `-1` when not found.\n\nSee [`TypedArray.prototype.indexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/indexOf) on MDN.\n"}, - "sortText": "indexOf", + "documentation": { + "kind": "markdown", + "value": "\n`indexOf(typedArray, value)` returns the first index of `value`, or `-1` when not found.\n\nSee [`TypedArray.prototype.indexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/indexOf) on MDN.\n" + }, "insertText": "->TypedArray.indexOf", - "additionalTextEdits": [{ - "range": {"start": {"line": 9, "character": 15}, "end": {"line": 9, "character": 16}}, - "newText": "" - }] - }, { - "label": "->TypedArray.copyWithinToEnd", "kind": 12, - "tags": [1], + "label": "->TypedArray.indexOf", + "sortText": "indexOf", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 9 }, + "start": { "character": 15, "line": 9 } + } + } + ], + "deprecated": true, "detail": "(t<'a>, ~target: int, ~start: int) => array<'a>", - "documentation": {"kind": "markdown", "value": "Deprecated: Use `copyWithin` instead\n\n\n`copyWithinToEnd(typedArray, ~target, ~start)` copies values from `start` through the end of the view into the range beginning at `target`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.copyWithin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/copyWithin) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3, 4])\nlet _ = TypedArray.copyWithinToEnd(view, ~target=0, ~start=2)\nTypedArray.toString(view) == \"3,4,3,4\"\n```\n"}, - "sortText": "copyWithinToEnd", + "documentation": { + "kind": "markdown", + "value": "Deprecated: Use `copyWithin` instead\n\n\n`copyWithinToEnd(typedArray, ~target, ~start)` copies values from `start` through the end of the view into the range beginning at `target`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.copyWithin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/copyWithin) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3, 4])\nlet _ = TypedArray.copyWithinToEnd(view, ~target=0, ~start=2)\nTypedArray.toString(view) == \"3,4,3,4\"\n```\n" + }, "insertText": "->TypedArray.copyWithinToEnd", - "additionalTextEdits": [{ - "range": {"start": {"line": 9, "character": 15}, "end": {"line": 9, "character": 16}}, - "newText": "" - }] - }, { - "label": "->TypedArray.some", "kind": 12, - "tags": [], + "label": "->TypedArray.copyWithinToEnd", + "sortText": "copyWithinToEnd", + "tags": [ 1 ] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 9 }, + "start": { "character": 15, "line": 9 } + } + } + ], "detail": "(t<'a>, 'a => bool) => bool", - "documentation": {"kind": "markdown", "value": "\n`some(typedArray, predicate)` returns `true` if `predicate` returns `true` for at least one element.\n\nSee [`TypedArray.prototype.some`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/some) on MDN.\n"}, - "sortText": "some", + "documentation": { + "kind": "markdown", + "value": "\n`some(typedArray, predicate)` returns `true` if `predicate` returns `true` for at least one element.\n\nSee [`TypedArray.prototype.some`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/some) on MDN.\n" + }, "insertText": "->TypedArray.some", - "additionalTextEdits": [{ - "range": {"start": {"line": 9, "character": 15}, "end": {"line": 9, "character": 16}}, - "newText": "" - }] - }, { - "label": "->TypedArray.reduceWithIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.some", + "sortText": "some", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 9 }, + "start": { "character": 15, "line": 9 } + } + } + ], "detail": "(t<'a>, ('b, 'a, int) => 'b, 'b) => 'b", - "documentation": {"kind": "markdown", "value": "\n`reduceWithIndex(typedArray, reducer, initial)` is the indexed variant of `reduce`.\n"}, - "sortText": "reduceWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`reduceWithIndex(typedArray, reducer, initial)` is the indexed variant of `reduce`.\n" + }, "insertText": "->TypedArray.reduceWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 9, "character": 15}, "end": {"line": 9, "character": 16}}, - "newText": "" - }] - }, { - "label": "->TypedArray.map", "kind": 12, - "tags": [], + "label": "->TypedArray.reduceWithIndex", + "sortText": "reduceWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 9 }, + "start": { "character": 15, "line": 9 } + } + } + ], "detail": "(t<'a>, 'a => 'b) => t<'b>", - "documentation": {"kind": "markdown", "value": "\n`map(typedArray, f)` returns a new typed array whose elements are produced by applying `f` to each element.\n\nSee [`TypedArray.prototype.map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/map) on MDN.\n"}, - "sortText": "map", + "documentation": { + "kind": "markdown", + "value": "\n`map(typedArray, f)` returns a new typed array whose elements are produced by applying `f` to each element.\n\nSee [`TypedArray.prototype.map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/map) on MDN.\n" + }, "insertText": "->TypedArray.map", - "additionalTextEdits": [{ - "range": {"start": {"line": 9, "character": 15}, "end": {"line": 9, "character": 16}}, - "newText": "" - }] - }, { - "label": "->TypedArray.toSorted", "kind": 12, - "tags": [], + "label": "->TypedArray.map", + "sortText": "map", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 9 }, + "start": { "character": 15, "line": 9 } + } + } + ], "detail": "(t<'a>, ('a, 'a) => Ordering.t) => t<'a>", - "documentation": {"kind": "markdown", "value": "\n`toSorted(typedArray, comparator)` returns a new typed array containing the sorted values, leaving the original untouched.\n\nSee [`TypedArray.prototype.toSorted`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/toSorted) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([3, 1, 2])\nlet sorted = TypedArray.toSorted(view, Int.compare)\nTypedArray.toString(sorted) == \"1,2,3\"\nTypedArray.toString(view) == \"3,1,2\"\n```\n"}, - "sortText": "toSorted", + "documentation": { + "kind": "markdown", + "value": "\n`toSorted(typedArray, comparator)` returns a new typed array containing the sorted values, leaving the original untouched.\n\nSee [`TypedArray.prototype.toSorted`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/toSorted) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([3, 1, 2])\nlet sorted = TypedArray.toSorted(view, Int.compare)\nTypedArray.toString(sorted) == \"1,2,3\"\nTypedArray.toString(view) == \"3,1,2\"\n```\n" + }, "insertText": "->TypedArray.toSorted", - "additionalTextEdits": [{ - "range": {"start": {"line": 9, "character": 15}, "end": {"line": 9, "character": 16}}, - "newText": "" - }] - }, { - "label": "->TypedArray.copyAllWithin", "kind": 12, - "tags": [], + "label": "->TypedArray.toSorted", + "sortText": "toSorted", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 9 }, + "start": { "character": 15, "line": 9 } + } + } + ], "detail": "(t<'a>, ~target: int) => array<'a>", - "documentation": {"kind": "markdown", "value": "\n`copyAllWithin(typedArray, ~target)` copies values starting at index `0` over the positions beginning at `target`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.copyWithin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/copyWithin) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([10, 20, 30])\nlet _ = TypedArray.copyAllWithin(view, ~target=1)\nTypedArray.toString(view) == \"10,10,20\"\n```\n"}, - "sortText": "copyAllWithin", + "documentation": { + "kind": "markdown", + "value": "\n`copyAllWithin(typedArray, ~target)` copies values starting at index `0` over the positions beginning at `target`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.copyWithin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/copyWithin) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([10, 20, 30])\nlet _ = TypedArray.copyAllWithin(view, ~target=1)\nTypedArray.toString(view) == \"10,10,20\"\n```\n" + }, "insertText": "->TypedArray.copyAllWithin", - "additionalTextEdits": [{ - "range": {"start": {"line": 9, "character": 15}, "end": {"line": 9, "character": 16}}, - "newText": "" - }] - }, { - "label": "->TypedArray.subarray", "kind": 12, - "tags": [], + "label": "->TypedArray.copyAllWithin", + "sortText": "copyAllWithin", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 9 }, + "start": { "character": 15, "line": 9 } + } + } + ], "detail": "(t<'a>, ~start: int, ~end: int=?) => t<'a>", - "documentation": {"kind": "markdown", "value": "\n`subarray(typedArray, ~start, ~end)` returns a new view referencing the same buffer over `[start, end)`.\n\nSee [`TypedArray.prototype.subarray`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/subarray) on MDN.\n"}, - "sortText": "subarray", + "documentation": { + "kind": "markdown", + "value": "\n`subarray(typedArray, ~start, ~end)` returns a new view referencing the same buffer over `[start, end)`.\n\nSee [`TypedArray.prototype.subarray`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/subarray) on MDN.\n" + }, "insertText": "->TypedArray.subarray", - "additionalTextEdits": [{ - "range": {"start": {"line": 9, "character": 15}, "end": {"line": 9, "character": 16}}, - "newText": "" - }] - }, { - "label": "->TypedArray.setArray", "kind": 12, - "tags": [], + "label": "->TypedArray.subarray", + "sortText": "subarray", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 9 }, + "start": { "character": 15, "line": 9 } + } + } + ], "detail": "(t<'a>, array<'a>) => unit", - "documentation": {"kind": "markdown", "value": "\n`setArray(target, source)` copies the values from `source` into `target`, mutating it.\n\nSee [`TypedArray.prototype.set`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/set) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([0, 0])\nTypedArray.setArray(view, [1, 2])\nTypedArray.toString(view) == \"1,2\"\n```\n"}, - "sortText": "setArray", + "documentation": { + "kind": "markdown", + "value": "\n`setArray(target, source)` copies the values from `source` into `target`, mutating it.\n\nSee [`TypedArray.prototype.set`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/set) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([0, 0])\nTypedArray.setArray(view, [1, 2])\nTypedArray.toString(view) == \"1,2\"\n```\n" + }, "insertText": "->TypedArray.setArray", - "additionalTextEdits": [{ - "range": {"start": {"line": 9, "character": 15}, "end": {"line": 9, "character": 16}}, - "newText": "" - }] - }, { - "label": "->TypedArray.get", "kind": 12, - "tags": [], + "label": "->TypedArray.setArray", + "sortText": "setArray", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 9 }, + "start": { "character": 15, "line": 9 } + } + } + ], "detail": "(t<'a>, int) => option<'a>", - "documentation": {"kind": "markdown", "value": "\n`get(typedArray, index)` returns the element at `index` of `typedArray`.\nReturns `None` if the index does not exist in the typed array. Equivalent to doing `typedArray[index]` in JavaScript.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nTypedArray.get(view, 0) == Some(1)\nTypedArray.get(view, 10) == None\n```\n"}, - "sortText": "get", + "documentation": { + "kind": "markdown", + "value": "\n`get(typedArray, index)` returns the element at `index` of `typedArray`.\nReturns `None` if the index does not exist in the typed array. Equivalent to doing `typedArray[index]` in JavaScript.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nTypedArray.get(view, 0) == Some(1)\nTypedArray.get(view, 10) == None\n```\n" + }, "insertText": "->TypedArray.get", - "additionalTextEdits": [{ - "range": {"start": {"line": 9, "character": 15}, "end": {"line": 9, "character": 16}}, - "newText": "" - }] - }, { - "label": "->TypedArray.with", "kind": 12, - "tags": [], + "label": "->TypedArray.get", + "sortText": "get", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 9 }, + "start": { "character": 15, "line": 9 } + } + } + ], "detail": "(t<'a>, int, 'a) => t<'a>", - "documentation": {"kind": "markdown", "value": "\n`with(typedArray, index, value)` returns a new typed array where the element at `index` is replaced with `value`.\n\nSee [`TypedArray.prototype.with`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/with) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nlet updated = TypedArray.with(view, 1, 10)\nTypedArray.toString(updated) == \"1,10,3\"\nTypedArray.toString(view) == \"1,2,3\"\n```\n"}, - "sortText": "with", + "documentation": { + "kind": "markdown", + "value": "\n`with(typedArray, index, value)` returns a new typed array where the element at `index` is replaced with `value`.\n\nSee [`TypedArray.prototype.with`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/with) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nlet updated = TypedArray.with(view, 1, 10)\nTypedArray.toString(updated) == \"1,10,3\"\nTypedArray.toString(view) == \"1,2,3\"\n```\n" + }, "insertText": "->TypedArray.with", - "additionalTextEdits": [{ - "range": {"start": {"line": 9, "character": 15}, "end": {"line": 9, "character": 16}}, - "newText": "" - }] - }, { - "label": "->TypedArray.toReversed", "kind": 12, - "tags": [], + "label": "->TypedArray.with", + "sortText": "with", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 9 }, + "start": { "character": 15, "line": 9 } + } + } + ], "detail": "t<'a> => t<'a>", - "documentation": {"kind": "markdown", "value": "\n`toReversed(typedArray)` returns a new typed array with the elements in reverse order, leaving the original untouched.\n\nSee [`TypedArray.prototype.toReversed`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/toReversed) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nlet reversed = TypedArray.toReversed(view)\nTypedArray.toString(reversed) == \"3,2,1\"\nTypedArray.toString(view) == \"1,2,3\"\n```\n"}, - "sortText": "toReversed", + "documentation": { + "kind": "markdown", + "value": "\n`toReversed(typedArray)` returns a new typed array with the elements in reverse order, leaving the original untouched.\n\nSee [`TypedArray.prototype.toReversed`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/toReversed) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nlet reversed = TypedArray.toReversed(view)\nTypedArray.toString(reversed) == \"3,2,1\"\nTypedArray.toString(view) == \"1,2,3\"\n```\n" + }, "insertText": "->TypedArray.toReversed", - "additionalTextEdits": [{ - "range": {"start": {"line": 9, "character": 15}, "end": {"line": 9, "character": 16}}, - "newText": "" - }] - }, { - "label": "->TypedArray.copyWithin", "kind": 12, - "tags": [], + "label": "->TypedArray.toReversed", + "sortText": "toReversed", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 9 }, + "start": { "character": 15, "line": 9 } + } + } + ], "detail": "(t<'a>, ~target: int, ~start: int, ~end: int=?) => array<'a>", - "documentation": {"kind": "markdown", "value": "\n`copyWithin(typedArray, ~target, ~start, ~end)` copies the section `[start, end)` onto the range beginning at `target`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.copyWithin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/copyWithin) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3, 4])\nlet _ = TypedArray.copyWithin(view, ~target=1, ~start=2, ~end=4)\nTypedArray.toString(view) == \"1,3,4,4\"\n```\n"}, - "sortText": "copyWithin", + "documentation": { + "kind": "markdown", + "value": "\n`copyWithin(typedArray, ~target, ~start, ~end)` copies the section `[start, end)` onto the range beginning at `target`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.copyWithin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/copyWithin) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3, 4])\nlet _ = TypedArray.copyWithin(view, ~target=1, ~start=2, ~end=4)\nTypedArray.toString(view) == \"1,3,4,4\"\n```\n" + }, "insertText": "->TypedArray.copyWithin", - "additionalTextEdits": [{ - "range": {"start": {"line": 9, "character": 15}, "end": {"line": 9, "character": 16}}, - "newText": "" - }] - }, { - "label": "->TypedArray.everyWithIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.copyWithin", + "sortText": "copyWithin", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 9 }, + "start": { "character": 15, "line": 9 } + } + } + ], "detail": "(t<'a>, ('a, int) => bool) => bool", - "documentation": {"kind": "markdown", "value": "\n`everyWithIndex(typedArray, checker)` is like `every` but provides the element index to `checker`.\n"}, - "sortText": "everyWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`everyWithIndex(typedArray, checker)` is like `every` but provides the element index to `checker`.\n" + }, "insertText": "->TypedArray.everyWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 9, "character": 15}, "end": {"line": 9, "character": 16}}, - "newText": "" - }] - }, { - "label": "->TypedArray.toString", "kind": 12, - "tags": [], + "label": "->TypedArray.everyWithIndex", + "sortText": "everyWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 9 }, + "start": { "character": 15, "line": 9 } + } + } + ], "detail": "t<'a> => string", - "documentation": {"kind": "markdown", "value": "\n`toString(typedArray)` returns a comma-separated string of the elements.\n\nSee [`TypedArray.prototype.toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/toString) on MDN.\n\n## Examples\n\n```rescript\nInt32Array.fromArray([1, 2])->TypedArray.toString == \"1,2\"\n```\n"}, - "sortText": "toString", + "documentation": { + "kind": "markdown", + "value": "\n`toString(typedArray)` returns a comma-separated string of the elements.\n\nSee [`TypedArray.prototype.toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/toString) on MDN.\n\n## Examples\n\n```rescript\nInt32Array.fromArray([1, 2])->TypedArray.toString == \"1,2\"\n```\n" + }, "insertText": "->TypedArray.toString", - "additionalTextEdits": [{ - "range": {"start": {"line": 9, "character": 15}, "end": {"line": 9, "character": 16}}, - "newText": "" - }] - }, { - "label": "->TypedArray.setArrayFrom", "kind": 12, - "tags": [], + "label": "->TypedArray.toString", + "sortText": "toString", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 9 }, + "start": { "character": 15, "line": 9 } + } + } + ], "detail": "(t<'a>, array<'a>, int) => unit", - "documentation": {"kind": "markdown", "value": "\n`setArrayFrom(target, source, index)` copies `source` into `target` starting at `index`.\n\nSee [`TypedArray.prototype.set`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/set) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([0, 0, 0])\nTypedArray.setArrayFrom(view, [5, 6], 1)\nTypedArray.toString(view) == \"0,5,6\"\n```\n"}, - "sortText": "setArrayFrom", + "documentation": { + "kind": "markdown", + "value": "\n`setArrayFrom(target, source, index)` copies `source` into `target` starting at `index`.\n\nSee [`TypedArray.prototype.set`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/set) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([0, 0, 0])\nTypedArray.setArrayFrom(view, [5, 6], 1)\nTypedArray.toString(view) == \"0,5,6\"\n```\n" + }, "insertText": "->TypedArray.setArrayFrom", - "additionalTextEdits": [{ - "range": {"start": {"line": 9, "character": 15}, "end": {"line": 9, "character": 16}}, - "newText": "" - }] - }, { - "label": "->TypedArray.forEach", "kind": 12, - "tags": [], + "label": "->TypedArray.setArrayFrom", + "sortText": "setArrayFrom", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 9 }, + "start": { "character": 15, "line": 9 } + } + } + ], "detail": "(t<'a>, 'a => unit) => unit", - "documentation": {"kind": "markdown", "value": "\n`forEach(typedArray, f)` runs `f` for every element in order.\n\nSee [`TypedArray.prototype.forEach`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/forEach) on MDN.\n"}, - "sortText": "forEach", + "documentation": { + "kind": "markdown", + "value": "\n`forEach(typedArray, f)` runs `f` for every element in order.\n\nSee [`TypedArray.prototype.forEach`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/forEach) on MDN.\n" + }, "insertText": "->TypedArray.forEach", - "additionalTextEdits": [{ - "range": {"start": {"line": 9, "character": 15}, "end": {"line": 9, "character": 16}}, - "newText": "" - }] - }, { - "label": "->TypedArray.findWithIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.forEach", + "sortText": "forEach", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 9 }, + "start": { "character": 15, "line": 9 } + } + } + ], "detail": "(t<'a>, ('a, int) => bool) => option<'a>", - "documentation": {"kind": "markdown", "value": "\n`findWithIndex(typedArray, predicate)` behaves like `find`, but `predicate` also receives the index.\n"}, - "sortText": "findWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`findWithIndex(typedArray, predicate)` behaves like `find`, but `predicate` also receives the index.\n" + }, "insertText": "->TypedArray.findWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 9, "character": 15}, "end": {"line": 9, "character": 16}}, - "newText": "" - }] - }, { - "label": "->TypedArray.fill", "kind": 12, - "tags": [], + "label": "->TypedArray.findWithIndex", + "sortText": "findWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 9 }, + "start": { "character": 15, "line": 9 } + } + } + ], "detail": "(t<'a>, 'a, ~start: int, ~end: int=?) => t<'a>", - "documentation": {"kind": "markdown", "value": "\n`fill(typedArray, value, ~start, ~end)` fills the half-open interval `[start, end)` with `value`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.fill`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/fill) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3, 4])\nlet _ = TypedArray.fill(view, 0, ~start=1, ~end=3)\nTypedArray.toString(view) == \"1,0,0,4\"\n```\n"}, - "sortText": "fill", + "documentation": { + "kind": "markdown", + "value": "\n`fill(typedArray, value, ~start, ~end)` fills the half-open interval `[start, end)` with `value`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.fill`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/fill) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3, 4])\nlet _ = TypedArray.fill(view, 0, ~start=1, ~end=3)\nTypedArray.toString(view) == \"1,0,0,4\"\n```\n" + }, "insertText": "->TypedArray.fill", - "additionalTextEdits": [{ - "range": {"start": {"line": 9, "character": 15}, "end": {"line": 9, "character": 16}}, - "newText": "" - }] - }, { - "label": "->TypedArray.indexOfFrom", "kind": 12, - "tags": [], + "label": "->TypedArray.fill", + "sortText": "fill", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 9 }, + "start": { "character": 15, "line": 9 } + } + } + ], "detail": "(t<'a>, 'a, int) => int", - "documentation": {"kind": "markdown", "value": "\n`indexOfFrom(typedArray, value, fromIndex)` searches for `value` starting at `fromIndex`.\n"}, - "sortText": "indexOfFrom", + "documentation": { + "kind": "markdown", + "value": "\n`indexOfFrom(typedArray, value, fromIndex)` searches for `value` starting at `fromIndex`.\n" + }, "insertText": "->TypedArray.indexOfFrom", - "additionalTextEdits": [{ - "range": {"start": {"line": 9, "character": 15}, "end": {"line": 9, "character": 16}}, - "newText": "" - }] - }, { - "label": "->TypedArray.reverse", "kind": 12, - "tags": [], + "label": "->TypedArray.indexOfFrom", + "sortText": "indexOfFrom", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 9 }, + "start": { "character": 15, "line": 9 } + } + } + ], "detail": "t<'a> => unit", - "documentation": {"kind": "markdown", "value": "\n`reverse(typedArray)` reverses the elements of the view in place.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.reverse`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/reverse) on MDN.\n"}, - "sortText": "reverse", + "documentation": { + "kind": "markdown", + "value": "\n`reverse(typedArray)` reverses the elements of the view in place.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.reverse`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/reverse) on MDN.\n" + }, "insertText": "->TypedArray.reverse", - "additionalTextEdits": [{ - "range": {"start": {"line": 9, "character": 15}, "end": {"line": 9, "character": 16}}, - "newText": "" - }] - }, { - "label": "->TypedArray.byteOffset", "kind": 12, - "tags": [], + "label": "->TypedArray.reverse", + "sortText": "reverse", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 9 }, + "start": { "character": 15, "line": 9 } + } + } + ], "detail": "t<'a> => int", - "documentation": {"kind": "markdown", "value": "\n`byteOffset(typedArray)` returns the offset in bytes from the start of the buffer.\n\nSee [`TypedArray.prototype.byteOffset`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/byteOffset) on MDN.\n"}, - "sortText": "byteOffset", + "documentation": { + "kind": "markdown", + "value": "\n`byteOffset(typedArray)` returns the offset in bytes from the start of the buffer.\n\nSee [`TypedArray.prototype.byteOffset`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/byteOffset) on MDN.\n" + }, "insertText": "->TypedArray.byteOffset", - "additionalTextEdits": [{ - "range": {"start": {"line": 9, "character": 15}, "end": {"line": 9, "character": 16}}, - "newText": "" - }] - }] + "kind": 12, + "label": "->TypedArray.byteOffset", + "sortText": "byteOffset", + "tags": [] + } +] Complete src/CompletionTypedArrays.res 13:16 posCursor:[13:16] posNoWhite:[13:15] Found expr:[13:3->13:16] @@ -2084,679 +3611,1188 @@ CPPipe pathFromEnv:Stdlib.Float64Array found:false Path Stdlib.Float64Array. Path Stdlib.TypedArray. Path -[{ - "label": "->Float64Array.ignore", - "kind": 12, - "tags": [], +[ + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 13 }, + "start": { "character": 15, "line": 13 } + } + } + ], "detail": "t => unit", - "documentation": {"kind": "markdown", "value": "\n `ignore(floatArray)` ignores the provided floatArray and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further.\n"}, - "sortText": "ignore", + "documentation": { + "kind": "markdown", + "value": "\n `ignore(floatArray)` ignores the provided floatArray and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further.\n" + }, "insertText": "->Float64Array.ignore", - "additionalTextEdits": [{ - "range": {"start": {"line": 13, "character": 15}, "end": {"line": 13, "character": 16}}, - "newText": "" - }] - }, { - "label": "->TypedArray.findLastIndexWithIndex", "kind": 12, - "tags": [], + "label": "->Float64Array.ignore", + "sortText": "ignore", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 13 }, + "start": { "character": 15, "line": 13 } + } + } + ], "detail": "(t<'a>, ('a, int) => bool) => int", - "documentation": {"kind": "markdown", "value": "\n`findLastIndexWithIndex(typedArray, predicate)` is the indexed variant of `findLastIndex`.\n"}, - "sortText": "findLastIndexWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`findLastIndexWithIndex(typedArray, predicate)` is the indexed variant of `findLastIndex`.\n" + }, "insertText": "->TypedArray.findLastIndexWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 13, "character": 15}, "end": {"line": 13, "character": 16}}, - "newText": "" - }] - }, { - "label": "->TypedArray.lastIndexOf", "kind": 12, - "tags": [], + "label": "->TypedArray.findLastIndexWithIndex", + "sortText": "findLastIndexWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 13 }, + "start": { "character": 15, "line": 13 } + } + } + ], "detail": "(t<'a>, 'a) => int", - "documentation": {"kind": "markdown", "value": "\n`lastIndexOf(typedArray, value)` returns the last index of `value`, or `-1` if not found.\n\nSee [`TypedArray.prototype.lastIndexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/lastIndexOf) on MDN.\n"}, - "sortText": "lastIndexOf", + "documentation": { + "kind": "markdown", + "value": "\n`lastIndexOf(typedArray, value)` returns the last index of `value`, or `-1` if not found.\n\nSee [`TypedArray.prototype.lastIndexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/lastIndexOf) on MDN.\n" + }, "insertText": "->TypedArray.lastIndexOf", - "additionalTextEdits": [{ - "range": {"start": {"line": 13, "character": 15}, "end": {"line": 13, "character": 16}}, - "newText": "" - }] - }, { - "label": "->TypedArray.findLastWithIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.lastIndexOf", + "sortText": "lastIndexOf", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 13 }, + "start": { "character": 15, "line": 13 } + } + } + ], "detail": "(t<'a>, ('a, int) => bool) => option<'a>", - "documentation": {"kind": "markdown", "value": "\n`findLastWithIndex(typedArray, predicate)` is the indexed variant of `findLast`.\n"}, - "sortText": "findLastWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`findLastWithIndex(typedArray, predicate)` is the indexed variant of `findLast`.\n" + }, "insertText": "->TypedArray.findLastWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 13, "character": 15}, "end": {"line": 13, "character": 16}}, - "newText": "" - }] - }, { - "label": "->TypedArray.findLast", "kind": 12, - "tags": [], + "label": "->TypedArray.findLastWithIndex", + "sortText": "findLastWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 13 }, + "start": { "character": 15, "line": 13 } + } + } + ], "detail": "(t<'a>, 'a => bool) => option<'a>", - "documentation": {"kind": "markdown", "value": "\n`findLast(typedArray, predicate)` returns the last element that satisfies `predicate`.\n\nSee [`TypedArray.prototype.findLast`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/findLast) on MDN.\n"}, - "sortText": "findLast", + "documentation": { + "kind": "markdown", + "value": "\n`findLast(typedArray, predicate)` returns the last element that satisfies `predicate`.\n\nSee [`TypedArray.prototype.findLast`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/findLast) on MDN.\n" + }, "insertText": "->TypedArray.findLast", - "additionalTextEdits": [{ - "range": {"start": {"line": 13, "character": 15}, "end": {"line": 13, "character": 16}}, - "newText": "" - }] - }, { - "label": "->TypedArray.filter", "kind": 12, - "tags": [], + "label": "->TypedArray.findLast", + "sortText": "findLast", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 13 }, + "start": { "character": 15, "line": 13 } + } + } + ], "detail": "(t<'a>, 'a => bool) => t<'a>", - "documentation": {"kind": "markdown", "value": "\n`filter(typedArray, predicate)` returns a new typed array containing only elements that satisfy `predicate`.\n\nSee [`TypedArray.prototype.filter`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/filter) on MDN.\n"}, - "sortText": "filter", + "documentation": { + "kind": "markdown", + "value": "\n`filter(typedArray, predicate)` returns a new typed array containing only elements that satisfy `predicate`.\n\nSee [`TypedArray.prototype.filter`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/filter) on MDN.\n" + }, "insertText": "->TypedArray.filter", - "additionalTextEdits": [{ - "range": {"start": {"line": 13, "character": 15}, "end": {"line": 13, "character": 16}}, - "newText": "" - }] - }, { - "label": "->TypedArray.byteLength", "kind": 12, - "tags": [], + "label": "->TypedArray.filter", + "sortText": "filter", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 13 }, + "start": { "character": 15, "line": 13 } + } + } + ], "detail": "t<'a> => int", - "documentation": {"kind": "markdown", "value": "\n`byteLength(typedArray)` returns the length in bytes of the view.\n\nSee [`TypedArray.prototype.byteLength`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/byteLength) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2])\nTypedArray.byteLength(view) == 8\n```\n"}, - "sortText": "byteLength", + "documentation": { + "kind": "markdown", + "value": "\n`byteLength(typedArray)` returns the length in bytes of the view.\n\nSee [`TypedArray.prototype.byteLength`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/byteLength) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2])\nTypedArray.byteLength(view) == 8\n```\n" + }, "insertText": "->TypedArray.byteLength", - "additionalTextEdits": [{ - "range": {"start": {"line": 13, "character": 15}, "end": {"line": 13, "character": 16}}, - "newText": "" - }] - }, { - "label": "->TypedArray.ignore", "kind": 12, - "tags": [], + "label": "->TypedArray.byteLength", + "sortText": "byteLength", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 13 }, + "start": { "character": 15, "line": 13 } + } + } + ], "detail": "t<'a> => unit", - "documentation": {"kind": "markdown", "value": "\n `ignore(typedArray)` ignores the provided typedArray and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further.\n"}, - "sortText": "ignore", + "documentation": { + "kind": "markdown", + "value": "\n `ignore(typedArray)` ignores the provided typedArray and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further.\n" + }, "insertText": "->TypedArray.ignore", - "additionalTextEdits": [{ - "range": {"start": {"line": 13, "character": 15}, "end": {"line": 13, "character": 16}}, - "newText": "" - }] - }, { - "label": "->TypedArray.reduceRightWithIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.ignore", + "sortText": "ignore", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 13 }, + "start": { "character": 15, "line": 13 } + } + } + ], "detail": "(t<'a>, ('b, 'a, int) => 'b, 'b) => 'b", - "documentation": {"kind": "markdown", "value": "\n`reduceRightWithIndex(typedArray, reducer, initial)` is the indexed variant of `reduceRight`.\n"}, - "sortText": "reduceRightWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`reduceRightWithIndex(typedArray, reducer, initial)` is the indexed variant of `reduceRight`.\n" + }, "insertText": "->TypedArray.reduceRightWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 13, "character": 15}, "end": {"line": 13, "character": 16}}, - "newText": "" - }] - }, { - "label": "->TypedArray.reduceRight", "kind": 12, - "tags": [], + "label": "->TypedArray.reduceRightWithIndex", + "sortText": "reduceRightWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 13 }, + "start": { "character": 15, "line": 13 } + } + } + ], "detail": "(t<'a>, ('b, 'a) => 'b, 'b) => 'b", - "documentation": {"kind": "markdown", "value": "\n`reduceRight(typedArray, reducer, initial)` is like `reduce` but processes the elements from right to left.\n\nSee [`TypedArray.prototype.reduceRight`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/reduceRight) on MDN.\n"}, - "sortText": "reduceRight", + "documentation": { + "kind": "markdown", + "value": "\n`reduceRight(typedArray, reducer, initial)` is like `reduce` but processes the elements from right to left.\n\nSee [`TypedArray.prototype.reduceRight`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/reduceRight) on MDN.\n" + }, "insertText": "->TypedArray.reduceRight", - "additionalTextEdits": [{ - "range": {"start": {"line": 13, "character": 15}, "end": {"line": 13, "character": 16}}, - "newText": "" - }] - }, { - "label": "->TypedArray.joinWith", "kind": 12, - "tags": [], + "label": "->TypedArray.reduceRight", + "sortText": "reduceRight", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 13 }, + "start": { "character": 15, "line": 13 } + } + } + ], "detail": "(t<'a>, string) => string", - "documentation": {"kind": "markdown", "value": "\n`joinWith(typedArray, separator)` returns a string formed by the elements joined with `separator`.\n\nSee [`TypedArray.prototype.join`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/join) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nTypedArray.joinWith(view, \"-\") == \"1-2-3\"\n```\n"}, - "sortText": "joinWith", + "documentation": { + "kind": "markdown", + "value": "\n`joinWith(typedArray, separator)` returns a string formed by the elements joined with `separator`.\n\nSee [`TypedArray.prototype.join`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/join) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nTypedArray.joinWith(view, \"-\") == \"1-2-3\"\n```\n" + }, "insertText": "->TypedArray.joinWith", - "additionalTextEdits": [{ - "range": {"start": {"line": 13, "character": 15}, "end": {"line": 13, "character": 16}}, - "newText": "" - }] - }, { - "label": "->TypedArray.buffer", "kind": 12, - "tags": [], + "label": "->TypedArray.joinWith", + "sortText": "joinWith", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 13 }, + "start": { "character": 15, "line": 13 } + } + } + ], "detail": "t<'a> => ArrayBuffer.t", - "documentation": {"kind": "markdown", "value": "\n`buffer(typedArray)` returns the underlying `ArrayBuffer` backing this view.\n\nSee [`TypedArray.prototype.buffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/buffer) on MDN.\n"}, - "sortText": "buffer", + "documentation": { + "kind": "markdown", + "value": "\n`buffer(typedArray)` returns the underlying `ArrayBuffer` backing this view.\n\nSee [`TypedArray.prototype.buffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/buffer) on MDN.\n" + }, "insertText": "->TypedArray.buffer", - "additionalTextEdits": [{ - "range": {"start": {"line": 13, "character": 15}, "end": {"line": 13, "character": 16}}, - "newText": "" - }] - }, { - "label": "->TypedArray.reduce", "kind": 12, - "tags": [], + "label": "->TypedArray.buffer", + "sortText": "buffer", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 13 }, + "start": { "character": 15, "line": 13 } + } + } + ], "detail": "(t<'a>, ('b, 'a) => 'b, 'b) => 'b", - "documentation": {"kind": "markdown", "value": "\n`reduce(typedArray, reducer, initial)` combines the elements from left to right using `reducer`.\n\nSee [`TypedArray.prototype.reduce`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/reduce) on MDN.\n"}, - "sortText": "reduce", + "documentation": { + "kind": "markdown", + "value": "\n`reduce(typedArray, reducer, initial)` combines the elements from left to right using `reducer`.\n\nSee [`TypedArray.prototype.reduce`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/reduce) on MDN.\n" + }, "insertText": "->TypedArray.reduce", - "additionalTextEdits": [{ - "range": {"start": {"line": 13, "character": 15}, "end": {"line": 13, "character": 16}}, - "newText": "" - }] - }, { - "label": "->TypedArray.forEachWithIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.reduce", + "sortText": "reduce", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 13 }, + "start": { "character": 15, "line": 13 } + } + } + ], "detail": "(t<'a>, ('a, int) => unit) => unit", - "documentation": {"kind": "markdown", "value": "\n`forEachWithIndex(typedArray, f)` runs `f` for every element, also providing the index.\n"}, - "sortText": "forEachWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`forEachWithIndex(typedArray, f)` runs `f` for every element, also providing the index.\n" + }, "insertText": "->TypedArray.forEachWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 13, "character": 15}, "end": {"line": 13, "character": 16}}, - "newText": "" - }] - }, { - "label": "->TypedArray.copy", "kind": 12, - "tags": [], + "label": "->TypedArray.forEachWithIndex", + "sortText": "forEachWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 13 }, + "start": { "character": 15, "line": 13 } + } + } + ], "detail": "t<'a> => t<'a>", - "documentation": {"kind": "markdown", "value": "\n`copy(typedArray)` produces a shallow copy of the typed array.\n"}, - "sortText": "copy", + "documentation": { + "kind": "markdown", + "value": "\n`copy(typedArray)` produces a shallow copy of the typed array.\n" + }, "insertText": "->TypedArray.copy", - "additionalTextEdits": [{ - "range": {"start": {"line": 13, "character": 15}, "end": {"line": 13, "character": 16}}, - "newText": "" - }] - }, { - "label": "->TypedArray.someWithIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.copy", + "sortText": "copy", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 13 }, + "start": { "character": 15, "line": 13 } + } + } + ], "detail": "(t<'a>, ('a, int) => bool) => bool", - "documentation": {"kind": "markdown", "value": "\n`someWithIndex(typedArray, predicate)` behaves like `some`, but `predicate` also receives the element index.\n"}, - "sortText": "someWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`someWithIndex(typedArray, predicate)` behaves like `some`, but `predicate` also receives the element index.\n" + }, "insertText": "->TypedArray.someWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 13, "character": 15}, "end": {"line": 13, "character": 16}}, - "newText": "" - }] - }, { - "label": "->TypedArray.findIndexWithIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.someWithIndex", + "sortText": "someWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 13 }, + "start": { "character": 15, "line": 13 } + } + } + ], "detail": "(t<'a>, ('a, int) => bool) => int", - "documentation": {"kind": "markdown", "value": "\n`findIndexWithIndex(typedArray, predicate)` is the indexed variant of `findIndex`.\n"}, - "sortText": "findIndexWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`findIndexWithIndex(typedArray, predicate)` is the indexed variant of `findIndex`.\n" + }, "insertText": "->TypedArray.findIndexWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 13, "character": 15}, "end": {"line": 13, "character": 16}}, - "newText": "" - }] - }, { - "label": "->TypedArray.sliceToEnd", "kind": 12, - "tags": [1], + "label": "->TypedArray.findIndexWithIndex", + "sortText": "findIndexWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 13 }, + "start": { "character": 15, "line": 13 } + } + } + ], + "deprecated": true, "detail": "(t<'a>, ~start: int) => t<'a>", - "documentation": {"kind": "markdown", "value": "Deprecated: Use `slice` instead\n\n\n`sliceToEnd(typedArray, ~start)` returns the elements from `start` through the end in a new typed array.\n"}, - "sortText": "sliceToEnd", + "documentation": { + "kind": "markdown", + "value": "Deprecated: Use `slice` instead\n\n\n`sliceToEnd(typedArray, ~start)` returns the elements from `start` through the end in a new typed array.\n" + }, "insertText": "->TypedArray.sliceToEnd", - "additionalTextEdits": [{ - "range": {"start": {"line": 13, "character": 15}, "end": {"line": 13, "character": 16}}, - "newText": "" - }] - }, { - "label": "->TypedArray.slice", "kind": 12, - "tags": [], + "label": "->TypedArray.sliceToEnd", + "sortText": "sliceToEnd", + "tags": [ 1 ] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 13 }, + "start": { "character": 15, "line": 13 } + } + } + ], "detail": "(t<'a>, ~start: int, ~end: int=?) => t<'a>", - "documentation": {"kind": "markdown", "value": "\n`slice(typedArray, ~start, ~end)` returns a new typed array containing the elements in `[start, end)`.\n\nSee [`TypedArray.prototype.slice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/slice) on MDN.\n"}, - "sortText": "slice", + "documentation": { + "kind": "markdown", + "value": "\n`slice(typedArray, ~start, ~end)` returns a new typed array containing the elements in `[start, end)`.\n\nSee [`TypedArray.prototype.slice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/slice) on MDN.\n" + }, "insertText": "->TypedArray.slice", - "additionalTextEdits": [{ - "range": {"start": {"line": 13, "character": 15}, "end": {"line": 13, "character": 16}}, - "newText": "" - }] - }, { - "label": "->TypedArray.findLastIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.slice", + "sortText": "slice", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 13 }, + "start": { "character": 15, "line": 13 } + } + } + ], "detail": "(t<'a>, 'a => bool) => int", - "documentation": {"kind": "markdown", "value": "\n`findLastIndex(typedArray, predicate)` returns the index of the last matching element, or `-1` if none do.\n\nSee [`TypedArray.prototype.findLastIndex`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/findLastIndex) on MDN.\n"}, - "sortText": "findLastIndex", + "documentation": { + "kind": "markdown", + "value": "\n`findLastIndex(typedArray, predicate)` returns the index of the last matching element, or `-1` if none do.\n\nSee [`TypedArray.prototype.findLastIndex`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/findLastIndex) on MDN.\n" + }, "insertText": "->TypedArray.findLastIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 13, "character": 15}, "end": {"line": 13, "character": 16}}, - "newText": "" - }] - }, { - "label": "->TypedArray.includes", "kind": 12, - "tags": [], + "label": "->TypedArray.findLastIndex", + "sortText": "findLastIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 13 }, + "start": { "character": 15, "line": 13 } + } + } + ], "detail": "(t<'a>, 'a) => bool", - "documentation": {"kind": "markdown", "value": "\n`includes(typedArray, value)` returns `true` if `value` occurs in the typed array.\n\nSee [`TypedArray.prototype.includes`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/includes) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nTypedArray.includes(view, 2) == true\nTypedArray.includes(view, 10) == false\n```\n"}, - "sortText": "includes", + "documentation": { + "kind": "markdown", + "value": "\n`includes(typedArray, value)` returns `true` if `value` occurs in the typed array.\n\nSee [`TypedArray.prototype.includes`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/includes) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nTypedArray.includes(view, 2) == true\nTypedArray.includes(view, 10) == false\n```\n" + }, "insertText": "->TypedArray.includes", - "additionalTextEdits": [{ - "range": {"start": {"line": 13, "character": 15}, "end": {"line": 13, "character": 16}}, - "newText": "" - }] - }, { - "label": "->TypedArray.fillToEnd", "kind": 12, - "tags": [1], + "label": "->TypedArray.includes", + "sortText": "includes", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 13 }, + "start": { "character": 15, "line": 13 } + } + } + ], + "deprecated": true, "detail": "(t<'a>, 'a, ~start: int) => t<'a>", - "documentation": {"kind": "markdown", "value": "Deprecated: Use `fill` instead\n\n\n`fillToEnd(typedArray, value, ~start)` fills from `start` through the end with `value`.\n\nBeware this will *mutate* the typed array.\n"}, - "sortText": "fillToEnd", + "documentation": { + "kind": "markdown", + "value": "Deprecated: Use `fill` instead\n\n\n`fillToEnd(typedArray, value, ~start)` fills from `start` through the end with `value`.\n\nBeware this will *mutate* the typed array.\n" + }, "insertText": "->TypedArray.fillToEnd", - "additionalTextEdits": [{ - "range": {"start": {"line": 13, "character": 15}, "end": {"line": 13, "character": 16}}, - "newText": "" - }] - }, { - "label": "->TypedArray.fillAll", "kind": 12, - "tags": [], + "label": "->TypedArray.fillToEnd", + "sortText": "fillToEnd", + "tags": [ 1 ] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 13 }, + "start": { "character": 15, "line": 13 } + } + } + ], "detail": "(t<'a>, 'a) => t<'a>", - "documentation": {"kind": "markdown", "value": "\n`fillAll(typedArray, value)` fills every element with `value`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.fill`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/fill) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nlet _ = TypedArray.fillAll(view, 9)\nTypedArray.toString(view) == \"9,9,9\"\n```\n"}, - "sortText": "fillAll", + "documentation": { + "kind": "markdown", + "value": "\n`fillAll(typedArray, value)` fills every element with `value`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.fill`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/fill) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nlet _ = TypedArray.fillAll(view, 9)\nTypedArray.toString(view) == \"9,9,9\"\n```\n" + }, "insertText": "->TypedArray.fillAll", - "additionalTextEdits": [{ - "range": {"start": {"line": 13, "character": 15}, "end": {"line": 13, "character": 16}}, - "newText": "" - }] - }, { - "label": "->TypedArray.find", "kind": 12, - "tags": [], + "label": "->TypedArray.fillAll", + "sortText": "fillAll", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 13 }, + "start": { "character": 15, "line": 13 } + } + } + ], "detail": "(t<'a>, 'a => bool) => option<'a>", - "documentation": {"kind": "markdown", "value": "\n`find(typedArray, predicate)` returns the first element that satisfies `predicate`, or `None` if nothing matches.\n\nSee [`TypedArray.prototype.find`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/find) on MDN.\n"}, - "sortText": "find", + "documentation": { + "kind": "markdown", + "value": "\n`find(typedArray, predicate)` returns the first element that satisfies `predicate`, or `None` if nothing matches.\n\nSee [`TypedArray.prototype.find`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/find) on MDN.\n" + }, "insertText": "->TypedArray.find", - "additionalTextEdits": [{ - "range": {"start": {"line": 13, "character": 15}, "end": {"line": 13, "character": 16}}, - "newText": "" - }] - }, { - "label": "->TypedArray.subarrayToEnd", "kind": 12, - "tags": [1], + "label": "->TypedArray.find", + "sortText": "find", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 13 }, + "start": { "character": 15, "line": 13 } + } + } + ], + "deprecated": true, "detail": "(t<'a>, ~start: int) => t<'a>", - "documentation": {"kind": "markdown", "value": "Deprecated: Use `subarray` instead\n\n\n`subarrayToEnd(typedArray, ~start)` returns a new view from `start` to the end of the buffer.\n"}, - "sortText": "subarrayToEnd", + "documentation": { + "kind": "markdown", + "value": "Deprecated: Use `subarray` instead\n\n\n`subarrayToEnd(typedArray, ~start)` returns a new view from `start` to the end of the buffer.\n" + }, "insertText": "->TypedArray.subarrayToEnd", - "additionalTextEdits": [{ - "range": {"start": {"line": 13, "character": 15}, "end": {"line": 13, "character": 16}}, - "newText": "" - }] - }, { - "label": "->TypedArray.set", "kind": 12, - "tags": [], + "label": "->TypedArray.subarrayToEnd", + "sortText": "subarrayToEnd", + "tags": [ 1 ] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 13 }, + "start": { "character": 15, "line": 13 } + } + } + ], "detail": "(t<'a>, int, 'a) => unit", - "documentation": {"kind": "markdown", "value": "\n`set(typedArray, index, item)` sets the provided `item` at `index` of `typedArray`.\n\nBeware this will *mutate* the array.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2])\nTypedArray.set(view, 1, 5)\nTypedArray.get(view, 1) == Some(5)\n```\n"}, - "sortText": "set", + "documentation": { + "kind": "markdown", + "value": "\n`set(typedArray, index, item)` sets the provided `item` at `index` of `typedArray`.\n\nBeware this will *mutate* the array.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2])\nTypedArray.set(view, 1, 5)\nTypedArray.get(view, 1) == Some(5)\n```\n" + }, "insertText": "->TypedArray.set", - "additionalTextEdits": [{ - "range": {"start": {"line": 13, "character": 15}, "end": {"line": 13, "character": 16}}, - "newText": "" - }] - }, { - "label": "->TypedArray.toLocaleString", "kind": 12, - "tags": [], + "label": "->TypedArray.set", + "sortText": "set", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 13 }, + "start": { "character": 15, "line": 13 } + } + } + ], "detail": "t<'a> => string", - "documentation": {"kind": "markdown", "value": "\n`toLocaleString(typedArray)` concatenates the elements using locale-aware formatting.\n\nSee [`TypedArray.prototype.toLocaleString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/toLocaleString) on MDN.\n"}, - "sortText": "toLocaleString", + "documentation": { + "kind": "markdown", + "value": "\n`toLocaleString(typedArray)` concatenates the elements using locale-aware formatting.\n\nSee [`TypedArray.prototype.toLocaleString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/toLocaleString) on MDN.\n" + }, "insertText": "->TypedArray.toLocaleString", - "additionalTextEdits": [{ - "range": {"start": {"line": 13, "character": 15}, "end": {"line": 13, "character": 16}}, - "newText": "" - }] - }, { - "label": "->TypedArray.lastIndexOfFrom", "kind": 12, - "tags": [], + "label": "->TypedArray.toLocaleString", + "sortText": "toLocaleString", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 13 }, + "start": { "character": 15, "line": 13 } + } + } + ], "detail": "(t<'a>, 'a, int) => int", - "documentation": {"kind": "markdown", "value": "\n`lastIndexOfFrom(typedArray, value, fromIndex)` searches backwards starting at `fromIndex`.\n"}, - "sortText": "lastIndexOfFrom", + "documentation": { + "kind": "markdown", + "value": "\n`lastIndexOfFrom(typedArray, value, fromIndex)` searches backwards starting at `fromIndex`.\n" + }, "insertText": "->TypedArray.lastIndexOfFrom", - "additionalTextEdits": [{ - "range": {"start": {"line": 13, "character": 15}, "end": {"line": 13, "character": 16}}, - "newText": "" - }] - }, { - "label": "->TypedArray.findIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.lastIndexOfFrom", + "sortText": "lastIndexOfFrom", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 13 }, + "start": { "character": 15, "line": 13 } + } + } + ], "detail": "(t<'a>, 'a => bool) => int", - "documentation": {"kind": "markdown", "value": "\n`findIndex(typedArray, predicate)` returns the index of the first element that satisfies `predicate`, or `-1` if none do.\n\nSee [`TypedArray.prototype.findIndex`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/findIndex) on MDN.\n"}, - "sortText": "findIndex", + "documentation": { + "kind": "markdown", + "value": "\n`findIndex(typedArray, predicate)` returns the index of the first element that satisfies `predicate`, or `-1` if none do.\n\nSee [`TypedArray.prototype.findIndex`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/findIndex) on MDN.\n" + }, "insertText": "->TypedArray.findIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 13, "character": 15}, "end": {"line": 13, "character": 16}}, - "newText": "" - }] - }, { - "label": "->TypedArray.filterWithIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.findIndex", + "sortText": "findIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 13 }, + "start": { "character": 15, "line": 13 } + } + } + ], "detail": "(t<'a>, ('a, int) => bool) => t<'a>", - "documentation": {"kind": "markdown", "value": "\n`filterWithIndex(typedArray, predicate)` behaves like `filter` but also passes the index to `predicate`.\n"}, - "sortText": "filterWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`filterWithIndex(typedArray, predicate)` behaves like `filter` but also passes the index to `predicate`.\n" + }, "insertText": "->TypedArray.filterWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 13, "character": 15}, "end": {"line": 13, "character": 16}}, - "newText": "" - }] - }, { - "label": "->TypedArray.sort", "kind": 12, - "tags": [], + "label": "->TypedArray.filterWithIndex", + "sortText": "filterWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 13 }, + "start": { "character": 15, "line": 13 } + } + } + ], "detail": "(t<'a>, ('a, 'a) => Ordering.t) => unit", - "documentation": {"kind": "markdown", "value": "\n`sort(typedArray, comparator)` sorts the values in place using `comparator`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.sort`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/sort) on MDN.\n"}, - "sortText": "sort", + "documentation": { + "kind": "markdown", + "value": "\n`sort(typedArray, comparator)` sorts the values in place using `comparator`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.sort`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/sort) on MDN.\n" + }, "insertText": "->TypedArray.sort", - "additionalTextEdits": [{ - "range": {"start": {"line": 13, "character": 15}, "end": {"line": 13, "character": 16}}, - "newText": "" - }] - }, { - "label": "->TypedArray.mapWithIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.sort", + "sortText": "sort", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 13 }, + "start": { "character": 15, "line": 13 } + } + } + ], "detail": "(t<'a>, ('a, int) => 'b) => t<'b>", - "documentation": {"kind": "markdown", "value": "\n`mapWithIndex(typedArray, f)` behaves like `map`, but `f` also receives the index.\n"}, - "sortText": "mapWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`mapWithIndex(typedArray, f)` behaves like `map`, but `f` also receives the index.\n" + }, "insertText": "->TypedArray.mapWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 13, "character": 15}, "end": {"line": 13, "character": 16}}, - "newText": "" - }] - }, { - "label": "->TypedArray.every", "kind": 12, - "tags": [], + "label": "->TypedArray.mapWithIndex", + "sortText": "mapWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 13 }, + "start": { "character": 15, "line": 13 } + } + } + ], "detail": "(t<'a>, 'a => bool) => bool", - "documentation": {"kind": "markdown", "value": "\n`every(typedArray, predicate)` returns `true` if `predicate` returns `true` for every element.\n\nSee [`TypedArray.prototype.every`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/every) on MDN.\n"}, - "sortText": "every", + "documentation": { + "kind": "markdown", + "value": "\n`every(typedArray, predicate)` returns `true` if `predicate` returns `true` for every element.\n\nSee [`TypedArray.prototype.every`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/every) on MDN.\n" + }, "insertText": "->TypedArray.every", - "additionalTextEdits": [{ - "range": {"start": {"line": 13, "character": 15}, "end": {"line": 13, "character": 16}}, - "newText": "" - }] - }, { - "label": "->TypedArray.length", "kind": 12, - "tags": [], + "label": "->TypedArray.every", + "sortText": "every", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 13 }, + "start": { "character": 15, "line": 13 } + } + } + ], "detail": "t<'a> => int", - "documentation": {"kind": "markdown", "value": "\n`length(typedArray)` returns the number of elements.\n\nSee [`TypedArray.prototype.length`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/length) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nTypedArray.length(view) == 3\n```\n"}, - "sortText": "length", + "documentation": { + "kind": "markdown", + "value": "\n`length(typedArray)` returns the number of elements.\n\nSee [`TypedArray.prototype.length`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/length) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nTypedArray.length(view) == 3\n```\n" + }, "insertText": "->TypedArray.length", - "additionalTextEdits": [{ - "range": {"start": {"line": 13, "character": 15}, "end": {"line": 13, "character": 16}}, - "newText": "" - }] - }, { - "label": "->TypedArray.indexOf", "kind": 12, - "tags": [], + "label": "->TypedArray.length", + "sortText": "length", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 13 }, + "start": { "character": 15, "line": 13 } + } + } + ], "detail": "(t<'a>, 'a) => int", - "documentation": {"kind": "markdown", "value": "\n`indexOf(typedArray, value)` returns the first index of `value`, or `-1` when not found.\n\nSee [`TypedArray.prototype.indexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/indexOf) on MDN.\n"}, - "sortText": "indexOf", + "documentation": { + "kind": "markdown", + "value": "\n`indexOf(typedArray, value)` returns the first index of `value`, or `-1` when not found.\n\nSee [`TypedArray.prototype.indexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/indexOf) on MDN.\n" + }, "insertText": "->TypedArray.indexOf", - "additionalTextEdits": [{ - "range": {"start": {"line": 13, "character": 15}, "end": {"line": 13, "character": 16}}, - "newText": "" - }] - }, { - "label": "->TypedArray.copyWithinToEnd", "kind": 12, - "tags": [1], + "label": "->TypedArray.indexOf", + "sortText": "indexOf", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 13 }, + "start": { "character": 15, "line": 13 } + } + } + ], + "deprecated": true, "detail": "(t<'a>, ~target: int, ~start: int) => array<'a>", - "documentation": {"kind": "markdown", "value": "Deprecated: Use `copyWithin` instead\n\n\n`copyWithinToEnd(typedArray, ~target, ~start)` copies values from `start` through the end of the view into the range beginning at `target`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.copyWithin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/copyWithin) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3, 4])\nlet _ = TypedArray.copyWithinToEnd(view, ~target=0, ~start=2)\nTypedArray.toString(view) == \"3,4,3,4\"\n```\n"}, - "sortText": "copyWithinToEnd", + "documentation": { + "kind": "markdown", + "value": "Deprecated: Use `copyWithin` instead\n\n\n`copyWithinToEnd(typedArray, ~target, ~start)` copies values from `start` through the end of the view into the range beginning at `target`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.copyWithin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/copyWithin) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3, 4])\nlet _ = TypedArray.copyWithinToEnd(view, ~target=0, ~start=2)\nTypedArray.toString(view) == \"3,4,3,4\"\n```\n" + }, "insertText": "->TypedArray.copyWithinToEnd", - "additionalTextEdits": [{ - "range": {"start": {"line": 13, "character": 15}, "end": {"line": 13, "character": 16}}, - "newText": "" - }] - }, { - "label": "->TypedArray.some", "kind": 12, - "tags": [], + "label": "->TypedArray.copyWithinToEnd", + "sortText": "copyWithinToEnd", + "tags": [ 1 ] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 13 }, + "start": { "character": 15, "line": 13 } + } + } + ], "detail": "(t<'a>, 'a => bool) => bool", - "documentation": {"kind": "markdown", "value": "\n`some(typedArray, predicate)` returns `true` if `predicate` returns `true` for at least one element.\n\nSee [`TypedArray.prototype.some`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/some) on MDN.\n"}, - "sortText": "some", + "documentation": { + "kind": "markdown", + "value": "\n`some(typedArray, predicate)` returns `true` if `predicate` returns `true` for at least one element.\n\nSee [`TypedArray.prototype.some`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/some) on MDN.\n" + }, "insertText": "->TypedArray.some", - "additionalTextEdits": [{ - "range": {"start": {"line": 13, "character": 15}, "end": {"line": 13, "character": 16}}, - "newText": "" - }] - }, { - "label": "->TypedArray.reduceWithIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.some", + "sortText": "some", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 13 }, + "start": { "character": 15, "line": 13 } + } + } + ], "detail": "(t<'a>, ('b, 'a, int) => 'b, 'b) => 'b", - "documentation": {"kind": "markdown", "value": "\n`reduceWithIndex(typedArray, reducer, initial)` is the indexed variant of `reduce`.\n"}, - "sortText": "reduceWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`reduceWithIndex(typedArray, reducer, initial)` is the indexed variant of `reduce`.\n" + }, "insertText": "->TypedArray.reduceWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 13, "character": 15}, "end": {"line": 13, "character": 16}}, - "newText": "" - }] - }, { - "label": "->TypedArray.map", "kind": 12, - "tags": [], + "label": "->TypedArray.reduceWithIndex", + "sortText": "reduceWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 13 }, + "start": { "character": 15, "line": 13 } + } + } + ], "detail": "(t<'a>, 'a => 'b) => t<'b>", - "documentation": {"kind": "markdown", "value": "\n`map(typedArray, f)` returns a new typed array whose elements are produced by applying `f` to each element.\n\nSee [`TypedArray.prototype.map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/map) on MDN.\n"}, - "sortText": "map", + "documentation": { + "kind": "markdown", + "value": "\n`map(typedArray, f)` returns a new typed array whose elements are produced by applying `f` to each element.\n\nSee [`TypedArray.prototype.map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/map) on MDN.\n" + }, "insertText": "->TypedArray.map", - "additionalTextEdits": [{ - "range": {"start": {"line": 13, "character": 15}, "end": {"line": 13, "character": 16}}, - "newText": "" - }] - }, { - "label": "->TypedArray.toSorted", "kind": 12, - "tags": [], + "label": "->TypedArray.map", + "sortText": "map", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 13 }, + "start": { "character": 15, "line": 13 } + } + } + ], "detail": "(t<'a>, ('a, 'a) => Ordering.t) => t<'a>", - "documentation": {"kind": "markdown", "value": "\n`toSorted(typedArray, comparator)` returns a new typed array containing the sorted values, leaving the original untouched.\n\nSee [`TypedArray.prototype.toSorted`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/toSorted) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([3, 1, 2])\nlet sorted = TypedArray.toSorted(view, Int.compare)\nTypedArray.toString(sorted) == \"1,2,3\"\nTypedArray.toString(view) == \"3,1,2\"\n```\n"}, - "sortText": "toSorted", + "documentation": { + "kind": "markdown", + "value": "\n`toSorted(typedArray, comparator)` returns a new typed array containing the sorted values, leaving the original untouched.\n\nSee [`TypedArray.prototype.toSorted`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/toSorted) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([3, 1, 2])\nlet sorted = TypedArray.toSorted(view, Int.compare)\nTypedArray.toString(sorted) == \"1,2,3\"\nTypedArray.toString(view) == \"3,1,2\"\n```\n" + }, "insertText": "->TypedArray.toSorted", - "additionalTextEdits": [{ - "range": {"start": {"line": 13, "character": 15}, "end": {"line": 13, "character": 16}}, - "newText": "" - }] - }, { - "label": "->TypedArray.copyAllWithin", "kind": 12, - "tags": [], + "label": "->TypedArray.toSorted", + "sortText": "toSorted", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 13 }, + "start": { "character": 15, "line": 13 } + } + } + ], "detail": "(t<'a>, ~target: int) => array<'a>", - "documentation": {"kind": "markdown", "value": "\n`copyAllWithin(typedArray, ~target)` copies values starting at index `0` over the positions beginning at `target`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.copyWithin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/copyWithin) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([10, 20, 30])\nlet _ = TypedArray.copyAllWithin(view, ~target=1)\nTypedArray.toString(view) == \"10,10,20\"\n```\n"}, - "sortText": "copyAllWithin", + "documentation": { + "kind": "markdown", + "value": "\n`copyAllWithin(typedArray, ~target)` copies values starting at index `0` over the positions beginning at `target`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.copyWithin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/copyWithin) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([10, 20, 30])\nlet _ = TypedArray.copyAllWithin(view, ~target=1)\nTypedArray.toString(view) == \"10,10,20\"\n```\n" + }, "insertText": "->TypedArray.copyAllWithin", - "additionalTextEdits": [{ - "range": {"start": {"line": 13, "character": 15}, "end": {"line": 13, "character": 16}}, - "newText": "" - }] - }, { - "label": "->TypedArray.subarray", "kind": 12, - "tags": [], + "label": "->TypedArray.copyAllWithin", + "sortText": "copyAllWithin", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 13 }, + "start": { "character": 15, "line": 13 } + } + } + ], "detail": "(t<'a>, ~start: int, ~end: int=?) => t<'a>", - "documentation": {"kind": "markdown", "value": "\n`subarray(typedArray, ~start, ~end)` returns a new view referencing the same buffer over `[start, end)`.\n\nSee [`TypedArray.prototype.subarray`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/subarray) on MDN.\n"}, - "sortText": "subarray", + "documentation": { + "kind": "markdown", + "value": "\n`subarray(typedArray, ~start, ~end)` returns a new view referencing the same buffer over `[start, end)`.\n\nSee [`TypedArray.prototype.subarray`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/subarray) on MDN.\n" + }, "insertText": "->TypedArray.subarray", - "additionalTextEdits": [{ - "range": {"start": {"line": 13, "character": 15}, "end": {"line": 13, "character": 16}}, - "newText": "" - }] - }, { - "label": "->TypedArray.setArray", "kind": 12, - "tags": [], + "label": "->TypedArray.subarray", + "sortText": "subarray", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 13 }, + "start": { "character": 15, "line": 13 } + } + } + ], "detail": "(t<'a>, array<'a>) => unit", - "documentation": {"kind": "markdown", "value": "\n`setArray(target, source)` copies the values from `source` into `target`, mutating it.\n\nSee [`TypedArray.prototype.set`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/set) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([0, 0])\nTypedArray.setArray(view, [1, 2])\nTypedArray.toString(view) == \"1,2\"\n```\n"}, - "sortText": "setArray", + "documentation": { + "kind": "markdown", + "value": "\n`setArray(target, source)` copies the values from `source` into `target`, mutating it.\n\nSee [`TypedArray.prototype.set`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/set) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([0, 0])\nTypedArray.setArray(view, [1, 2])\nTypedArray.toString(view) == \"1,2\"\n```\n" + }, "insertText": "->TypedArray.setArray", - "additionalTextEdits": [{ - "range": {"start": {"line": 13, "character": 15}, "end": {"line": 13, "character": 16}}, - "newText": "" - }] - }, { - "label": "->TypedArray.get", "kind": 12, - "tags": [], + "label": "->TypedArray.setArray", + "sortText": "setArray", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 13 }, + "start": { "character": 15, "line": 13 } + } + } + ], "detail": "(t<'a>, int) => option<'a>", - "documentation": {"kind": "markdown", "value": "\n`get(typedArray, index)` returns the element at `index` of `typedArray`.\nReturns `None` if the index does not exist in the typed array. Equivalent to doing `typedArray[index]` in JavaScript.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nTypedArray.get(view, 0) == Some(1)\nTypedArray.get(view, 10) == None\n```\n"}, - "sortText": "get", + "documentation": { + "kind": "markdown", + "value": "\n`get(typedArray, index)` returns the element at `index` of `typedArray`.\nReturns `None` if the index does not exist in the typed array. Equivalent to doing `typedArray[index]` in JavaScript.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nTypedArray.get(view, 0) == Some(1)\nTypedArray.get(view, 10) == None\n```\n" + }, "insertText": "->TypedArray.get", - "additionalTextEdits": [{ - "range": {"start": {"line": 13, "character": 15}, "end": {"line": 13, "character": 16}}, - "newText": "" - }] - }, { - "label": "->TypedArray.with", "kind": 12, - "tags": [], + "label": "->TypedArray.get", + "sortText": "get", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 13 }, + "start": { "character": 15, "line": 13 } + } + } + ], "detail": "(t<'a>, int, 'a) => t<'a>", - "documentation": {"kind": "markdown", "value": "\n`with(typedArray, index, value)` returns a new typed array where the element at `index` is replaced with `value`.\n\nSee [`TypedArray.prototype.with`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/with) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nlet updated = TypedArray.with(view, 1, 10)\nTypedArray.toString(updated) == \"1,10,3\"\nTypedArray.toString(view) == \"1,2,3\"\n```\n"}, - "sortText": "with", + "documentation": { + "kind": "markdown", + "value": "\n`with(typedArray, index, value)` returns a new typed array where the element at `index` is replaced with `value`.\n\nSee [`TypedArray.prototype.with`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/with) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nlet updated = TypedArray.with(view, 1, 10)\nTypedArray.toString(updated) == \"1,10,3\"\nTypedArray.toString(view) == \"1,2,3\"\n```\n" + }, "insertText": "->TypedArray.with", - "additionalTextEdits": [{ - "range": {"start": {"line": 13, "character": 15}, "end": {"line": 13, "character": 16}}, - "newText": "" - }] - }, { - "label": "->TypedArray.toReversed", "kind": 12, - "tags": [], + "label": "->TypedArray.with", + "sortText": "with", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 13 }, + "start": { "character": 15, "line": 13 } + } + } + ], "detail": "t<'a> => t<'a>", - "documentation": {"kind": "markdown", "value": "\n`toReversed(typedArray)` returns a new typed array with the elements in reverse order, leaving the original untouched.\n\nSee [`TypedArray.prototype.toReversed`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/toReversed) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nlet reversed = TypedArray.toReversed(view)\nTypedArray.toString(reversed) == \"3,2,1\"\nTypedArray.toString(view) == \"1,2,3\"\n```\n"}, - "sortText": "toReversed", + "documentation": { + "kind": "markdown", + "value": "\n`toReversed(typedArray)` returns a new typed array with the elements in reverse order, leaving the original untouched.\n\nSee [`TypedArray.prototype.toReversed`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/toReversed) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nlet reversed = TypedArray.toReversed(view)\nTypedArray.toString(reversed) == \"3,2,1\"\nTypedArray.toString(view) == \"1,2,3\"\n```\n" + }, "insertText": "->TypedArray.toReversed", - "additionalTextEdits": [{ - "range": {"start": {"line": 13, "character": 15}, "end": {"line": 13, "character": 16}}, - "newText": "" - }] - }, { - "label": "->TypedArray.copyWithin", "kind": 12, - "tags": [], + "label": "->TypedArray.toReversed", + "sortText": "toReversed", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 13 }, + "start": { "character": 15, "line": 13 } + } + } + ], "detail": "(t<'a>, ~target: int, ~start: int, ~end: int=?) => array<'a>", - "documentation": {"kind": "markdown", "value": "\n`copyWithin(typedArray, ~target, ~start, ~end)` copies the section `[start, end)` onto the range beginning at `target`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.copyWithin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/copyWithin) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3, 4])\nlet _ = TypedArray.copyWithin(view, ~target=1, ~start=2, ~end=4)\nTypedArray.toString(view) == \"1,3,4,4\"\n```\n"}, - "sortText": "copyWithin", + "documentation": { + "kind": "markdown", + "value": "\n`copyWithin(typedArray, ~target, ~start, ~end)` copies the section `[start, end)` onto the range beginning at `target`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.copyWithin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/copyWithin) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3, 4])\nlet _ = TypedArray.copyWithin(view, ~target=1, ~start=2, ~end=4)\nTypedArray.toString(view) == \"1,3,4,4\"\n```\n" + }, "insertText": "->TypedArray.copyWithin", - "additionalTextEdits": [{ - "range": {"start": {"line": 13, "character": 15}, "end": {"line": 13, "character": 16}}, - "newText": "" - }] - }, { - "label": "->TypedArray.everyWithIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.copyWithin", + "sortText": "copyWithin", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 13 }, + "start": { "character": 15, "line": 13 } + } + } + ], "detail": "(t<'a>, ('a, int) => bool) => bool", - "documentation": {"kind": "markdown", "value": "\n`everyWithIndex(typedArray, checker)` is like `every` but provides the element index to `checker`.\n"}, - "sortText": "everyWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`everyWithIndex(typedArray, checker)` is like `every` but provides the element index to `checker`.\n" + }, "insertText": "->TypedArray.everyWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 13, "character": 15}, "end": {"line": 13, "character": 16}}, - "newText": "" - }] - }, { - "label": "->TypedArray.toString", "kind": 12, - "tags": [], + "label": "->TypedArray.everyWithIndex", + "sortText": "everyWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 13 }, + "start": { "character": 15, "line": 13 } + } + } + ], "detail": "t<'a> => string", - "documentation": {"kind": "markdown", "value": "\n`toString(typedArray)` returns a comma-separated string of the elements.\n\nSee [`TypedArray.prototype.toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/toString) on MDN.\n\n## Examples\n\n```rescript\nInt32Array.fromArray([1, 2])->TypedArray.toString == \"1,2\"\n```\n"}, - "sortText": "toString", + "documentation": { + "kind": "markdown", + "value": "\n`toString(typedArray)` returns a comma-separated string of the elements.\n\nSee [`TypedArray.prototype.toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/toString) on MDN.\n\n## Examples\n\n```rescript\nInt32Array.fromArray([1, 2])->TypedArray.toString == \"1,2\"\n```\n" + }, "insertText": "->TypedArray.toString", - "additionalTextEdits": [{ - "range": {"start": {"line": 13, "character": 15}, "end": {"line": 13, "character": 16}}, - "newText": "" - }] - }, { - "label": "->TypedArray.setArrayFrom", "kind": 12, - "tags": [], + "label": "->TypedArray.toString", + "sortText": "toString", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 13 }, + "start": { "character": 15, "line": 13 } + } + } + ], "detail": "(t<'a>, array<'a>, int) => unit", - "documentation": {"kind": "markdown", "value": "\n`setArrayFrom(target, source, index)` copies `source` into `target` starting at `index`.\n\nSee [`TypedArray.prototype.set`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/set) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([0, 0, 0])\nTypedArray.setArrayFrom(view, [5, 6], 1)\nTypedArray.toString(view) == \"0,5,6\"\n```\n"}, - "sortText": "setArrayFrom", + "documentation": { + "kind": "markdown", + "value": "\n`setArrayFrom(target, source, index)` copies `source` into `target` starting at `index`.\n\nSee [`TypedArray.prototype.set`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/set) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([0, 0, 0])\nTypedArray.setArrayFrom(view, [5, 6], 1)\nTypedArray.toString(view) == \"0,5,6\"\n```\n" + }, "insertText": "->TypedArray.setArrayFrom", - "additionalTextEdits": [{ - "range": {"start": {"line": 13, "character": 15}, "end": {"line": 13, "character": 16}}, - "newText": "" - }] - }, { - "label": "->TypedArray.forEach", "kind": 12, - "tags": [], + "label": "->TypedArray.setArrayFrom", + "sortText": "setArrayFrom", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 13 }, + "start": { "character": 15, "line": 13 } + } + } + ], "detail": "(t<'a>, 'a => unit) => unit", - "documentation": {"kind": "markdown", "value": "\n`forEach(typedArray, f)` runs `f` for every element in order.\n\nSee [`TypedArray.prototype.forEach`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/forEach) on MDN.\n"}, - "sortText": "forEach", + "documentation": { + "kind": "markdown", + "value": "\n`forEach(typedArray, f)` runs `f` for every element in order.\n\nSee [`TypedArray.prototype.forEach`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/forEach) on MDN.\n" + }, "insertText": "->TypedArray.forEach", - "additionalTextEdits": [{ - "range": {"start": {"line": 13, "character": 15}, "end": {"line": 13, "character": 16}}, - "newText": "" - }] - }, { - "label": "->TypedArray.findWithIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.forEach", + "sortText": "forEach", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 13 }, + "start": { "character": 15, "line": 13 } + } + } + ], "detail": "(t<'a>, ('a, int) => bool) => option<'a>", - "documentation": {"kind": "markdown", "value": "\n`findWithIndex(typedArray, predicate)` behaves like `find`, but `predicate` also receives the index.\n"}, - "sortText": "findWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`findWithIndex(typedArray, predicate)` behaves like `find`, but `predicate` also receives the index.\n" + }, "insertText": "->TypedArray.findWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 13, "character": 15}, "end": {"line": 13, "character": 16}}, - "newText": "" - }] - }, { - "label": "->TypedArray.fill", "kind": 12, - "tags": [], + "label": "->TypedArray.findWithIndex", + "sortText": "findWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 13 }, + "start": { "character": 15, "line": 13 } + } + } + ], "detail": "(t<'a>, 'a, ~start: int, ~end: int=?) => t<'a>", - "documentation": {"kind": "markdown", "value": "\n`fill(typedArray, value, ~start, ~end)` fills the half-open interval `[start, end)` with `value`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.fill`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/fill) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3, 4])\nlet _ = TypedArray.fill(view, 0, ~start=1, ~end=3)\nTypedArray.toString(view) == \"1,0,0,4\"\n```\n"}, - "sortText": "fill", + "documentation": { + "kind": "markdown", + "value": "\n`fill(typedArray, value, ~start, ~end)` fills the half-open interval `[start, end)` with `value`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.fill`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/fill) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3, 4])\nlet _ = TypedArray.fill(view, 0, ~start=1, ~end=3)\nTypedArray.toString(view) == \"1,0,0,4\"\n```\n" + }, "insertText": "->TypedArray.fill", - "additionalTextEdits": [{ - "range": {"start": {"line": 13, "character": 15}, "end": {"line": 13, "character": 16}}, - "newText": "" - }] - }, { - "label": "->TypedArray.indexOfFrom", "kind": 12, - "tags": [], + "label": "->TypedArray.fill", + "sortText": "fill", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 13 }, + "start": { "character": 15, "line": 13 } + } + } + ], "detail": "(t<'a>, 'a, int) => int", - "documentation": {"kind": "markdown", "value": "\n`indexOfFrom(typedArray, value, fromIndex)` searches for `value` starting at `fromIndex`.\n"}, - "sortText": "indexOfFrom", + "documentation": { + "kind": "markdown", + "value": "\n`indexOfFrom(typedArray, value, fromIndex)` searches for `value` starting at `fromIndex`.\n" + }, "insertText": "->TypedArray.indexOfFrom", - "additionalTextEdits": [{ - "range": {"start": {"line": 13, "character": 15}, "end": {"line": 13, "character": 16}}, - "newText": "" - }] - }, { - "label": "->TypedArray.reverse", "kind": 12, - "tags": [], + "label": "->TypedArray.indexOfFrom", + "sortText": "indexOfFrom", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 13 }, + "start": { "character": 15, "line": 13 } + } + } + ], "detail": "t<'a> => unit", - "documentation": {"kind": "markdown", "value": "\n`reverse(typedArray)` reverses the elements of the view in place.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.reverse`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/reverse) on MDN.\n"}, - "sortText": "reverse", + "documentation": { + "kind": "markdown", + "value": "\n`reverse(typedArray)` reverses the elements of the view in place.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.reverse`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/reverse) on MDN.\n" + }, "insertText": "->TypedArray.reverse", - "additionalTextEdits": [{ - "range": {"start": {"line": 13, "character": 15}, "end": {"line": 13, "character": 16}}, - "newText": "" - }] - }, { - "label": "->TypedArray.byteOffset", "kind": 12, - "tags": [], + "label": "->TypedArray.reverse", + "sortText": "reverse", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 13 }, + "start": { "character": 15, "line": 13 } + } + } + ], "detail": "t<'a> => int", - "documentation": {"kind": "markdown", "value": "\n`byteOffset(typedArray)` returns the offset in bytes from the start of the buffer.\n\nSee [`TypedArray.prototype.byteOffset`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/byteOffset) on MDN.\n"}, - "sortText": "byteOffset", + "documentation": { + "kind": "markdown", + "value": "\n`byteOffset(typedArray)` returns the offset in bytes from the start of the buffer.\n\nSee [`TypedArray.prototype.byteOffset`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/byteOffset) on MDN.\n" + }, "insertText": "->TypedArray.byteOffset", - "additionalTextEdits": [{ - "range": {"start": {"line": 13, "character": 15}, "end": {"line": 13, "character": 16}}, - "newText": "" - }] - }] + "kind": 12, + "label": "->TypedArray.byteOffset", + "sortText": "byteOffset", + "tags": [] + } +] Complete src/CompletionTypedArrays.res 17:14 posCursor:[17:14] posNoWhite:[17:13] Found expr:[17:3->17:14] @@ -2774,679 +4810,1188 @@ CPPipe pathFromEnv:Stdlib.Int16Array found:false Path Stdlib.Int16Array. Path Stdlib.TypedArray. Path -[{ - "label": "->Int16Array.ignore", - "kind": 12, - "tags": [], +[ + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 17 }, + "start": { "character": 13, "line": 17 } + } + } + ], "detail": "t => unit", - "documentation": {"kind": "markdown", "value": "\n `ignore(intArray)` ignores the provided intArray and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further.\n"}, - "sortText": "ignore", + "documentation": { + "kind": "markdown", + "value": "\n `ignore(intArray)` ignores the provided intArray and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further.\n" + }, "insertText": "->Int16Array.ignore", - "additionalTextEdits": [{ - "range": {"start": {"line": 17, "character": 13}, "end": {"line": 17, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.findLastIndexWithIndex", "kind": 12, - "tags": [], + "label": "->Int16Array.ignore", + "sortText": "ignore", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 17 }, + "start": { "character": 13, "line": 17 } + } + } + ], "detail": "(t<'a>, ('a, int) => bool) => int", - "documentation": {"kind": "markdown", "value": "\n`findLastIndexWithIndex(typedArray, predicate)` is the indexed variant of `findLastIndex`.\n"}, - "sortText": "findLastIndexWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`findLastIndexWithIndex(typedArray, predicate)` is the indexed variant of `findLastIndex`.\n" + }, "insertText": "->TypedArray.findLastIndexWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 17, "character": 13}, "end": {"line": 17, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.lastIndexOf", "kind": 12, - "tags": [], + "label": "->TypedArray.findLastIndexWithIndex", + "sortText": "findLastIndexWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 17 }, + "start": { "character": 13, "line": 17 } + } + } + ], "detail": "(t<'a>, 'a) => int", - "documentation": {"kind": "markdown", "value": "\n`lastIndexOf(typedArray, value)` returns the last index of `value`, or `-1` if not found.\n\nSee [`TypedArray.prototype.lastIndexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/lastIndexOf) on MDN.\n"}, - "sortText": "lastIndexOf", + "documentation": { + "kind": "markdown", + "value": "\n`lastIndexOf(typedArray, value)` returns the last index of `value`, or `-1` if not found.\n\nSee [`TypedArray.prototype.lastIndexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/lastIndexOf) on MDN.\n" + }, "insertText": "->TypedArray.lastIndexOf", - "additionalTextEdits": [{ - "range": {"start": {"line": 17, "character": 13}, "end": {"line": 17, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.findLastWithIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.lastIndexOf", + "sortText": "lastIndexOf", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 17 }, + "start": { "character": 13, "line": 17 } + } + } + ], "detail": "(t<'a>, ('a, int) => bool) => option<'a>", - "documentation": {"kind": "markdown", "value": "\n`findLastWithIndex(typedArray, predicate)` is the indexed variant of `findLast`.\n"}, - "sortText": "findLastWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`findLastWithIndex(typedArray, predicate)` is the indexed variant of `findLast`.\n" + }, "insertText": "->TypedArray.findLastWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 17, "character": 13}, "end": {"line": 17, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.findLast", "kind": 12, - "tags": [], + "label": "->TypedArray.findLastWithIndex", + "sortText": "findLastWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 17 }, + "start": { "character": 13, "line": 17 } + } + } + ], "detail": "(t<'a>, 'a => bool) => option<'a>", - "documentation": {"kind": "markdown", "value": "\n`findLast(typedArray, predicate)` returns the last element that satisfies `predicate`.\n\nSee [`TypedArray.prototype.findLast`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/findLast) on MDN.\n"}, - "sortText": "findLast", + "documentation": { + "kind": "markdown", + "value": "\n`findLast(typedArray, predicate)` returns the last element that satisfies `predicate`.\n\nSee [`TypedArray.prototype.findLast`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/findLast) on MDN.\n" + }, "insertText": "->TypedArray.findLast", - "additionalTextEdits": [{ - "range": {"start": {"line": 17, "character": 13}, "end": {"line": 17, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.filter", "kind": 12, - "tags": [], + "label": "->TypedArray.findLast", + "sortText": "findLast", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 17 }, + "start": { "character": 13, "line": 17 } + } + } + ], "detail": "(t<'a>, 'a => bool) => t<'a>", - "documentation": {"kind": "markdown", "value": "\n`filter(typedArray, predicate)` returns a new typed array containing only elements that satisfy `predicate`.\n\nSee [`TypedArray.prototype.filter`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/filter) on MDN.\n"}, - "sortText": "filter", + "documentation": { + "kind": "markdown", + "value": "\n`filter(typedArray, predicate)` returns a new typed array containing only elements that satisfy `predicate`.\n\nSee [`TypedArray.prototype.filter`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/filter) on MDN.\n" + }, "insertText": "->TypedArray.filter", - "additionalTextEdits": [{ - "range": {"start": {"line": 17, "character": 13}, "end": {"line": 17, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.byteLength", "kind": 12, - "tags": [], + "label": "->TypedArray.filter", + "sortText": "filter", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 17 }, + "start": { "character": 13, "line": 17 } + } + } + ], "detail": "t<'a> => int", - "documentation": {"kind": "markdown", "value": "\n`byteLength(typedArray)` returns the length in bytes of the view.\n\nSee [`TypedArray.prototype.byteLength`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/byteLength) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2])\nTypedArray.byteLength(view) == 8\n```\n"}, - "sortText": "byteLength", + "documentation": { + "kind": "markdown", + "value": "\n`byteLength(typedArray)` returns the length in bytes of the view.\n\nSee [`TypedArray.prototype.byteLength`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/byteLength) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2])\nTypedArray.byteLength(view) == 8\n```\n" + }, "insertText": "->TypedArray.byteLength", - "additionalTextEdits": [{ - "range": {"start": {"line": 17, "character": 13}, "end": {"line": 17, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.ignore", "kind": 12, - "tags": [], + "label": "->TypedArray.byteLength", + "sortText": "byteLength", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 17 }, + "start": { "character": 13, "line": 17 } + } + } + ], "detail": "t<'a> => unit", - "documentation": {"kind": "markdown", "value": "\n `ignore(typedArray)` ignores the provided typedArray and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further.\n"}, - "sortText": "ignore", + "documentation": { + "kind": "markdown", + "value": "\n `ignore(typedArray)` ignores the provided typedArray and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further.\n" + }, "insertText": "->TypedArray.ignore", - "additionalTextEdits": [{ - "range": {"start": {"line": 17, "character": 13}, "end": {"line": 17, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.reduceRightWithIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.ignore", + "sortText": "ignore", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 17 }, + "start": { "character": 13, "line": 17 } + } + } + ], "detail": "(t<'a>, ('b, 'a, int) => 'b, 'b) => 'b", - "documentation": {"kind": "markdown", "value": "\n`reduceRightWithIndex(typedArray, reducer, initial)` is the indexed variant of `reduceRight`.\n"}, - "sortText": "reduceRightWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`reduceRightWithIndex(typedArray, reducer, initial)` is the indexed variant of `reduceRight`.\n" + }, "insertText": "->TypedArray.reduceRightWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 17, "character": 13}, "end": {"line": 17, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.reduceRight", "kind": 12, - "tags": [], + "label": "->TypedArray.reduceRightWithIndex", + "sortText": "reduceRightWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 17 }, + "start": { "character": 13, "line": 17 } + } + } + ], "detail": "(t<'a>, ('b, 'a) => 'b, 'b) => 'b", - "documentation": {"kind": "markdown", "value": "\n`reduceRight(typedArray, reducer, initial)` is like `reduce` but processes the elements from right to left.\n\nSee [`TypedArray.prototype.reduceRight`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/reduceRight) on MDN.\n"}, - "sortText": "reduceRight", + "documentation": { + "kind": "markdown", + "value": "\n`reduceRight(typedArray, reducer, initial)` is like `reduce` but processes the elements from right to left.\n\nSee [`TypedArray.prototype.reduceRight`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/reduceRight) on MDN.\n" + }, "insertText": "->TypedArray.reduceRight", - "additionalTextEdits": [{ - "range": {"start": {"line": 17, "character": 13}, "end": {"line": 17, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.joinWith", "kind": 12, - "tags": [], + "label": "->TypedArray.reduceRight", + "sortText": "reduceRight", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 17 }, + "start": { "character": 13, "line": 17 } + } + } + ], "detail": "(t<'a>, string) => string", - "documentation": {"kind": "markdown", "value": "\n`joinWith(typedArray, separator)` returns a string formed by the elements joined with `separator`.\n\nSee [`TypedArray.prototype.join`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/join) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nTypedArray.joinWith(view, \"-\") == \"1-2-3\"\n```\n"}, - "sortText": "joinWith", + "documentation": { + "kind": "markdown", + "value": "\n`joinWith(typedArray, separator)` returns a string formed by the elements joined with `separator`.\n\nSee [`TypedArray.prototype.join`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/join) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nTypedArray.joinWith(view, \"-\") == \"1-2-3\"\n```\n" + }, "insertText": "->TypedArray.joinWith", - "additionalTextEdits": [{ - "range": {"start": {"line": 17, "character": 13}, "end": {"line": 17, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.buffer", "kind": 12, - "tags": [], + "label": "->TypedArray.joinWith", + "sortText": "joinWith", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 17 }, + "start": { "character": 13, "line": 17 } + } + } + ], "detail": "t<'a> => ArrayBuffer.t", - "documentation": {"kind": "markdown", "value": "\n`buffer(typedArray)` returns the underlying `ArrayBuffer` backing this view.\n\nSee [`TypedArray.prototype.buffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/buffer) on MDN.\n"}, - "sortText": "buffer", + "documentation": { + "kind": "markdown", + "value": "\n`buffer(typedArray)` returns the underlying `ArrayBuffer` backing this view.\n\nSee [`TypedArray.prototype.buffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/buffer) on MDN.\n" + }, "insertText": "->TypedArray.buffer", - "additionalTextEdits": [{ - "range": {"start": {"line": 17, "character": 13}, "end": {"line": 17, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.reduce", "kind": 12, - "tags": [], + "label": "->TypedArray.buffer", + "sortText": "buffer", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 17 }, + "start": { "character": 13, "line": 17 } + } + } + ], "detail": "(t<'a>, ('b, 'a) => 'b, 'b) => 'b", - "documentation": {"kind": "markdown", "value": "\n`reduce(typedArray, reducer, initial)` combines the elements from left to right using `reducer`.\n\nSee [`TypedArray.prototype.reduce`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/reduce) on MDN.\n"}, - "sortText": "reduce", + "documentation": { + "kind": "markdown", + "value": "\n`reduce(typedArray, reducer, initial)` combines the elements from left to right using `reducer`.\n\nSee [`TypedArray.prototype.reduce`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/reduce) on MDN.\n" + }, "insertText": "->TypedArray.reduce", - "additionalTextEdits": [{ - "range": {"start": {"line": 17, "character": 13}, "end": {"line": 17, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.forEachWithIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.reduce", + "sortText": "reduce", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 17 }, + "start": { "character": 13, "line": 17 } + } + } + ], "detail": "(t<'a>, ('a, int) => unit) => unit", - "documentation": {"kind": "markdown", "value": "\n`forEachWithIndex(typedArray, f)` runs `f` for every element, also providing the index.\n"}, - "sortText": "forEachWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`forEachWithIndex(typedArray, f)` runs `f` for every element, also providing the index.\n" + }, "insertText": "->TypedArray.forEachWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 17, "character": 13}, "end": {"line": 17, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.copy", "kind": 12, - "tags": [], + "label": "->TypedArray.forEachWithIndex", + "sortText": "forEachWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 17 }, + "start": { "character": 13, "line": 17 } + } + } + ], "detail": "t<'a> => t<'a>", - "documentation": {"kind": "markdown", "value": "\n`copy(typedArray)` produces a shallow copy of the typed array.\n"}, - "sortText": "copy", + "documentation": { + "kind": "markdown", + "value": "\n`copy(typedArray)` produces a shallow copy of the typed array.\n" + }, "insertText": "->TypedArray.copy", - "additionalTextEdits": [{ - "range": {"start": {"line": 17, "character": 13}, "end": {"line": 17, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.someWithIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.copy", + "sortText": "copy", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 17 }, + "start": { "character": 13, "line": 17 } + } + } + ], "detail": "(t<'a>, ('a, int) => bool) => bool", - "documentation": {"kind": "markdown", "value": "\n`someWithIndex(typedArray, predicate)` behaves like `some`, but `predicate` also receives the element index.\n"}, - "sortText": "someWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`someWithIndex(typedArray, predicate)` behaves like `some`, but `predicate` also receives the element index.\n" + }, "insertText": "->TypedArray.someWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 17, "character": 13}, "end": {"line": 17, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.findIndexWithIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.someWithIndex", + "sortText": "someWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 17 }, + "start": { "character": 13, "line": 17 } + } + } + ], "detail": "(t<'a>, ('a, int) => bool) => int", - "documentation": {"kind": "markdown", "value": "\n`findIndexWithIndex(typedArray, predicate)` is the indexed variant of `findIndex`.\n"}, - "sortText": "findIndexWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`findIndexWithIndex(typedArray, predicate)` is the indexed variant of `findIndex`.\n" + }, "insertText": "->TypedArray.findIndexWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 17, "character": 13}, "end": {"line": 17, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.sliceToEnd", "kind": 12, - "tags": [1], + "label": "->TypedArray.findIndexWithIndex", + "sortText": "findIndexWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 17 }, + "start": { "character": 13, "line": 17 } + } + } + ], + "deprecated": true, "detail": "(t<'a>, ~start: int) => t<'a>", - "documentation": {"kind": "markdown", "value": "Deprecated: Use `slice` instead\n\n\n`sliceToEnd(typedArray, ~start)` returns the elements from `start` through the end in a new typed array.\n"}, - "sortText": "sliceToEnd", + "documentation": { + "kind": "markdown", + "value": "Deprecated: Use `slice` instead\n\n\n`sliceToEnd(typedArray, ~start)` returns the elements from `start` through the end in a new typed array.\n" + }, "insertText": "->TypedArray.sliceToEnd", - "additionalTextEdits": [{ - "range": {"start": {"line": 17, "character": 13}, "end": {"line": 17, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.slice", "kind": 12, - "tags": [], + "label": "->TypedArray.sliceToEnd", + "sortText": "sliceToEnd", + "tags": [ 1 ] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 17 }, + "start": { "character": 13, "line": 17 } + } + } + ], "detail": "(t<'a>, ~start: int, ~end: int=?) => t<'a>", - "documentation": {"kind": "markdown", "value": "\n`slice(typedArray, ~start, ~end)` returns a new typed array containing the elements in `[start, end)`.\n\nSee [`TypedArray.prototype.slice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/slice) on MDN.\n"}, - "sortText": "slice", + "documentation": { + "kind": "markdown", + "value": "\n`slice(typedArray, ~start, ~end)` returns a new typed array containing the elements in `[start, end)`.\n\nSee [`TypedArray.prototype.slice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/slice) on MDN.\n" + }, "insertText": "->TypedArray.slice", - "additionalTextEdits": [{ - "range": {"start": {"line": 17, "character": 13}, "end": {"line": 17, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.findLastIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.slice", + "sortText": "slice", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 17 }, + "start": { "character": 13, "line": 17 } + } + } + ], "detail": "(t<'a>, 'a => bool) => int", - "documentation": {"kind": "markdown", "value": "\n`findLastIndex(typedArray, predicate)` returns the index of the last matching element, or `-1` if none do.\n\nSee [`TypedArray.prototype.findLastIndex`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/findLastIndex) on MDN.\n"}, - "sortText": "findLastIndex", + "documentation": { + "kind": "markdown", + "value": "\n`findLastIndex(typedArray, predicate)` returns the index of the last matching element, or `-1` if none do.\n\nSee [`TypedArray.prototype.findLastIndex`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/findLastIndex) on MDN.\n" + }, "insertText": "->TypedArray.findLastIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 17, "character": 13}, "end": {"line": 17, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.includes", "kind": 12, - "tags": [], + "label": "->TypedArray.findLastIndex", + "sortText": "findLastIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 17 }, + "start": { "character": 13, "line": 17 } + } + } + ], "detail": "(t<'a>, 'a) => bool", - "documentation": {"kind": "markdown", "value": "\n`includes(typedArray, value)` returns `true` if `value` occurs in the typed array.\n\nSee [`TypedArray.prototype.includes`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/includes) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nTypedArray.includes(view, 2) == true\nTypedArray.includes(view, 10) == false\n```\n"}, - "sortText": "includes", + "documentation": { + "kind": "markdown", + "value": "\n`includes(typedArray, value)` returns `true` if `value` occurs in the typed array.\n\nSee [`TypedArray.prototype.includes`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/includes) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nTypedArray.includes(view, 2) == true\nTypedArray.includes(view, 10) == false\n```\n" + }, "insertText": "->TypedArray.includes", - "additionalTextEdits": [{ - "range": {"start": {"line": 17, "character": 13}, "end": {"line": 17, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.fillToEnd", "kind": 12, - "tags": [1], + "label": "->TypedArray.includes", + "sortText": "includes", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 17 }, + "start": { "character": 13, "line": 17 } + } + } + ], + "deprecated": true, "detail": "(t<'a>, 'a, ~start: int) => t<'a>", - "documentation": {"kind": "markdown", "value": "Deprecated: Use `fill` instead\n\n\n`fillToEnd(typedArray, value, ~start)` fills from `start` through the end with `value`.\n\nBeware this will *mutate* the typed array.\n"}, - "sortText": "fillToEnd", + "documentation": { + "kind": "markdown", + "value": "Deprecated: Use `fill` instead\n\n\n`fillToEnd(typedArray, value, ~start)` fills from `start` through the end with `value`.\n\nBeware this will *mutate* the typed array.\n" + }, "insertText": "->TypedArray.fillToEnd", - "additionalTextEdits": [{ - "range": {"start": {"line": 17, "character": 13}, "end": {"line": 17, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.fillAll", "kind": 12, - "tags": [], + "label": "->TypedArray.fillToEnd", + "sortText": "fillToEnd", + "tags": [ 1 ] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 17 }, + "start": { "character": 13, "line": 17 } + } + } + ], "detail": "(t<'a>, 'a) => t<'a>", - "documentation": {"kind": "markdown", "value": "\n`fillAll(typedArray, value)` fills every element with `value`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.fill`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/fill) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nlet _ = TypedArray.fillAll(view, 9)\nTypedArray.toString(view) == \"9,9,9\"\n```\n"}, - "sortText": "fillAll", + "documentation": { + "kind": "markdown", + "value": "\n`fillAll(typedArray, value)` fills every element with `value`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.fill`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/fill) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nlet _ = TypedArray.fillAll(view, 9)\nTypedArray.toString(view) == \"9,9,9\"\n```\n" + }, "insertText": "->TypedArray.fillAll", - "additionalTextEdits": [{ - "range": {"start": {"line": 17, "character": 13}, "end": {"line": 17, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.find", "kind": 12, - "tags": [], + "label": "->TypedArray.fillAll", + "sortText": "fillAll", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 17 }, + "start": { "character": 13, "line": 17 } + } + } + ], "detail": "(t<'a>, 'a => bool) => option<'a>", - "documentation": {"kind": "markdown", "value": "\n`find(typedArray, predicate)` returns the first element that satisfies `predicate`, or `None` if nothing matches.\n\nSee [`TypedArray.prototype.find`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/find) on MDN.\n"}, - "sortText": "find", + "documentation": { + "kind": "markdown", + "value": "\n`find(typedArray, predicate)` returns the first element that satisfies `predicate`, or `None` if nothing matches.\n\nSee [`TypedArray.prototype.find`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/find) on MDN.\n" + }, "insertText": "->TypedArray.find", - "additionalTextEdits": [{ - "range": {"start": {"line": 17, "character": 13}, "end": {"line": 17, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.subarrayToEnd", "kind": 12, - "tags": [1], + "label": "->TypedArray.find", + "sortText": "find", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 17 }, + "start": { "character": 13, "line": 17 } + } + } + ], + "deprecated": true, "detail": "(t<'a>, ~start: int) => t<'a>", - "documentation": {"kind": "markdown", "value": "Deprecated: Use `subarray` instead\n\n\n`subarrayToEnd(typedArray, ~start)` returns a new view from `start` to the end of the buffer.\n"}, - "sortText": "subarrayToEnd", + "documentation": { + "kind": "markdown", + "value": "Deprecated: Use `subarray` instead\n\n\n`subarrayToEnd(typedArray, ~start)` returns a new view from `start` to the end of the buffer.\n" + }, "insertText": "->TypedArray.subarrayToEnd", - "additionalTextEdits": [{ - "range": {"start": {"line": 17, "character": 13}, "end": {"line": 17, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.set", "kind": 12, - "tags": [], + "label": "->TypedArray.subarrayToEnd", + "sortText": "subarrayToEnd", + "tags": [ 1 ] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 17 }, + "start": { "character": 13, "line": 17 } + } + } + ], "detail": "(t<'a>, int, 'a) => unit", - "documentation": {"kind": "markdown", "value": "\n`set(typedArray, index, item)` sets the provided `item` at `index` of `typedArray`.\n\nBeware this will *mutate* the array.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2])\nTypedArray.set(view, 1, 5)\nTypedArray.get(view, 1) == Some(5)\n```\n"}, - "sortText": "set", + "documentation": { + "kind": "markdown", + "value": "\n`set(typedArray, index, item)` sets the provided `item` at `index` of `typedArray`.\n\nBeware this will *mutate* the array.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2])\nTypedArray.set(view, 1, 5)\nTypedArray.get(view, 1) == Some(5)\n```\n" + }, "insertText": "->TypedArray.set", - "additionalTextEdits": [{ - "range": {"start": {"line": 17, "character": 13}, "end": {"line": 17, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.toLocaleString", "kind": 12, - "tags": [], + "label": "->TypedArray.set", + "sortText": "set", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 17 }, + "start": { "character": 13, "line": 17 } + } + } + ], "detail": "t<'a> => string", - "documentation": {"kind": "markdown", "value": "\n`toLocaleString(typedArray)` concatenates the elements using locale-aware formatting.\n\nSee [`TypedArray.prototype.toLocaleString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/toLocaleString) on MDN.\n"}, - "sortText": "toLocaleString", + "documentation": { + "kind": "markdown", + "value": "\n`toLocaleString(typedArray)` concatenates the elements using locale-aware formatting.\n\nSee [`TypedArray.prototype.toLocaleString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/toLocaleString) on MDN.\n" + }, "insertText": "->TypedArray.toLocaleString", - "additionalTextEdits": [{ - "range": {"start": {"line": 17, "character": 13}, "end": {"line": 17, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.lastIndexOfFrom", "kind": 12, - "tags": [], + "label": "->TypedArray.toLocaleString", + "sortText": "toLocaleString", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 17 }, + "start": { "character": 13, "line": 17 } + } + } + ], "detail": "(t<'a>, 'a, int) => int", - "documentation": {"kind": "markdown", "value": "\n`lastIndexOfFrom(typedArray, value, fromIndex)` searches backwards starting at `fromIndex`.\n"}, - "sortText": "lastIndexOfFrom", + "documentation": { + "kind": "markdown", + "value": "\n`lastIndexOfFrom(typedArray, value, fromIndex)` searches backwards starting at `fromIndex`.\n" + }, "insertText": "->TypedArray.lastIndexOfFrom", - "additionalTextEdits": [{ - "range": {"start": {"line": 17, "character": 13}, "end": {"line": 17, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.findIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.lastIndexOfFrom", + "sortText": "lastIndexOfFrom", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 17 }, + "start": { "character": 13, "line": 17 } + } + } + ], "detail": "(t<'a>, 'a => bool) => int", - "documentation": {"kind": "markdown", "value": "\n`findIndex(typedArray, predicate)` returns the index of the first element that satisfies `predicate`, or `-1` if none do.\n\nSee [`TypedArray.prototype.findIndex`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/findIndex) on MDN.\n"}, - "sortText": "findIndex", + "documentation": { + "kind": "markdown", + "value": "\n`findIndex(typedArray, predicate)` returns the index of the first element that satisfies `predicate`, or `-1` if none do.\n\nSee [`TypedArray.prototype.findIndex`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/findIndex) on MDN.\n" + }, "insertText": "->TypedArray.findIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 17, "character": 13}, "end": {"line": 17, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.filterWithIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.findIndex", + "sortText": "findIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 17 }, + "start": { "character": 13, "line": 17 } + } + } + ], "detail": "(t<'a>, ('a, int) => bool) => t<'a>", - "documentation": {"kind": "markdown", "value": "\n`filterWithIndex(typedArray, predicate)` behaves like `filter` but also passes the index to `predicate`.\n"}, - "sortText": "filterWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`filterWithIndex(typedArray, predicate)` behaves like `filter` but also passes the index to `predicate`.\n" + }, "insertText": "->TypedArray.filterWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 17, "character": 13}, "end": {"line": 17, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.sort", "kind": 12, - "tags": [], + "label": "->TypedArray.filterWithIndex", + "sortText": "filterWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 17 }, + "start": { "character": 13, "line": 17 } + } + } + ], "detail": "(t<'a>, ('a, 'a) => Ordering.t) => unit", - "documentation": {"kind": "markdown", "value": "\n`sort(typedArray, comparator)` sorts the values in place using `comparator`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.sort`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/sort) on MDN.\n"}, - "sortText": "sort", + "documentation": { + "kind": "markdown", + "value": "\n`sort(typedArray, comparator)` sorts the values in place using `comparator`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.sort`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/sort) on MDN.\n" + }, "insertText": "->TypedArray.sort", - "additionalTextEdits": [{ - "range": {"start": {"line": 17, "character": 13}, "end": {"line": 17, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.mapWithIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.sort", + "sortText": "sort", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 17 }, + "start": { "character": 13, "line": 17 } + } + } + ], "detail": "(t<'a>, ('a, int) => 'b) => t<'b>", - "documentation": {"kind": "markdown", "value": "\n`mapWithIndex(typedArray, f)` behaves like `map`, but `f` also receives the index.\n"}, - "sortText": "mapWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`mapWithIndex(typedArray, f)` behaves like `map`, but `f` also receives the index.\n" + }, "insertText": "->TypedArray.mapWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 17, "character": 13}, "end": {"line": 17, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.every", "kind": 12, - "tags": [], + "label": "->TypedArray.mapWithIndex", + "sortText": "mapWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 17 }, + "start": { "character": 13, "line": 17 } + } + } + ], "detail": "(t<'a>, 'a => bool) => bool", - "documentation": {"kind": "markdown", "value": "\n`every(typedArray, predicate)` returns `true` if `predicate` returns `true` for every element.\n\nSee [`TypedArray.prototype.every`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/every) on MDN.\n"}, - "sortText": "every", + "documentation": { + "kind": "markdown", + "value": "\n`every(typedArray, predicate)` returns `true` if `predicate` returns `true` for every element.\n\nSee [`TypedArray.prototype.every`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/every) on MDN.\n" + }, "insertText": "->TypedArray.every", - "additionalTextEdits": [{ - "range": {"start": {"line": 17, "character": 13}, "end": {"line": 17, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.length", "kind": 12, - "tags": [], + "label": "->TypedArray.every", + "sortText": "every", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 17 }, + "start": { "character": 13, "line": 17 } + } + } + ], "detail": "t<'a> => int", - "documentation": {"kind": "markdown", "value": "\n`length(typedArray)` returns the number of elements.\n\nSee [`TypedArray.prototype.length`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/length) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nTypedArray.length(view) == 3\n```\n"}, - "sortText": "length", + "documentation": { + "kind": "markdown", + "value": "\n`length(typedArray)` returns the number of elements.\n\nSee [`TypedArray.prototype.length`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/length) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nTypedArray.length(view) == 3\n```\n" + }, "insertText": "->TypedArray.length", - "additionalTextEdits": [{ - "range": {"start": {"line": 17, "character": 13}, "end": {"line": 17, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.indexOf", "kind": 12, - "tags": [], + "label": "->TypedArray.length", + "sortText": "length", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 17 }, + "start": { "character": 13, "line": 17 } + } + } + ], "detail": "(t<'a>, 'a) => int", - "documentation": {"kind": "markdown", "value": "\n`indexOf(typedArray, value)` returns the first index of `value`, or `-1` when not found.\n\nSee [`TypedArray.prototype.indexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/indexOf) on MDN.\n"}, - "sortText": "indexOf", + "documentation": { + "kind": "markdown", + "value": "\n`indexOf(typedArray, value)` returns the first index of `value`, or `-1` when not found.\n\nSee [`TypedArray.prototype.indexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/indexOf) on MDN.\n" + }, "insertText": "->TypedArray.indexOf", - "additionalTextEdits": [{ - "range": {"start": {"line": 17, "character": 13}, "end": {"line": 17, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.copyWithinToEnd", "kind": 12, - "tags": [1], + "label": "->TypedArray.indexOf", + "sortText": "indexOf", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 17 }, + "start": { "character": 13, "line": 17 } + } + } + ], + "deprecated": true, "detail": "(t<'a>, ~target: int, ~start: int) => array<'a>", - "documentation": {"kind": "markdown", "value": "Deprecated: Use `copyWithin` instead\n\n\n`copyWithinToEnd(typedArray, ~target, ~start)` copies values from `start` through the end of the view into the range beginning at `target`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.copyWithin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/copyWithin) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3, 4])\nlet _ = TypedArray.copyWithinToEnd(view, ~target=0, ~start=2)\nTypedArray.toString(view) == \"3,4,3,4\"\n```\n"}, - "sortText": "copyWithinToEnd", + "documentation": { + "kind": "markdown", + "value": "Deprecated: Use `copyWithin` instead\n\n\n`copyWithinToEnd(typedArray, ~target, ~start)` copies values from `start` through the end of the view into the range beginning at `target`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.copyWithin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/copyWithin) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3, 4])\nlet _ = TypedArray.copyWithinToEnd(view, ~target=0, ~start=2)\nTypedArray.toString(view) == \"3,4,3,4\"\n```\n" + }, "insertText": "->TypedArray.copyWithinToEnd", - "additionalTextEdits": [{ - "range": {"start": {"line": 17, "character": 13}, "end": {"line": 17, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.some", "kind": 12, - "tags": [], + "label": "->TypedArray.copyWithinToEnd", + "sortText": "copyWithinToEnd", + "tags": [ 1 ] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 17 }, + "start": { "character": 13, "line": 17 } + } + } + ], "detail": "(t<'a>, 'a => bool) => bool", - "documentation": {"kind": "markdown", "value": "\n`some(typedArray, predicate)` returns `true` if `predicate` returns `true` for at least one element.\n\nSee [`TypedArray.prototype.some`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/some) on MDN.\n"}, - "sortText": "some", + "documentation": { + "kind": "markdown", + "value": "\n`some(typedArray, predicate)` returns `true` if `predicate` returns `true` for at least one element.\n\nSee [`TypedArray.prototype.some`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/some) on MDN.\n" + }, "insertText": "->TypedArray.some", - "additionalTextEdits": [{ - "range": {"start": {"line": 17, "character": 13}, "end": {"line": 17, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.reduceWithIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.some", + "sortText": "some", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 17 }, + "start": { "character": 13, "line": 17 } + } + } + ], "detail": "(t<'a>, ('b, 'a, int) => 'b, 'b) => 'b", - "documentation": {"kind": "markdown", "value": "\n`reduceWithIndex(typedArray, reducer, initial)` is the indexed variant of `reduce`.\n"}, - "sortText": "reduceWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`reduceWithIndex(typedArray, reducer, initial)` is the indexed variant of `reduce`.\n" + }, "insertText": "->TypedArray.reduceWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 17, "character": 13}, "end": {"line": 17, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.map", "kind": 12, - "tags": [], + "label": "->TypedArray.reduceWithIndex", + "sortText": "reduceWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 17 }, + "start": { "character": 13, "line": 17 } + } + } + ], "detail": "(t<'a>, 'a => 'b) => t<'b>", - "documentation": {"kind": "markdown", "value": "\n`map(typedArray, f)` returns a new typed array whose elements are produced by applying `f` to each element.\n\nSee [`TypedArray.prototype.map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/map) on MDN.\n"}, - "sortText": "map", + "documentation": { + "kind": "markdown", + "value": "\n`map(typedArray, f)` returns a new typed array whose elements are produced by applying `f` to each element.\n\nSee [`TypedArray.prototype.map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/map) on MDN.\n" + }, "insertText": "->TypedArray.map", - "additionalTextEdits": [{ - "range": {"start": {"line": 17, "character": 13}, "end": {"line": 17, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.toSorted", "kind": 12, - "tags": [], + "label": "->TypedArray.map", + "sortText": "map", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 17 }, + "start": { "character": 13, "line": 17 } + } + } + ], "detail": "(t<'a>, ('a, 'a) => Ordering.t) => t<'a>", - "documentation": {"kind": "markdown", "value": "\n`toSorted(typedArray, comparator)` returns a new typed array containing the sorted values, leaving the original untouched.\n\nSee [`TypedArray.prototype.toSorted`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/toSorted) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([3, 1, 2])\nlet sorted = TypedArray.toSorted(view, Int.compare)\nTypedArray.toString(sorted) == \"1,2,3\"\nTypedArray.toString(view) == \"3,1,2\"\n```\n"}, - "sortText": "toSorted", + "documentation": { + "kind": "markdown", + "value": "\n`toSorted(typedArray, comparator)` returns a new typed array containing the sorted values, leaving the original untouched.\n\nSee [`TypedArray.prototype.toSorted`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/toSorted) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([3, 1, 2])\nlet sorted = TypedArray.toSorted(view, Int.compare)\nTypedArray.toString(sorted) == \"1,2,3\"\nTypedArray.toString(view) == \"3,1,2\"\n```\n" + }, "insertText": "->TypedArray.toSorted", - "additionalTextEdits": [{ - "range": {"start": {"line": 17, "character": 13}, "end": {"line": 17, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.copyAllWithin", "kind": 12, - "tags": [], + "label": "->TypedArray.toSorted", + "sortText": "toSorted", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 17 }, + "start": { "character": 13, "line": 17 } + } + } + ], "detail": "(t<'a>, ~target: int) => array<'a>", - "documentation": {"kind": "markdown", "value": "\n`copyAllWithin(typedArray, ~target)` copies values starting at index `0` over the positions beginning at `target`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.copyWithin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/copyWithin) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([10, 20, 30])\nlet _ = TypedArray.copyAllWithin(view, ~target=1)\nTypedArray.toString(view) == \"10,10,20\"\n```\n"}, - "sortText": "copyAllWithin", + "documentation": { + "kind": "markdown", + "value": "\n`copyAllWithin(typedArray, ~target)` copies values starting at index `0` over the positions beginning at `target`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.copyWithin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/copyWithin) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([10, 20, 30])\nlet _ = TypedArray.copyAllWithin(view, ~target=1)\nTypedArray.toString(view) == \"10,10,20\"\n```\n" + }, "insertText": "->TypedArray.copyAllWithin", - "additionalTextEdits": [{ - "range": {"start": {"line": 17, "character": 13}, "end": {"line": 17, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.subarray", "kind": 12, - "tags": [], + "label": "->TypedArray.copyAllWithin", + "sortText": "copyAllWithin", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 17 }, + "start": { "character": 13, "line": 17 } + } + } + ], "detail": "(t<'a>, ~start: int, ~end: int=?) => t<'a>", - "documentation": {"kind": "markdown", "value": "\n`subarray(typedArray, ~start, ~end)` returns a new view referencing the same buffer over `[start, end)`.\n\nSee [`TypedArray.prototype.subarray`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/subarray) on MDN.\n"}, - "sortText": "subarray", + "documentation": { + "kind": "markdown", + "value": "\n`subarray(typedArray, ~start, ~end)` returns a new view referencing the same buffer over `[start, end)`.\n\nSee [`TypedArray.prototype.subarray`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/subarray) on MDN.\n" + }, "insertText": "->TypedArray.subarray", - "additionalTextEdits": [{ - "range": {"start": {"line": 17, "character": 13}, "end": {"line": 17, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.setArray", "kind": 12, - "tags": [], + "label": "->TypedArray.subarray", + "sortText": "subarray", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 17 }, + "start": { "character": 13, "line": 17 } + } + } + ], "detail": "(t<'a>, array<'a>) => unit", - "documentation": {"kind": "markdown", "value": "\n`setArray(target, source)` copies the values from `source` into `target`, mutating it.\n\nSee [`TypedArray.prototype.set`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/set) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([0, 0])\nTypedArray.setArray(view, [1, 2])\nTypedArray.toString(view) == \"1,2\"\n```\n"}, - "sortText": "setArray", + "documentation": { + "kind": "markdown", + "value": "\n`setArray(target, source)` copies the values from `source` into `target`, mutating it.\n\nSee [`TypedArray.prototype.set`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/set) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([0, 0])\nTypedArray.setArray(view, [1, 2])\nTypedArray.toString(view) == \"1,2\"\n```\n" + }, "insertText": "->TypedArray.setArray", - "additionalTextEdits": [{ - "range": {"start": {"line": 17, "character": 13}, "end": {"line": 17, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.get", "kind": 12, - "tags": [], + "label": "->TypedArray.setArray", + "sortText": "setArray", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 17 }, + "start": { "character": 13, "line": 17 } + } + } + ], "detail": "(t<'a>, int) => option<'a>", - "documentation": {"kind": "markdown", "value": "\n`get(typedArray, index)` returns the element at `index` of `typedArray`.\nReturns `None` if the index does not exist in the typed array. Equivalent to doing `typedArray[index]` in JavaScript.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nTypedArray.get(view, 0) == Some(1)\nTypedArray.get(view, 10) == None\n```\n"}, - "sortText": "get", + "documentation": { + "kind": "markdown", + "value": "\n`get(typedArray, index)` returns the element at `index` of `typedArray`.\nReturns `None` if the index does not exist in the typed array. Equivalent to doing `typedArray[index]` in JavaScript.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nTypedArray.get(view, 0) == Some(1)\nTypedArray.get(view, 10) == None\n```\n" + }, "insertText": "->TypedArray.get", - "additionalTextEdits": [{ - "range": {"start": {"line": 17, "character": 13}, "end": {"line": 17, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.with", "kind": 12, - "tags": [], + "label": "->TypedArray.get", + "sortText": "get", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 17 }, + "start": { "character": 13, "line": 17 } + } + } + ], "detail": "(t<'a>, int, 'a) => t<'a>", - "documentation": {"kind": "markdown", "value": "\n`with(typedArray, index, value)` returns a new typed array where the element at `index` is replaced with `value`.\n\nSee [`TypedArray.prototype.with`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/with) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nlet updated = TypedArray.with(view, 1, 10)\nTypedArray.toString(updated) == \"1,10,3\"\nTypedArray.toString(view) == \"1,2,3\"\n```\n"}, - "sortText": "with", + "documentation": { + "kind": "markdown", + "value": "\n`with(typedArray, index, value)` returns a new typed array where the element at `index` is replaced with `value`.\n\nSee [`TypedArray.prototype.with`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/with) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nlet updated = TypedArray.with(view, 1, 10)\nTypedArray.toString(updated) == \"1,10,3\"\nTypedArray.toString(view) == \"1,2,3\"\n```\n" + }, "insertText": "->TypedArray.with", - "additionalTextEdits": [{ - "range": {"start": {"line": 17, "character": 13}, "end": {"line": 17, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.toReversed", "kind": 12, - "tags": [], + "label": "->TypedArray.with", + "sortText": "with", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 17 }, + "start": { "character": 13, "line": 17 } + } + } + ], "detail": "t<'a> => t<'a>", - "documentation": {"kind": "markdown", "value": "\n`toReversed(typedArray)` returns a new typed array with the elements in reverse order, leaving the original untouched.\n\nSee [`TypedArray.prototype.toReversed`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/toReversed) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nlet reversed = TypedArray.toReversed(view)\nTypedArray.toString(reversed) == \"3,2,1\"\nTypedArray.toString(view) == \"1,2,3\"\n```\n"}, - "sortText": "toReversed", + "documentation": { + "kind": "markdown", + "value": "\n`toReversed(typedArray)` returns a new typed array with the elements in reverse order, leaving the original untouched.\n\nSee [`TypedArray.prototype.toReversed`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/toReversed) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nlet reversed = TypedArray.toReversed(view)\nTypedArray.toString(reversed) == \"3,2,1\"\nTypedArray.toString(view) == \"1,2,3\"\n```\n" + }, "insertText": "->TypedArray.toReversed", - "additionalTextEdits": [{ - "range": {"start": {"line": 17, "character": 13}, "end": {"line": 17, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.copyWithin", "kind": 12, - "tags": [], + "label": "->TypedArray.toReversed", + "sortText": "toReversed", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 17 }, + "start": { "character": 13, "line": 17 } + } + } + ], "detail": "(t<'a>, ~target: int, ~start: int, ~end: int=?) => array<'a>", - "documentation": {"kind": "markdown", "value": "\n`copyWithin(typedArray, ~target, ~start, ~end)` copies the section `[start, end)` onto the range beginning at `target`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.copyWithin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/copyWithin) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3, 4])\nlet _ = TypedArray.copyWithin(view, ~target=1, ~start=2, ~end=4)\nTypedArray.toString(view) == \"1,3,4,4\"\n```\n"}, - "sortText": "copyWithin", + "documentation": { + "kind": "markdown", + "value": "\n`copyWithin(typedArray, ~target, ~start, ~end)` copies the section `[start, end)` onto the range beginning at `target`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.copyWithin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/copyWithin) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3, 4])\nlet _ = TypedArray.copyWithin(view, ~target=1, ~start=2, ~end=4)\nTypedArray.toString(view) == \"1,3,4,4\"\n```\n" + }, "insertText": "->TypedArray.copyWithin", - "additionalTextEdits": [{ - "range": {"start": {"line": 17, "character": 13}, "end": {"line": 17, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.everyWithIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.copyWithin", + "sortText": "copyWithin", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 17 }, + "start": { "character": 13, "line": 17 } + } + } + ], "detail": "(t<'a>, ('a, int) => bool) => bool", - "documentation": {"kind": "markdown", "value": "\n`everyWithIndex(typedArray, checker)` is like `every` but provides the element index to `checker`.\n"}, - "sortText": "everyWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`everyWithIndex(typedArray, checker)` is like `every` but provides the element index to `checker`.\n" + }, "insertText": "->TypedArray.everyWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 17, "character": 13}, "end": {"line": 17, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.toString", "kind": 12, - "tags": [], + "label": "->TypedArray.everyWithIndex", + "sortText": "everyWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 17 }, + "start": { "character": 13, "line": 17 } + } + } + ], "detail": "t<'a> => string", - "documentation": {"kind": "markdown", "value": "\n`toString(typedArray)` returns a comma-separated string of the elements.\n\nSee [`TypedArray.prototype.toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/toString) on MDN.\n\n## Examples\n\n```rescript\nInt32Array.fromArray([1, 2])->TypedArray.toString == \"1,2\"\n```\n"}, - "sortText": "toString", + "documentation": { + "kind": "markdown", + "value": "\n`toString(typedArray)` returns a comma-separated string of the elements.\n\nSee [`TypedArray.prototype.toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/toString) on MDN.\n\n## Examples\n\n```rescript\nInt32Array.fromArray([1, 2])->TypedArray.toString == \"1,2\"\n```\n" + }, "insertText": "->TypedArray.toString", - "additionalTextEdits": [{ - "range": {"start": {"line": 17, "character": 13}, "end": {"line": 17, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.setArrayFrom", "kind": 12, - "tags": [], + "label": "->TypedArray.toString", + "sortText": "toString", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 17 }, + "start": { "character": 13, "line": 17 } + } + } + ], "detail": "(t<'a>, array<'a>, int) => unit", - "documentation": {"kind": "markdown", "value": "\n`setArrayFrom(target, source, index)` copies `source` into `target` starting at `index`.\n\nSee [`TypedArray.prototype.set`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/set) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([0, 0, 0])\nTypedArray.setArrayFrom(view, [5, 6], 1)\nTypedArray.toString(view) == \"0,5,6\"\n```\n"}, - "sortText": "setArrayFrom", + "documentation": { + "kind": "markdown", + "value": "\n`setArrayFrom(target, source, index)` copies `source` into `target` starting at `index`.\n\nSee [`TypedArray.prototype.set`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/set) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([0, 0, 0])\nTypedArray.setArrayFrom(view, [5, 6], 1)\nTypedArray.toString(view) == \"0,5,6\"\n```\n" + }, "insertText": "->TypedArray.setArrayFrom", - "additionalTextEdits": [{ - "range": {"start": {"line": 17, "character": 13}, "end": {"line": 17, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.forEach", "kind": 12, - "tags": [], + "label": "->TypedArray.setArrayFrom", + "sortText": "setArrayFrom", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 17 }, + "start": { "character": 13, "line": 17 } + } + } + ], "detail": "(t<'a>, 'a => unit) => unit", - "documentation": {"kind": "markdown", "value": "\n`forEach(typedArray, f)` runs `f` for every element in order.\n\nSee [`TypedArray.prototype.forEach`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/forEach) on MDN.\n"}, - "sortText": "forEach", + "documentation": { + "kind": "markdown", + "value": "\n`forEach(typedArray, f)` runs `f` for every element in order.\n\nSee [`TypedArray.prototype.forEach`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/forEach) on MDN.\n" + }, "insertText": "->TypedArray.forEach", - "additionalTextEdits": [{ - "range": {"start": {"line": 17, "character": 13}, "end": {"line": 17, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.findWithIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.forEach", + "sortText": "forEach", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 17 }, + "start": { "character": 13, "line": 17 } + } + } + ], "detail": "(t<'a>, ('a, int) => bool) => option<'a>", - "documentation": {"kind": "markdown", "value": "\n`findWithIndex(typedArray, predicate)` behaves like `find`, but `predicate` also receives the index.\n"}, - "sortText": "findWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`findWithIndex(typedArray, predicate)` behaves like `find`, but `predicate` also receives the index.\n" + }, "insertText": "->TypedArray.findWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 17, "character": 13}, "end": {"line": 17, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.fill", "kind": 12, - "tags": [], + "label": "->TypedArray.findWithIndex", + "sortText": "findWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 17 }, + "start": { "character": 13, "line": 17 } + } + } + ], "detail": "(t<'a>, 'a, ~start: int, ~end: int=?) => t<'a>", - "documentation": {"kind": "markdown", "value": "\n`fill(typedArray, value, ~start, ~end)` fills the half-open interval `[start, end)` with `value`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.fill`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/fill) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3, 4])\nlet _ = TypedArray.fill(view, 0, ~start=1, ~end=3)\nTypedArray.toString(view) == \"1,0,0,4\"\n```\n"}, - "sortText": "fill", + "documentation": { + "kind": "markdown", + "value": "\n`fill(typedArray, value, ~start, ~end)` fills the half-open interval `[start, end)` with `value`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.fill`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/fill) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3, 4])\nlet _ = TypedArray.fill(view, 0, ~start=1, ~end=3)\nTypedArray.toString(view) == \"1,0,0,4\"\n```\n" + }, "insertText": "->TypedArray.fill", - "additionalTextEdits": [{ - "range": {"start": {"line": 17, "character": 13}, "end": {"line": 17, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.indexOfFrom", "kind": 12, - "tags": [], + "label": "->TypedArray.fill", + "sortText": "fill", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 17 }, + "start": { "character": 13, "line": 17 } + } + } + ], "detail": "(t<'a>, 'a, int) => int", - "documentation": {"kind": "markdown", "value": "\n`indexOfFrom(typedArray, value, fromIndex)` searches for `value` starting at `fromIndex`.\n"}, - "sortText": "indexOfFrom", + "documentation": { + "kind": "markdown", + "value": "\n`indexOfFrom(typedArray, value, fromIndex)` searches for `value` starting at `fromIndex`.\n" + }, "insertText": "->TypedArray.indexOfFrom", - "additionalTextEdits": [{ - "range": {"start": {"line": 17, "character": 13}, "end": {"line": 17, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.reverse", "kind": 12, - "tags": [], + "label": "->TypedArray.indexOfFrom", + "sortText": "indexOfFrom", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 17 }, + "start": { "character": 13, "line": 17 } + } + } + ], "detail": "t<'a> => unit", - "documentation": {"kind": "markdown", "value": "\n`reverse(typedArray)` reverses the elements of the view in place.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.reverse`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/reverse) on MDN.\n"}, - "sortText": "reverse", + "documentation": { + "kind": "markdown", + "value": "\n`reverse(typedArray)` reverses the elements of the view in place.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.reverse`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/reverse) on MDN.\n" + }, "insertText": "->TypedArray.reverse", - "additionalTextEdits": [{ - "range": {"start": {"line": 17, "character": 13}, "end": {"line": 17, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.byteOffset", "kind": 12, - "tags": [], + "label": "->TypedArray.reverse", + "sortText": "reverse", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 17 }, + "start": { "character": 13, "line": 17 } + } + } + ], "detail": "t<'a> => int", - "documentation": {"kind": "markdown", "value": "\n`byteOffset(typedArray)` returns the offset in bytes from the start of the buffer.\n\nSee [`TypedArray.prototype.byteOffset`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/byteOffset) on MDN.\n"}, - "sortText": "byteOffset", + "documentation": { + "kind": "markdown", + "value": "\n`byteOffset(typedArray)` returns the offset in bytes from the start of the buffer.\n\nSee [`TypedArray.prototype.byteOffset`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/byteOffset) on MDN.\n" + }, "insertText": "->TypedArray.byteOffset", - "additionalTextEdits": [{ - "range": {"start": {"line": 17, "character": 13}, "end": {"line": 17, "character": 14}}, - "newText": "" - }] - }] + "kind": 12, + "label": "->TypedArray.byteOffset", + "sortText": "byteOffset", + "tags": [] + } +] Complete src/CompletionTypedArrays.res 21:14 posCursor:[21:14] posNoWhite:[21:13] Found expr:[21:3->21:14] @@ -3464,679 +6009,1188 @@ CPPipe pathFromEnv:Stdlib.Int32Array found:false Path Stdlib.Int32Array. Path Stdlib.TypedArray. Path -[{ - "label": "->Int32Array.ignore", - "kind": 12, - "tags": [], +[ + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 21 }, + "start": { "character": 13, "line": 21 } + } + } + ], "detail": "t => unit", - "documentation": {"kind": "markdown", "value": "\n `ignore(intArray)` ignores the provided intArray and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further.\n"}, - "sortText": "ignore", + "documentation": { + "kind": "markdown", + "value": "\n `ignore(intArray)` ignores the provided intArray and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further.\n" + }, "insertText": "->Int32Array.ignore", - "additionalTextEdits": [{ - "range": {"start": {"line": 21, "character": 13}, "end": {"line": 21, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.findLastIndexWithIndex", "kind": 12, - "tags": [], + "label": "->Int32Array.ignore", + "sortText": "ignore", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 21 }, + "start": { "character": 13, "line": 21 } + } + } + ], "detail": "(t<'a>, ('a, int) => bool) => int", - "documentation": {"kind": "markdown", "value": "\n`findLastIndexWithIndex(typedArray, predicate)` is the indexed variant of `findLastIndex`.\n"}, - "sortText": "findLastIndexWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`findLastIndexWithIndex(typedArray, predicate)` is the indexed variant of `findLastIndex`.\n" + }, "insertText": "->TypedArray.findLastIndexWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 21, "character": 13}, "end": {"line": 21, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.lastIndexOf", "kind": 12, - "tags": [], + "label": "->TypedArray.findLastIndexWithIndex", + "sortText": "findLastIndexWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 21 }, + "start": { "character": 13, "line": 21 } + } + } + ], "detail": "(t<'a>, 'a) => int", - "documentation": {"kind": "markdown", "value": "\n`lastIndexOf(typedArray, value)` returns the last index of `value`, or `-1` if not found.\n\nSee [`TypedArray.prototype.lastIndexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/lastIndexOf) on MDN.\n"}, - "sortText": "lastIndexOf", + "documentation": { + "kind": "markdown", + "value": "\n`lastIndexOf(typedArray, value)` returns the last index of `value`, or `-1` if not found.\n\nSee [`TypedArray.prototype.lastIndexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/lastIndexOf) on MDN.\n" + }, "insertText": "->TypedArray.lastIndexOf", - "additionalTextEdits": [{ - "range": {"start": {"line": 21, "character": 13}, "end": {"line": 21, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.findLastWithIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.lastIndexOf", + "sortText": "lastIndexOf", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 21 }, + "start": { "character": 13, "line": 21 } + } + } + ], "detail": "(t<'a>, ('a, int) => bool) => option<'a>", - "documentation": {"kind": "markdown", "value": "\n`findLastWithIndex(typedArray, predicate)` is the indexed variant of `findLast`.\n"}, - "sortText": "findLastWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`findLastWithIndex(typedArray, predicate)` is the indexed variant of `findLast`.\n" + }, "insertText": "->TypedArray.findLastWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 21, "character": 13}, "end": {"line": 21, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.findLast", "kind": 12, - "tags": [], + "label": "->TypedArray.findLastWithIndex", + "sortText": "findLastWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 21 }, + "start": { "character": 13, "line": 21 } + } + } + ], "detail": "(t<'a>, 'a => bool) => option<'a>", - "documentation": {"kind": "markdown", "value": "\n`findLast(typedArray, predicate)` returns the last element that satisfies `predicate`.\n\nSee [`TypedArray.prototype.findLast`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/findLast) on MDN.\n"}, - "sortText": "findLast", + "documentation": { + "kind": "markdown", + "value": "\n`findLast(typedArray, predicate)` returns the last element that satisfies `predicate`.\n\nSee [`TypedArray.prototype.findLast`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/findLast) on MDN.\n" + }, "insertText": "->TypedArray.findLast", - "additionalTextEdits": [{ - "range": {"start": {"line": 21, "character": 13}, "end": {"line": 21, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.filter", "kind": 12, - "tags": [], + "label": "->TypedArray.findLast", + "sortText": "findLast", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 21 }, + "start": { "character": 13, "line": 21 } + } + } + ], "detail": "(t<'a>, 'a => bool) => t<'a>", - "documentation": {"kind": "markdown", "value": "\n`filter(typedArray, predicate)` returns a new typed array containing only elements that satisfy `predicate`.\n\nSee [`TypedArray.prototype.filter`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/filter) on MDN.\n"}, - "sortText": "filter", + "documentation": { + "kind": "markdown", + "value": "\n`filter(typedArray, predicate)` returns a new typed array containing only elements that satisfy `predicate`.\n\nSee [`TypedArray.prototype.filter`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/filter) on MDN.\n" + }, "insertText": "->TypedArray.filter", - "additionalTextEdits": [{ - "range": {"start": {"line": 21, "character": 13}, "end": {"line": 21, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.byteLength", "kind": 12, - "tags": [], + "label": "->TypedArray.filter", + "sortText": "filter", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 21 }, + "start": { "character": 13, "line": 21 } + } + } + ], "detail": "t<'a> => int", - "documentation": {"kind": "markdown", "value": "\n`byteLength(typedArray)` returns the length in bytes of the view.\n\nSee [`TypedArray.prototype.byteLength`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/byteLength) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2])\nTypedArray.byteLength(view) == 8\n```\n"}, - "sortText": "byteLength", + "documentation": { + "kind": "markdown", + "value": "\n`byteLength(typedArray)` returns the length in bytes of the view.\n\nSee [`TypedArray.prototype.byteLength`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/byteLength) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2])\nTypedArray.byteLength(view) == 8\n```\n" + }, "insertText": "->TypedArray.byteLength", - "additionalTextEdits": [{ - "range": {"start": {"line": 21, "character": 13}, "end": {"line": 21, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.ignore", "kind": 12, - "tags": [], + "label": "->TypedArray.byteLength", + "sortText": "byteLength", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 21 }, + "start": { "character": 13, "line": 21 } + } + } + ], "detail": "t<'a> => unit", - "documentation": {"kind": "markdown", "value": "\n `ignore(typedArray)` ignores the provided typedArray and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further.\n"}, - "sortText": "ignore", + "documentation": { + "kind": "markdown", + "value": "\n `ignore(typedArray)` ignores the provided typedArray and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further.\n" + }, "insertText": "->TypedArray.ignore", - "additionalTextEdits": [{ - "range": {"start": {"line": 21, "character": 13}, "end": {"line": 21, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.reduceRightWithIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.ignore", + "sortText": "ignore", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 21 }, + "start": { "character": 13, "line": 21 } + } + } + ], "detail": "(t<'a>, ('b, 'a, int) => 'b, 'b) => 'b", - "documentation": {"kind": "markdown", "value": "\n`reduceRightWithIndex(typedArray, reducer, initial)` is the indexed variant of `reduceRight`.\n"}, - "sortText": "reduceRightWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`reduceRightWithIndex(typedArray, reducer, initial)` is the indexed variant of `reduceRight`.\n" + }, "insertText": "->TypedArray.reduceRightWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 21, "character": 13}, "end": {"line": 21, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.reduceRight", "kind": 12, - "tags": [], + "label": "->TypedArray.reduceRightWithIndex", + "sortText": "reduceRightWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 21 }, + "start": { "character": 13, "line": 21 } + } + } + ], "detail": "(t<'a>, ('b, 'a) => 'b, 'b) => 'b", - "documentation": {"kind": "markdown", "value": "\n`reduceRight(typedArray, reducer, initial)` is like `reduce` but processes the elements from right to left.\n\nSee [`TypedArray.prototype.reduceRight`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/reduceRight) on MDN.\n"}, - "sortText": "reduceRight", + "documentation": { + "kind": "markdown", + "value": "\n`reduceRight(typedArray, reducer, initial)` is like `reduce` but processes the elements from right to left.\n\nSee [`TypedArray.prototype.reduceRight`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/reduceRight) on MDN.\n" + }, "insertText": "->TypedArray.reduceRight", - "additionalTextEdits": [{ - "range": {"start": {"line": 21, "character": 13}, "end": {"line": 21, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.joinWith", "kind": 12, - "tags": [], + "label": "->TypedArray.reduceRight", + "sortText": "reduceRight", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 21 }, + "start": { "character": 13, "line": 21 } + } + } + ], "detail": "(t<'a>, string) => string", - "documentation": {"kind": "markdown", "value": "\n`joinWith(typedArray, separator)` returns a string formed by the elements joined with `separator`.\n\nSee [`TypedArray.prototype.join`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/join) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nTypedArray.joinWith(view, \"-\") == \"1-2-3\"\n```\n"}, - "sortText": "joinWith", + "documentation": { + "kind": "markdown", + "value": "\n`joinWith(typedArray, separator)` returns a string formed by the elements joined with `separator`.\n\nSee [`TypedArray.prototype.join`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/join) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nTypedArray.joinWith(view, \"-\") == \"1-2-3\"\n```\n" + }, "insertText": "->TypedArray.joinWith", - "additionalTextEdits": [{ - "range": {"start": {"line": 21, "character": 13}, "end": {"line": 21, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.buffer", "kind": 12, - "tags": [], + "label": "->TypedArray.joinWith", + "sortText": "joinWith", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 21 }, + "start": { "character": 13, "line": 21 } + } + } + ], "detail": "t<'a> => ArrayBuffer.t", - "documentation": {"kind": "markdown", "value": "\n`buffer(typedArray)` returns the underlying `ArrayBuffer` backing this view.\n\nSee [`TypedArray.prototype.buffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/buffer) on MDN.\n"}, - "sortText": "buffer", + "documentation": { + "kind": "markdown", + "value": "\n`buffer(typedArray)` returns the underlying `ArrayBuffer` backing this view.\n\nSee [`TypedArray.prototype.buffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/buffer) on MDN.\n" + }, "insertText": "->TypedArray.buffer", - "additionalTextEdits": [{ - "range": {"start": {"line": 21, "character": 13}, "end": {"line": 21, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.reduce", "kind": 12, - "tags": [], + "label": "->TypedArray.buffer", + "sortText": "buffer", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 21 }, + "start": { "character": 13, "line": 21 } + } + } + ], "detail": "(t<'a>, ('b, 'a) => 'b, 'b) => 'b", - "documentation": {"kind": "markdown", "value": "\n`reduce(typedArray, reducer, initial)` combines the elements from left to right using `reducer`.\n\nSee [`TypedArray.prototype.reduce`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/reduce) on MDN.\n"}, - "sortText": "reduce", + "documentation": { + "kind": "markdown", + "value": "\n`reduce(typedArray, reducer, initial)` combines the elements from left to right using `reducer`.\n\nSee [`TypedArray.prototype.reduce`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/reduce) on MDN.\n" + }, "insertText": "->TypedArray.reduce", - "additionalTextEdits": [{ - "range": {"start": {"line": 21, "character": 13}, "end": {"line": 21, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.forEachWithIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.reduce", + "sortText": "reduce", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 21 }, + "start": { "character": 13, "line": 21 } + } + } + ], "detail": "(t<'a>, ('a, int) => unit) => unit", - "documentation": {"kind": "markdown", "value": "\n`forEachWithIndex(typedArray, f)` runs `f` for every element, also providing the index.\n"}, - "sortText": "forEachWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`forEachWithIndex(typedArray, f)` runs `f` for every element, also providing the index.\n" + }, "insertText": "->TypedArray.forEachWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 21, "character": 13}, "end": {"line": 21, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.copy", "kind": 12, - "tags": [], + "label": "->TypedArray.forEachWithIndex", + "sortText": "forEachWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 21 }, + "start": { "character": 13, "line": 21 } + } + } + ], "detail": "t<'a> => t<'a>", - "documentation": {"kind": "markdown", "value": "\n`copy(typedArray)` produces a shallow copy of the typed array.\n"}, - "sortText": "copy", + "documentation": { + "kind": "markdown", + "value": "\n`copy(typedArray)` produces a shallow copy of the typed array.\n" + }, "insertText": "->TypedArray.copy", - "additionalTextEdits": [{ - "range": {"start": {"line": 21, "character": 13}, "end": {"line": 21, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.someWithIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.copy", + "sortText": "copy", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 21 }, + "start": { "character": 13, "line": 21 } + } + } + ], "detail": "(t<'a>, ('a, int) => bool) => bool", - "documentation": {"kind": "markdown", "value": "\n`someWithIndex(typedArray, predicate)` behaves like `some`, but `predicate` also receives the element index.\n"}, - "sortText": "someWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`someWithIndex(typedArray, predicate)` behaves like `some`, but `predicate` also receives the element index.\n" + }, "insertText": "->TypedArray.someWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 21, "character": 13}, "end": {"line": 21, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.findIndexWithIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.someWithIndex", + "sortText": "someWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 21 }, + "start": { "character": 13, "line": 21 } + } + } + ], "detail": "(t<'a>, ('a, int) => bool) => int", - "documentation": {"kind": "markdown", "value": "\n`findIndexWithIndex(typedArray, predicate)` is the indexed variant of `findIndex`.\n"}, - "sortText": "findIndexWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`findIndexWithIndex(typedArray, predicate)` is the indexed variant of `findIndex`.\n" + }, "insertText": "->TypedArray.findIndexWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 21, "character": 13}, "end": {"line": 21, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.sliceToEnd", "kind": 12, - "tags": [1], + "label": "->TypedArray.findIndexWithIndex", + "sortText": "findIndexWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 21 }, + "start": { "character": 13, "line": 21 } + } + } + ], + "deprecated": true, "detail": "(t<'a>, ~start: int) => t<'a>", - "documentation": {"kind": "markdown", "value": "Deprecated: Use `slice` instead\n\n\n`sliceToEnd(typedArray, ~start)` returns the elements from `start` through the end in a new typed array.\n"}, - "sortText": "sliceToEnd", + "documentation": { + "kind": "markdown", + "value": "Deprecated: Use `slice` instead\n\n\n`sliceToEnd(typedArray, ~start)` returns the elements from `start` through the end in a new typed array.\n" + }, "insertText": "->TypedArray.sliceToEnd", - "additionalTextEdits": [{ - "range": {"start": {"line": 21, "character": 13}, "end": {"line": 21, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.slice", "kind": 12, - "tags": [], + "label": "->TypedArray.sliceToEnd", + "sortText": "sliceToEnd", + "tags": [ 1 ] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 21 }, + "start": { "character": 13, "line": 21 } + } + } + ], "detail": "(t<'a>, ~start: int, ~end: int=?) => t<'a>", - "documentation": {"kind": "markdown", "value": "\n`slice(typedArray, ~start, ~end)` returns a new typed array containing the elements in `[start, end)`.\n\nSee [`TypedArray.prototype.slice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/slice) on MDN.\n"}, - "sortText": "slice", + "documentation": { + "kind": "markdown", + "value": "\n`slice(typedArray, ~start, ~end)` returns a new typed array containing the elements in `[start, end)`.\n\nSee [`TypedArray.prototype.slice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/slice) on MDN.\n" + }, "insertText": "->TypedArray.slice", - "additionalTextEdits": [{ - "range": {"start": {"line": 21, "character": 13}, "end": {"line": 21, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.findLastIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.slice", + "sortText": "slice", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 21 }, + "start": { "character": 13, "line": 21 } + } + } + ], "detail": "(t<'a>, 'a => bool) => int", - "documentation": {"kind": "markdown", "value": "\n`findLastIndex(typedArray, predicate)` returns the index of the last matching element, or `-1` if none do.\n\nSee [`TypedArray.prototype.findLastIndex`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/findLastIndex) on MDN.\n"}, - "sortText": "findLastIndex", + "documentation": { + "kind": "markdown", + "value": "\n`findLastIndex(typedArray, predicate)` returns the index of the last matching element, or `-1` if none do.\n\nSee [`TypedArray.prototype.findLastIndex`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/findLastIndex) on MDN.\n" + }, "insertText": "->TypedArray.findLastIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 21, "character": 13}, "end": {"line": 21, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.includes", "kind": 12, - "tags": [], + "label": "->TypedArray.findLastIndex", + "sortText": "findLastIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 21 }, + "start": { "character": 13, "line": 21 } + } + } + ], "detail": "(t<'a>, 'a) => bool", - "documentation": {"kind": "markdown", "value": "\n`includes(typedArray, value)` returns `true` if `value` occurs in the typed array.\n\nSee [`TypedArray.prototype.includes`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/includes) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nTypedArray.includes(view, 2) == true\nTypedArray.includes(view, 10) == false\n```\n"}, - "sortText": "includes", + "documentation": { + "kind": "markdown", + "value": "\n`includes(typedArray, value)` returns `true` if `value` occurs in the typed array.\n\nSee [`TypedArray.prototype.includes`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/includes) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nTypedArray.includes(view, 2) == true\nTypedArray.includes(view, 10) == false\n```\n" + }, "insertText": "->TypedArray.includes", - "additionalTextEdits": [{ - "range": {"start": {"line": 21, "character": 13}, "end": {"line": 21, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.fillToEnd", "kind": 12, - "tags": [1], + "label": "->TypedArray.includes", + "sortText": "includes", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 21 }, + "start": { "character": 13, "line": 21 } + } + } + ], + "deprecated": true, "detail": "(t<'a>, 'a, ~start: int) => t<'a>", - "documentation": {"kind": "markdown", "value": "Deprecated: Use `fill` instead\n\n\n`fillToEnd(typedArray, value, ~start)` fills from `start` through the end with `value`.\n\nBeware this will *mutate* the typed array.\n"}, - "sortText": "fillToEnd", + "documentation": { + "kind": "markdown", + "value": "Deprecated: Use `fill` instead\n\n\n`fillToEnd(typedArray, value, ~start)` fills from `start` through the end with `value`.\n\nBeware this will *mutate* the typed array.\n" + }, "insertText": "->TypedArray.fillToEnd", - "additionalTextEdits": [{ - "range": {"start": {"line": 21, "character": 13}, "end": {"line": 21, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.fillAll", "kind": 12, - "tags": [], + "label": "->TypedArray.fillToEnd", + "sortText": "fillToEnd", + "tags": [ 1 ] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 21 }, + "start": { "character": 13, "line": 21 } + } + } + ], "detail": "(t<'a>, 'a) => t<'a>", - "documentation": {"kind": "markdown", "value": "\n`fillAll(typedArray, value)` fills every element with `value`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.fill`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/fill) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nlet _ = TypedArray.fillAll(view, 9)\nTypedArray.toString(view) == \"9,9,9\"\n```\n"}, - "sortText": "fillAll", + "documentation": { + "kind": "markdown", + "value": "\n`fillAll(typedArray, value)` fills every element with `value`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.fill`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/fill) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nlet _ = TypedArray.fillAll(view, 9)\nTypedArray.toString(view) == \"9,9,9\"\n```\n" + }, "insertText": "->TypedArray.fillAll", - "additionalTextEdits": [{ - "range": {"start": {"line": 21, "character": 13}, "end": {"line": 21, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.find", "kind": 12, - "tags": [], + "label": "->TypedArray.fillAll", + "sortText": "fillAll", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 21 }, + "start": { "character": 13, "line": 21 } + } + } + ], "detail": "(t<'a>, 'a => bool) => option<'a>", - "documentation": {"kind": "markdown", "value": "\n`find(typedArray, predicate)` returns the first element that satisfies `predicate`, or `None` if nothing matches.\n\nSee [`TypedArray.prototype.find`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/find) on MDN.\n"}, - "sortText": "find", + "documentation": { + "kind": "markdown", + "value": "\n`find(typedArray, predicate)` returns the first element that satisfies `predicate`, or `None` if nothing matches.\n\nSee [`TypedArray.prototype.find`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/find) on MDN.\n" + }, "insertText": "->TypedArray.find", - "additionalTextEdits": [{ - "range": {"start": {"line": 21, "character": 13}, "end": {"line": 21, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.subarrayToEnd", "kind": 12, - "tags": [1], + "label": "->TypedArray.find", + "sortText": "find", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 21 }, + "start": { "character": 13, "line": 21 } + } + } + ], + "deprecated": true, "detail": "(t<'a>, ~start: int) => t<'a>", - "documentation": {"kind": "markdown", "value": "Deprecated: Use `subarray` instead\n\n\n`subarrayToEnd(typedArray, ~start)` returns a new view from `start` to the end of the buffer.\n"}, - "sortText": "subarrayToEnd", + "documentation": { + "kind": "markdown", + "value": "Deprecated: Use `subarray` instead\n\n\n`subarrayToEnd(typedArray, ~start)` returns a new view from `start` to the end of the buffer.\n" + }, "insertText": "->TypedArray.subarrayToEnd", - "additionalTextEdits": [{ - "range": {"start": {"line": 21, "character": 13}, "end": {"line": 21, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.set", "kind": 12, - "tags": [], + "label": "->TypedArray.subarrayToEnd", + "sortText": "subarrayToEnd", + "tags": [ 1 ] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 21 }, + "start": { "character": 13, "line": 21 } + } + } + ], "detail": "(t<'a>, int, 'a) => unit", - "documentation": {"kind": "markdown", "value": "\n`set(typedArray, index, item)` sets the provided `item` at `index` of `typedArray`.\n\nBeware this will *mutate* the array.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2])\nTypedArray.set(view, 1, 5)\nTypedArray.get(view, 1) == Some(5)\n```\n"}, - "sortText": "set", + "documentation": { + "kind": "markdown", + "value": "\n`set(typedArray, index, item)` sets the provided `item` at `index` of `typedArray`.\n\nBeware this will *mutate* the array.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2])\nTypedArray.set(view, 1, 5)\nTypedArray.get(view, 1) == Some(5)\n```\n" + }, "insertText": "->TypedArray.set", - "additionalTextEdits": [{ - "range": {"start": {"line": 21, "character": 13}, "end": {"line": 21, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.toLocaleString", "kind": 12, - "tags": [], + "label": "->TypedArray.set", + "sortText": "set", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 21 }, + "start": { "character": 13, "line": 21 } + } + } + ], "detail": "t<'a> => string", - "documentation": {"kind": "markdown", "value": "\n`toLocaleString(typedArray)` concatenates the elements using locale-aware formatting.\n\nSee [`TypedArray.prototype.toLocaleString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/toLocaleString) on MDN.\n"}, - "sortText": "toLocaleString", + "documentation": { + "kind": "markdown", + "value": "\n`toLocaleString(typedArray)` concatenates the elements using locale-aware formatting.\n\nSee [`TypedArray.prototype.toLocaleString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/toLocaleString) on MDN.\n" + }, "insertText": "->TypedArray.toLocaleString", - "additionalTextEdits": [{ - "range": {"start": {"line": 21, "character": 13}, "end": {"line": 21, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.lastIndexOfFrom", "kind": 12, - "tags": [], + "label": "->TypedArray.toLocaleString", + "sortText": "toLocaleString", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 21 }, + "start": { "character": 13, "line": 21 } + } + } + ], "detail": "(t<'a>, 'a, int) => int", - "documentation": {"kind": "markdown", "value": "\n`lastIndexOfFrom(typedArray, value, fromIndex)` searches backwards starting at `fromIndex`.\n"}, - "sortText": "lastIndexOfFrom", + "documentation": { + "kind": "markdown", + "value": "\n`lastIndexOfFrom(typedArray, value, fromIndex)` searches backwards starting at `fromIndex`.\n" + }, "insertText": "->TypedArray.lastIndexOfFrom", - "additionalTextEdits": [{ - "range": {"start": {"line": 21, "character": 13}, "end": {"line": 21, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.findIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.lastIndexOfFrom", + "sortText": "lastIndexOfFrom", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 21 }, + "start": { "character": 13, "line": 21 } + } + } + ], "detail": "(t<'a>, 'a => bool) => int", - "documentation": {"kind": "markdown", "value": "\n`findIndex(typedArray, predicate)` returns the index of the first element that satisfies `predicate`, or `-1` if none do.\n\nSee [`TypedArray.prototype.findIndex`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/findIndex) on MDN.\n"}, - "sortText": "findIndex", + "documentation": { + "kind": "markdown", + "value": "\n`findIndex(typedArray, predicate)` returns the index of the first element that satisfies `predicate`, or `-1` if none do.\n\nSee [`TypedArray.prototype.findIndex`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/findIndex) on MDN.\n" + }, "insertText": "->TypedArray.findIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 21, "character": 13}, "end": {"line": 21, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.filterWithIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.findIndex", + "sortText": "findIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 21 }, + "start": { "character": 13, "line": 21 } + } + } + ], "detail": "(t<'a>, ('a, int) => bool) => t<'a>", - "documentation": {"kind": "markdown", "value": "\n`filterWithIndex(typedArray, predicate)` behaves like `filter` but also passes the index to `predicate`.\n"}, - "sortText": "filterWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`filterWithIndex(typedArray, predicate)` behaves like `filter` but also passes the index to `predicate`.\n" + }, "insertText": "->TypedArray.filterWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 21, "character": 13}, "end": {"line": 21, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.sort", "kind": 12, - "tags": [], + "label": "->TypedArray.filterWithIndex", + "sortText": "filterWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 21 }, + "start": { "character": 13, "line": 21 } + } + } + ], "detail": "(t<'a>, ('a, 'a) => Ordering.t) => unit", - "documentation": {"kind": "markdown", "value": "\n`sort(typedArray, comparator)` sorts the values in place using `comparator`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.sort`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/sort) on MDN.\n"}, - "sortText": "sort", + "documentation": { + "kind": "markdown", + "value": "\n`sort(typedArray, comparator)` sorts the values in place using `comparator`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.sort`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/sort) on MDN.\n" + }, "insertText": "->TypedArray.sort", - "additionalTextEdits": [{ - "range": {"start": {"line": 21, "character": 13}, "end": {"line": 21, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.mapWithIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.sort", + "sortText": "sort", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 21 }, + "start": { "character": 13, "line": 21 } + } + } + ], "detail": "(t<'a>, ('a, int) => 'b) => t<'b>", - "documentation": {"kind": "markdown", "value": "\n`mapWithIndex(typedArray, f)` behaves like `map`, but `f` also receives the index.\n"}, - "sortText": "mapWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`mapWithIndex(typedArray, f)` behaves like `map`, but `f` also receives the index.\n" + }, "insertText": "->TypedArray.mapWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 21, "character": 13}, "end": {"line": 21, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.every", "kind": 12, - "tags": [], + "label": "->TypedArray.mapWithIndex", + "sortText": "mapWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 21 }, + "start": { "character": 13, "line": 21 } + } + } + ], "detail": "(t<'a>, 'a => bool) => bool", - "documentation": {"kind": "markdown", "value": "\n`every(typedArray, predicate)` returns `true` if `predicate` returns `true` for every element.\n\nSee [`TypedArray.prototype.every`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/every) on MDN.\n"}, - "sortText": "every", + "documentation": { + "kind": "markdown", + "value": "\n`every(typedArray, predicate)` returns `true` if `predicate` returns `true` for every element.\n\nSee [`TypedArray.prototype.every`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/every) on MDN.\n" + }, "insertText": "->TypedArray.every", - "additionalTextEdits": [{ - "range": {"start": {"line": 21, "character": 13}, "end": {"line": 21, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.length", "kind": 12, - "tags": [], + "label": "->TypedArray.every", + "sortText": "every", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 21 }, + "start": { "character": 13, "line": 21 } + } + } + ], "detail": "t<'a> => int", - "documentation": {"kind": "markdown", "value": "\n`length(typedArray)` returns the number of elements.\n\nSee [`TypedArray.prototype.length`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/length) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nTypedArray.length(view) == 3\n```\n"}, - "sortText": "length", + "documentation": { + "kind": "markdown", + "value": "\n`length(typedArray)` returns the number of elements.\n\nSee [`TypedArray.prototype.length`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/length) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nTypedArray.length(view) == 3\n```\n" + }, "insertText": "->TypedArray.length", - "additionalTextEdits": [{ - "range": {"start": {"line": 21, "character": 13}, "end": {"line": 21, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.indexOf", "kind": 12, - "tags": [], + "label": "->TypedArray.length", + "sortText": "length", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 21 }, + "start": { "character": 13, "line": 21 } + } + } + ], "detail": "(t<'a>, 'a) => int", - "documentation": {"kind": "markdown", "value": "\n`indexOf(typedArray, value)` returns the first index of `value`, or `-1` when not found.\n\nSee [`TypedArray.prototype.indexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/indexOf) on MDN.\n"}, - "sortText": "indexOf", + "documentation": { + "kind": "markdown", + "value": "\n`indexOf(typedArray, value)` returns the first index of `value`, or `-1` when not found.\n\nSee [`TypedArray.prototype.indexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/indexOf) on MDN.\n" + }, "insertText": "->TypedArray.indexOf", - "additionalTextEdits": [{ - "range": {"start": {"line": 21, "character": 13}, "end": {"line": 21, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.copyWithinToEnd", "kind": 12, - "tags": [1], + "label": "->TypedArray.indexOf", + "sortText": "indexOf", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 21 }, + "start": { "character": 13, "line": 21 } + } + } + ], + "deprecated": true, "detail": "(t<'a>, ~target: int, ~start: int) => array<'a>", - "documentation": {"kind": "markdown", "value": "Deprecated: Use `copyWithin` instead\n\n\n`copyWithinToEnd(typedArray, ~target, ~start)` copies values from `start` through the end of the view into the range beginning at `target`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.copyWithin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/copyWithin) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3, 4])\nlet _ = TypedArray.copyWithinToEnd(view, ~target=0, ~start=2)\nTypedArray.toString(view) == \"3,4,3,4\"\n```\n"}, - "sortText": "copyWithinToEnd", + "documentation": { + "kind": "markdown", + "value": "Deprecated: Use `copyWithin` instead\n\n\n`copyWithinToEnd(typedArray, ~target, ~start)` copies values from `start` through the end of the view into the range beginning at `target`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.copyWithin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/copyWithin) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3, 4])\nlet _ = TypedArray.copyWithinToEnd(view, ~target=0, ~start=2)\nTypedArray.toString(view) == \"3,4,3,4\"\n```\n" + }, "insertText": "->TypedArray.copyWithinToEnd", - "additionalTextEdits": [{ - "range": {"start": {"line": 21, "character": 13}, "end": {"line": 21, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.some", "kind": 12, - "tags": [], + "label": "->TypedArray.copyWithinToEnd", + "sortText": "copyWithinToEnd", + "tags": [ 1 ] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 21 }, + "start": { "character": 13, "line": 21 } + } + } + ], "detail": "(t<'a>, 'a => bool) => bool", - "documentation": {"kind": "markdown", "value": "\n`some(typedArray, predicate)` returns `true` if `predicate` returns `true` for at least one element.\n\nSee [`TypedArray.prototype.some`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/some) on MDN.\n"}, - "sortText": "some", + "documentation": { + "kind": "markdown", + "value": "\n`some(typedArray, predicate)` returns `true` if `predicate` returns `true` for at least one element.\n\nSee [`TypedArray.prototype.some`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/some) on MDN.\n" + }, "insertText": "->TypedArray.some", - "additionalTextEdits": [{ - "range": {"start": {"line": 21, "character": 13}, "end": {"line": 21, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.reduceWithIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.some", + "sortText": "some", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 21 }, + "start": { "character": 13, "line": 21 } + } + } + ], "detail": "(t<'a>, ('b, 'a, int) => 'b, 'b) => 'b", - "documentation": {"kind": "markdown", "value": "\n`reduceWithIndex(typedArray, reducer, initial)` is the indexed variant of `reduce`.\n"}, - "sortText": "reduceWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`reduceWithIndex(typedArray, reducer, initial)` is the indexed variant of `reduce`.\n" + }, "insertText": "->TypedArray.reduceWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 21, "character": 13}, "end": {"line": 21, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.map", "kind": 12, - "tags": [], + "label": "->TypedArray.reduceWithIndex", + "sortText": "reduceWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 21 }, + "start": { "character": 13, "line": 21 } + } + } + ], "detail": "(t<'a>, 'a => 'b) => t<'b>", - "documentation": {"kind": "markdown", "value": "\n`map(typedArray, f)` returns a new typed array whose elements are produced by applying `f` to each element.\n\nSee [`TypedArray.prototype.map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/map) on MDN.\n"}, - "sortText": "map", + "documentation": { + "kind": "markdown", + "value": "\n`map(typedArray, f)` returns a new typed array whose elements are produced by applying `f` to each element.\n\nSee [`TypedArray.prototype.map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/map) on MDN.\n" + }, "insertText": "->TypedArray.map", - "additionalTextEdits": [{ - "range": {"start": {"line": 21, "character": 13}, "end": {"line": 21, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.toSorted", "kind": 12, - "tags": [], + "label": "->TypedArray.map", + "sortText": "map", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 21 }, + "start": { "character": 13, "line": 21 } + } + } + ], "detail": "(t<'a>, ('a, 'a) => Ordering.t) => t<'a>", - "documentation": {"kind": "markdown", "value": "\n`toSorted(typedArray, comparator)` returns a new typed array containing the sorted values, leaving the original untouched.\n\nSee [`TypedArray.prototype.toSorted`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/toSorted) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([3, 1, 2])\nlet sorted = TypedArray.toSorted(view, Int.compare)\nTypedArray.toString(sorted) == \"1,2,3\"\nTypedArray.toString(view) == \"3,1,2\"\n```\n"}, - "sortText": "toSorted", + "documentation": { + "kind": "markdown", + "value": "\n`toSorted(typedArray, comparator)` returns a new typed array containing the sorted values, leaving the original untouched.\n\nSee [`TypedArray.prototype.toSorted`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/toSorted) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([3, 1, 2])\nlet sorted = TypedArray.toSorted(view, Int.compare)\nTypedArray.toString(sorted) == \"1,2,3\"\nTypedArray.toString(view) == \"3,1,2\"\n```\n" + }, "insertText": "->TypedArray.toSorted", - "additionalTextEdits": [{ - "range": {"start": {"line": 21, "character": 13}, "end": {"line": 21, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.copyAllWithin", "kind": 12, - "tags": [], + "label": "->TypedArray.toSorted", + "sortText": "toSorted", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 21 }, + "start": { "character": 13, "line": 21 } + } + } + ], "detail": "(t<'a>, ~target: int) => array<'a>", - "documentation": {"kind": "markdown", "value": "\n`copyAllWithin(typedArray, ~target)` copies values starting at index `0` over the positions beginning at `target`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.copyWithin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/copyWithin) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([10, 20, 30])\nlet _ = TypedArray.copyAllWithin(view, ~target=1)\nTypedArray.toString(view) == \"10,10,20\"\n```\n"}, - "sortText": "copyAllWithin", + "documentation": { + "kind": "markdown", + "value": "\n`copyAllWithin(typedArray, ~target)` copies values starting at index `0` over the positions beginning at `target`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.copyWithin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/copyWithin) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([10, 20, 30])\nlet _ = TypedArray.copyAllWithin(view, ~target=1)\nTypedArray.toString(view) == \"10,10,20\"\n```\n" + }, "insertText": "->TypedArray.copyAllWithin", - "additionalTextEdits": [{ - "range": {"start": {"line": 21, "character": 13}, "end": {"line": 21, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.subarray", "kind": 12, - "tags": [], + "label": "->TypedArray.copyAllWithin", + "sortText": "copyAllWithin", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 21 }, + "start": { "character": 13, "line": 21 } + } + } + ], "detail": "(t<'a>, ~start: int, ~end: int=?) => t<'a>", - "documentation": {"kind": "markdown", "value": "\n`subarray(typedArray, ~start, ~end)` returns a new view referencing the same buffer over `[start, end)`.\n\nSee [`TypedArray.prototype.subarray`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/subarray) on MDN.\n"}, - "sortText": "subarray", + "documentation": { + "kind": "markdown", + "value": "\n`subarray(typedArray, ~start, ~end)` returns a new view referencing the same buffer over `[start, end)`.\n\nSee [`TypedArray.prototype.subarray`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/subarray) on MDN.\n" + }, "insertText": "->TypedArray.subarray", - "additionalTextEdits": [{ - "range": {"start": {"line": 21, "character": 13}, "end": {"line": 21, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.setArray", "kind": 12, - "tags": [], + "label": "->TypedArray.subarray", + "sortText": "subarray", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 21 }, + "start": { "character": 13, "line": 21 } + } + } + ], "detail": "(t<'a>, array<'a>) => unit", - "documentation": {"kind": "markdown", "value": "\n`setArray(target, source)` copies the values from `source` into `target`, mutating it.\n\nSee [`TypedArray.prototype.set`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/set) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([0, 0])\nTypedArray.setArray(view, [1, 2])\nTypedArray.toString(view) == \"1,2\"\n```\n"}, - "sortText": "setArray", + "documentation": { + "kind": "markdown", + "value": "\n`setArray(target, source)` copies the values from `source` into `target`, mutating it.\n\nSee [`TypedArray.prototype.set`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/set) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([0, 0])\nTypedArray.setArray(view, [1, 2])\nTypedArray.toString(view) == \"1,2\"\n```\n" + }, "insertText": "->TypedArray.setArray", - "additionalTextEdits": [{ - "range": {"start": {"line": 21, "character": 13}, "end": {"line": 21, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.get", "kind": 12, - "tags": [], + "label": "->TypedArray.setArray", + "sortText": "setArray", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 21 }, + "start": { "character": 13, "line": 21 } + } + } + ], "detail": "(t<'a>, int) => option<'a>", - "documentation": {"kind": "markdown", "value": "\n`get(typedArray, index)` returns the element at `index` of `typedArray`.\nReturns `None` if the index does not exist in the typed array. Equivalent to doing `typedArray[index]` in JavaScript.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nTypedArray.get(view, 0) == Some(1)\nTypedArray.get(view, 10) == None\n```\n"}, - "sortText": "get", + "documentation": { + "kind": "markdown", + "value": "\n`get(typedArray, index)` returns the element at `index` of `typedArray`.\nReturns `None` if the index does not exist in the typed array. Equivalent to doing `typedArray[index]` in JavaScript.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nTypedArray.get(view, 0) == Some(1)\nTypedArray.get(view, 10) == None\n```\n" + }, "insertText": "->TypedArray.get", - "additionalTextEdits": [{ - "range": {"start": {"line": 21, "character": 13}, "end": {"line": 21, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.with", "kind": 12, - "tags": [], + "label": "->TypedArray.get", + "sortText": "get", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 21 }, + "start": { "character": 13, "line": 21 } + } + } + ], "detail": "(t<'a>, int, 'a) => t<'a>", - "documentation": {"kind": "markdown", "value": "\n`with(typedArray, index, value)` returns a new typed array where the element at `index` is replaced with `value`.\n\nSee [`TypedArray.prototype.with`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/with) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nlet updated = TypedArray.with(view, 1, 10)\nTypedArray.toString(updated) == \"1,10,3\"\nTypedArray.toString(view) == \"1,2,3\"\n```\n"}, - "sortText": "with", + "documentation": { + "kind": "markdown", + "value": "\n`with(typedArray, index, value)` returns a new typed array where the element at `index` is replaced with `value`.\n\nSee [`TypedArray.prototype.with`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/with) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nlet updated = TypedArray.with(view, 1, 10)\nTypedArray.toString(updated) == \"1,10,3\"\nTypedArray.toString(view) == \"1,2,3\"\n```\n" + }, "insertText": "->TypedArray.with", - "additionalTextEdits": [{ - "range": {"start": {"line": 21, "character": 13}, "end": {"line": 21, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.toReversed", "kind": 12, - "tags": [], + "label": "->TypedArray.with", + "sortText": "with", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 21 }, + "start": { "character": 13, "line": 21 } + } + } + ], "detail": "t<'a> => t<'a>", - "documentation": {"kind": "markdown", "value": "\n`toReversed(typedArray)` returns a new typed array with the elements in reverse order, leaving the original untouched.\n\nSee [`TypedArray.prototype.toReversed`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/toReversed) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nlet reversed = TypedArray.toReversed(view)\nTypedArray.toString(reversed) == \"3,2,1\"\nTypedArray.toString(view) == \"1,2,3\"\n```\n"}, - "sortText": "toReversed", + "documentation": { + "kind": "markdown", + "value": "\n`toReversed(typedArray)` returns a new typed array with the elements in reverse order, leaving the original untouched.\n\nSee [`TypedArray.prototype.toReversed`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/toReversed) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nlet reversed = TypedArray.toReversed(view)\nTypedArray.toString(reversed) == \"3,2,1\"\nTypedArray.toString(view) == \"1,2,3\"\n```\n" + }, "insertText": "->TypedArray.toReversed", - "additionalTextEdits": [{ - "range": {"start": {"line": 21, "character": 13}, "end": {"line": 21, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.copyWithin", "kind": 12, - "tags": [], + "label": "->TypedArray.toReversed", + "sortText": "toReversed", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 21 }, + "start": { "character": 13, "line": 21 } + } + } + ], "detail": "(t<'a>, ~target: int, ~start: int, ~end: int=?) => array<'a>", - "documentation": {"kind": "markdown", "value": "\n`copyWithin(typedArray, ~target, ~start, ~end)` copies the section `[start, end)` onto the range beginning at `target`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.copyWithin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/copyWithin) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3, 4])\nlet _ = TypedArray.copyWithin(view, ~target=1, ~start=2, ~end=4)\nTypedArray.toString(view) == \"1,3,4,4\"\n```\n"}, - "sortText": "copyWithin", + "documentation": { + "kind": "markdown", + "value": "\n`copyWithin(typedArray, ~target, ~start, ~end)` copies the section `[start, end)` onto the range beginning at `target`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.copyWithin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/copyWithin) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3, 4])\nlet _ = TypedArray.copyWithin(view, ~target=1, ~start=2, ~end=4)\nTypedArray.toString(view) == \"1,3,4,4\"\n```\n" + }, "insertText": "->TypedArray.copyWithin", - "additionalTextEdits": [{ - "range": {"start": {"line": 21, "character": 13}, "end": {"line": 21, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.everyWithIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.copyWithin", + "sortText": "copyWithin", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 21 }, + "start": { "character": 13, "line": 21 } + } + } + ], "detail": "(t<'a>, ('a, int) => bool) => bool", - "documentation": {"kind": "markdown", "value": "\n`everyWithIndex(typedArray, checker)` is like `every` but provides the element index to `checker`.\n"}, - "sortText": "everyWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`everyWithIndex(typedArray, checker)` is like `every` but provides the element index to `checker`.\n" + }, "insertText": "->TypedArray.everyWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 21, "character": 13}, "end": {"line": 21, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.toString", "kind": 12, - "tags": [], + "label": "->TypedArray.everyWithIndex", + "sortText": "everyWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 21 }, + "start": { "character": 13, "line": 21 } + } + } + ], "detail": "t<'a> => string", - "documentation": {"kind": "markdown", "value": "\n`toString(typedArray)` returns a comma-separated string of the elements.\n\nSee [`TypedArray.prototype.toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/toString) on MDN.\n\n## Examples\n\n```rescript\nInt32Array.fromArray([1, 2])->TypedArray.toString == \"1,2\"\n```\n"}, - "sortText": "toString", + "documentation": { + "kind": "markdown", + "value": "\n`toString(typedArray)` returns a comma-separated string of the elements.\n\nSee [`TypedArray.prototype.toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/toString) on MDN.\n\n## Examples\n\n```rescript\nInt32Array.fromArray([1, 2])->TypedArray.toString == \"1,2\"\n```\n" + }, "insertText": "->TypedArray.toString", - "additionalTextEdits": [{ - "range": {"start": {"line": 21, "character": 13}, "end": {"line": 21, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.setArrayFrom", "kind": 12, - "tags": [], + "label": "->TypedArray.toString", + "sortText": "toString", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 21 }, + "start": { "character": 13, "line": 21 } + } + } + ], "detail": "(t<'a>, array<'a>, int) => unit", - "documentation": {"kind": "markdown", "value": "\n`setArrayFrom(target, source, index)` copies `source` into `target` starting at `index`.\n\nSee [`TypedArray.prototype.set`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/set) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([0, 0, 0])\nTypedArray.setArrayFrom(view, [5, 6], 1)\nTypedArray.toString(view) == \"0,5,6\"\n```\n"}, - "sortText": "setArrayFrom", + "documentation": { + "kind": "markdown", + "value": "\n`setArrayFrom(target, source, index)` copies `source` into `target` starting at `index`.\n\nSee [`TypedArray.prototype.set`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/set) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([0, 0, 0])\nTypedArray.setArrayFrom(view, [5, 6], 1)\nTypedArray.toString(view) == \"0,5,6\"\n```\n" + }, "insertText": "->TypedArray.setArrayFrom", - "additionalTextEdits": [{ - "range": {"start": {"line": 21, "character": 13}, "end": {"line": 21, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.forEach", "kind": 12, - "tags": [], + "label": "->TypedArray.setArrayFrom", + "sortText": "setArrayFrom", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 21 }, + "start": { "character": 13, "line": 21 } + } + } + ], "detail": "(t<'a>, 'a => unit) => unit", - "documentation": {"kind": "markdown", "value": "\n`forEach(typedArray, f)` runs `f` for every element in order.\n\nSee [`TypedArray.prototype.forEach`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/forEach) on MDN.\n"}, - "sortText": "forEach", + "documentation": { + "kind": "markdown", + "value": "\n`forEach(typedArray, f)` runs `f` for every element in order.\n\nSee [`TypedArray.prototype.forEach`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/forEach) on MDN.\n" + }, "insertText": "->TypedArray.forEach", - "additionalTextEdits": [{ - "range": {"start": {"line": 21, "character": 13}, "end": {"line": 21, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.findWithIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.forEach", + "sortText": "forEach", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 21 }, + "start": { "character": 13, "line": 21 } + } + } + ], "detail": "(t<'a>, ('a, int) => bool) => option<'a>", - "documentation": {"kind": "markdown", "value": "\n`findWithIndex(typedArray, predicate)` behaves like `find`, but `predicate` also receives the index.\n"}, - "sortText": "findWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`findWithIndex(typedArray, predicate)` behaves like `find`, but `predicate` also receives the index.\n" + }, "insertText": "->TypedArray.findWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 21, "character": 13}, "end": {"line": 21, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.fill", "kind": 12, - "tags": [], + "label": "->TypedArray.findWithIndex", + "sortText": "findWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 21 }, + "start": { "character": 13, "line": 21 } + } + } + ], "detail": "(t<'a>, 'a, ~start: int, ~end: int=?) => t<'a>", - "documentation": {"kind": "markdown", "value": "\n`fill(typedArray, value, ~start, ~end)` fills the half-open interval `[start, end)` with `value`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.fill`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/fill) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3, 4])\nlet _ = TypedArray.fill(view, 0, ~start=1, ~end=3)\nTypedArray.toString(view) == \"1,0,0,4\"\n```\n"}, - "sortText": "fill", + "documentation": { + "kind": "markdown", + "value": "\n`fill(typedArray, value, ~start, ~end)` fills the half-open interval `[start, end)` with `value`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.fill`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/fill) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3, 4])\nlet _ = TypedArray.fill(view, 0, ~start=1, ~end=3)\nTypedArray.toString(view) == \"1,0,0,4\"\n```\n" + }, "insertText": "->TypedArray.fill", - "additionalTextEdits": [{ - "range": {"start": {"line": 21, "character": 13}, "end": {"line": 21, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.indexOfFrom", "kind": 12, - "tags": [], + "label": "->TypedArray.fill", + "sortText": "fill", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 21 }, + "start": { "character": 13, "line": 21 } + } + } + ], "detail": "(t<'a>, 'a, int) => int", - "documentation": {"kind": "markdown", "value": "\n`indexOfFrom(typedArray, value, fromIndex)` searches for `value` starting at `fromIndex`.\n"}, - "sortText": "indexOfFrom", + "documentation": { + "kind": "markdown", + "value": "\n`indexOfFrom(typedArray, value, fromIndex)` searches for `value` starting at `fromIndex`.\n" + }, "insertText": "->TypedArray.indexOfFrom", - "additionalTextEdits": [{ - "range": {"start": {"line": 21, "character": 13}, "end": {"line": 21, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.reverse", "kind": 12, - "tags": [], + "label": "->TypedArray.indexOfFrom", + "sortText": "indexOfFrom", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 21 }, + "start": { "character": 13, "line": 21 } + } + } + ], "detail": "t<'a> => unit", - "documentation": {"kind": "markdown", "value": "\n`reverse(typedArray)` reverses the elements of the view in place.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.reverse`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/reverse) on MDN.\n"}, - "sortText": "reverse", + "documentation": { + "kind": "markdown", + "value": "\n`reverse(typedArray)` reverses the elements of the view in place.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.reverse`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/reverse) on MDN.\n" + }, "insertText": "->TypedArray.reverse", - "additionalTextEdits": [{ - "range": {"start": {"line": 21, "character": 13}, "end": {"line": 21, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.byteOffset", "kind": 12, - "tags": [], + "label": "->TypedArray.reverse", + "sortText": "reverse", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 21 }, + "start": { "character": 13, "line": 21 } + } + } + ], "detail": "t<'a> => int", - "documentation": {"kind": "markdown", "value": "\n`byteOffset(typedArray)` returns the offset in bytes from the start of the buffer.\n\nSee [`TypedArray.prototype.byteOffset`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/byteOffset) on MDN.\n"}, - "sortText": "byteOffset", + "documentation": { + "kind": "markdown", + "value": "\n`byteOffset(typedArray)` returns the offset in bytes from the start of the buffer.\n\nSee [`TypedArray.prototype.byteOffset`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/byteOffset) on MDN.\n" + }, "insertText": "->TypedArray.byteOffset", - "additionalTextEdits": [{ - "range": {"start": {"line": 21, "character": 13}, "end": {"line": 21, "character": 14}}, - "newText": "" - }] - }] + "kind": 12, + "label": "->TypedArray.byteOffset", + "sortText": "byteOffset", + "tags": [] + } +] Complete src/CompletionTypedArrays.res 25:13 posCursor:[25:13] posNoWhite:[25:12] Found expr:[25:3->25:13] @@ -4154,679 +7208,1188 @@ CPPipe pathFromEnv:Stdlib.Int8Array found:false Path Stdlib.Int8Array. Path Stdlib.TypedArray. Path -[{ - "label": "->Int8Array.ignore", - "kind": 12, - "tags": [], +[ + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 13, "line": 25 }, + "start": { "character": 12, "line": 25 } + } + } + ], "detail": "t => unit", - "documentation": {"kind": "markdown", "value": "\n `ignore(intArray)` ignores the provided intArray and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further.\n"}, - "sortText": "ignore", + "documentation": { + "kind": "markdown", + "value": "\n `ignore(intArray)` ignores the provided intArray and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further.\n" + }, "insertText": "->Int8Array.ignore", - "additionalTextEdits": [{ - "range": {"start": {"line": 25, "character": 12}, "end": {"line": 25, "character": 13}}, - "newText": "" - }] - }, { - "label": "->TypedArray.findLastIndexWithIndex", "kind": 12, - "tags": [], + "label": "->Int8Array.ignore", + "sortText": "ignore", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 13, "line": 25 }, + "start": { "character": 12, "line": 25 } + } + } + ], "detail": "(t<'a>, ('a, int) => bool) => int", - "documentation": {"kind": "markdown", "value": "\n`findLastIndexWithIndex(typedArray, predicate)` is the indexed variant of `findLastIndex`.\n"}, - "sortText": "findLastIndexWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`findLastIndexWithIndex(typedArray, predicate)` is the indexed variant of `findLastIndex`.\n" + }, "insertText": "->TypedArray.findLastIndexWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 25, "character": 12}, "end": {"line": 25, "character": 13}}, - "newText": "" - }] - }, { - "label": "->TypedArray.lastIndexOf", "kind": 12, - "tags": [], + "label": "->TypedArray.findLastIndexWithIndex", + "sortText": "findLastIndexWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 13, "line": 25 }, + "start": { "character": 12, "line": 25 } + } + } + ], "detail": "(t<'a>, 'a) => int", - "documentation": {"kind": "markdown", "value": "\n`lastIndexOf(typedArray, value)` returns the last index of `value`, or `-1` if not found.\n\nSee [`TypedArray.prototype.lastIndexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/lastIndexOf) on MDN.\n"}, - "sortText": "lastIndexOf", + "documentation": { + "kind": "markdown", + "value": "\n`lastIndexOf(typedArray, value)` returns the last index of `value`, or `-1` if not found.\n\nSee [`TypedArray.prototype.lastIndexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/lastIndexOf) on MDN.\n" + }, "insertText": "->TypedArray.lastIndexOf", - "additionalTextEdits": [{ - "range": {"start": {"line": 25, "character": 12}, "end": {"line": 25, "character": 13}}, - "newText": "" - }] - }, { - "label": "->TypedArray.findLastWithIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.lastIndexOf", + "sortText": "lastIndexOf", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 13, "line": 25 }, + "start": { "character": 12, "line": 25 } + } + } + ], "detail": "(t<'a>, ('a, int) => bool) => option<'a>", - "documentation": {"kind": "markdown", "value": "\n`findLastWithIndex(typedArray, predicate)` is the indexed variant of `findLast`.\n"}, - "sortText": "findLastWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`findLastWithIndex(typedArray, predicate)` is the indexed variant of `findLast`.\n" + }, "insertText": "->TypedArray.findLastWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 25, "character": 12}, "end": {"line": 25, "character": 13}}, - "newText": "" - }] - }, { - "label": "->TypedArray.findLast", "kind": 12, - "tags": [], + "label": "->TypedArray.findLastWithIndex", + "sortText": "findLastWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 13, "line": 25 }, + "start": { "character": 12, "line": 25 } + } + } + ], "detail": "(t<'a>, 'a => bool) => option<'a>", - "documentation": {"kind": "markdown", "value": "\n`findLast(typedArray, predicate)` returns the last element that satisfies `predicate`.\n\nSee [`TypedArray.prototype.findLast`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/findLast) on MDN.\n"}, - "sortText": "findLast", + "documentation": { + "kind": "markdown", + "value": "\n`findLast(typedArray, predicate)` returns the last element that satisfies `predicate`.\n\nSee [`TypedArray.prototype.findLast`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/findLast) on MDN.\n" + }, "insertText": "->TypedArray.findLast", - "additionalTextEdits": [{ - "range": {"start": {"line": 25, "character": 12}, "end": {"line": 25, "character": 13}}, - "newText": "" - }] - }, { - "label": "->TypedArray.filter", "kind": 12, - "tags": [], + "label": "->TypedArray.findLast", + "sortText": "findLast", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 13, "line": 25 }, + "start": { "character": 12, "line": 25 } + } + } + ], "detail": "(t<'a>, 'a => bool) => t<'a>", - "documentation": {"kind": "markdown", "value": "\n`filter(typedArray, predicate)` returns a new typed array containing only elements that satisfy `predicate`.\n\nSee [`TypedArray.prototype.filter`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/filter) on MDN.\n"}, - "sortText": "filter", + "documentation": { + "kind": "markdown", + "value": "\n`filter(typedArray, predicate)` returns a new typed array containing only elements that satisfy `predicate`.\n\nSee [`TypedArray.prototype.filter`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/filter) on MDN.\n" + }, "insertText": "->TypedArray.filter", - "additionalTextEdits": [{ - "range": {"start": {"line": 25, "character": 12}, "end": {"line": 25, "character": 13}}, - "newText": "" - }] - }, { - "label": "->TypedArray.byteLength", "kind": 12, - "tags": [], + "label": "->TypedArray.filter", + "sortText": "filter", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 13, "line": 25 }, + "start": { "character": 12, "line": 25 } + } + } + ], "detail": "t<'a> => int", - "documentation": {"kind": "markdown", "value": "\n`byteLength(typedArray)` returns the length in bytes of the view.\n\nSee [`TypedArray.prototype.byteLength`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/byteLength) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2])\nTypedArray.byteLength(view) == 8\n```\n"}, - "sortText": "byteLength", + "documentation": { + "kind": "markdown", + "value": "\n`byteLength(typedArray)` returns the length in bytes of the view.\n\nSee [`TypedArray.prototype.byteLength`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/byteLength) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2])\nTypedArray.byteLength(view) == 8\n```\n" + }, "insertText": "->TypedArray.byteLength", - "additionalTextEdits": [{ - "range": {"start": {"line": 25, "character": 12}, "end": {"line": 25, "character": 13}}, - "newText": "" - }] - }, { - "label": "->TypedArray.ignore", "kind": 12, - "tags": [], + "label": "->TypedArray.byteLength", + "sortText": "byteLength", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 13, "line": 25 }, + "start": { "character": 12, "line": 25 } + } + } + ], "detail": "t<'a> => unit", - "documentation": {"kind": "markdown", "value": "\n `ignore(typedArray)` ignores the provided typedArray and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further.\n"}, - "sortText": "ignore", + "documentation": { + "kind": "markdown", + "value": "\n `ignore(typedArray)` ignores the provided typedArray and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further.\n" + }, "insertText": "->TypedArray.ignore", - "additionalTextEdits": [{ - "range": {"start": {"line": 25, "character": 12}, "end": {"line": 25, "character": 13}}, - "newText": "" - }] - }, { - "label": "->TypedArray.reduceRightWithIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.ignore", + "sortText": "ignore", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 13, "line": 25 }, + "start": { "character": 12, "line": 25 } + } + } + ], "detail": "(t<'a>, ('b, 'a, int) => 'b, 'b) => 'b", - "documentation": {"kind": "markdown", "value": "\n`reduceRightWithIndex(typedArray, reducer, initial)` is the indexed variant of `reduceRight`.\n"}, - "sortText": "reduceRightWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`reduceRightWithIndex(typedArray, reducer, initial)` is the indexed variant of `reduceRight`.\n" + }, "insertText": "->TypedArray.reduceRightWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 25, "character": 12}, "end": {"line": 25, "character": 13}}, - "newText": "" - }] - }, { - "label": "->TypedArray.reduceRight", "kind": 12, - "tags": [], + "label": "->TypedArray.reduceRightWithIndex", + "sortText": "reduceRightWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 13, "line": 25 }, + "start": { "character": 12, "line": 25 } + } + } + ], "detail": "(t<'a>, ('b, 'a) => 'b, 'b) => 'b", - "documentation": {"kind": "markdown", "value": "\n`reduceRight(typedArray, reducer, initial)` is like `reduce` but processes the elements from right to left.\n\nSee [`TypedArray.prototype.reduceRight`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/reduceRight) on MDN.\n"}, - "sortText": "reduceRight", + "documentation": { + "kind": "markdown", + "value": "\n`reduceRight(typedArray, reducer, initial)` is like `reduce` but processes the elements from right to left.\n\nSee [`TypedArray.prototype.reduceRight`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/reduceRight) on MDN.\n" + }, "insertText": "->TypedArray.reduceRight", - "additionalTextEdits": [{ - "range": {"start": {"line": 25, "character": 12}, "end": {"line": 25, "character": 13}}, - "newText": "" - }] - }, { - "label": "->TypedArray.joinWith", "kind": 12, - "tags": [], + "label": "->TypedArray.reduceRight", + "sortText": "reduceRight", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 13, "line": 25 }, + "start": { "character": 12, "line": 25 } + } + } + ], "detail": "(t<'a>, string) => string", - "documentation": {"kind": "markdown", "value": "\n`joinWith(typedArray, separator)` returns a string formed by the elements joined with `separator`.\n\nSee [`TypedArray.prototype.join`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/join) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nTypedArray.joinWith(view, \"-\") == \"1-2-3\"\n```\n"}, - "sortText": "joinWith", + "documentation": { + "kind": "markdown", + "value": "\n`joinWith(typedArray, separator)` returns a string formed by the elements joined with `separator`.\n\nSee [`TypedArray.prototype.join`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/join) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nTypedArray.joinWith(view, \"-\") == \"1-2-3\"\n```\n" + }, "insertText": "->TypedArray.joinWith", - "additionalTextEdits": [{ - "range": {"start": {"line": 25, "character": 12}, "end": {"line": 25, "character": 13}}, - "newText": "" - }] - }, { - "label": "->TypedArray.buffer", "kind": 12, - "tags": [], + "label": "->TypedArray.joinWith", + "sortText": "joinWith", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 13, "line": 25 }, + "start": { "character": 12, "line": 25 } + } + } + ], "detail": "t<'a> => ArrayBuffer.t", - "documentation": {"kind": "markdown", "value": "\n`buffer(typedArray)` returns the underlying `ArrayBuffer` backing this view.\n\nSee [`TypedArray.prototype.buffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/buffer) on MDN.\n"}, - "sortText": "buffer", + "documentation": { + "kind": "markdown", + "value": "\n`buffer(typedArray)` returns the underlying `ArrayBuffer` backing this view.\n\nSee [`TypedArray.prototype.buffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/buffer) on MDN.\n" + }, "insertText": "->TypedArray.buffer", - "additionalTextEdits": [{ - "range": {"start": {"line": 25, "character": 12}, "end": {"line": 25, "character": 13}}, - "newText": "" - }] - }, { - "label": "->TypedArray.reduce", "kind": 12, - "tags": [], + "label": "->TypedArray.buffer", + "sortText": "buffer", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 13, "line": 25 }, + "start": { "character": 12, "line": 25 } + } + } + ], "detail": "(t<'a>, ('b, 'a) => 'b, 'b) => 'b", - "documentation": {"kind": "markdown", "value": "\n`reduce(typedArray, reducer, initial)` combines the elements from left to right using `reducer`.\n\nSee [`TypedArray.prototype.reduce`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/reduce) on MDN.\n"}, - "sortText": "reduce", + "documentation": { + "kind": "markdown", + "value": "\n`reduce(typedArray, reducer, initial)` combines the elements from left to right using `reducer`.\n\nSee [`TypedArray.prototype.reduce`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/reduce) on MDN.\n" + }, "insertText": "->TypedArray.reduce", - "additionalTextEdits": [{ - "range": {"start": {"line": 25, "character": 12}, "end": {"line": 25, "character": 13}}, - "newText": "" - }] - }, { - "label": "->TypedArray.forEachWithIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.reduce", + "sortText": "reduce", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 13, "line": 25 }, + "start": { "character": 12, "line": 25 } + } + } + ], "detail": "(t<'a>, ('a, int) => unit) => unit", - "documentation": {"kind": "markdown", "value": "\n`forEachWithIndex(typedArray, f)` runs `f` for every element, also providing the index.\n"}, - "sortText": "forEachWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`forEachWithIndex(typedArray, f)` runs `f` for every element, also providing the index.\n" + }, "insertText": "->TypedArray.forEachWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 25, "character": 12}, "end": {"line": 25, "character": 13}}, - "newText": "" - }] - }, { - "label": "->TypedArray.copy", "kind": 12, - "tags": [], + "label": "->TypedArray.forEachWithIndex", + "sortText": "forEachWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 13, "line": 25 }, + "start": { "character": 12, "line": 25 } + } + } + ], "detail": "t<'a> => t<'a>", - "documentation": {"kind": "markdown", "value": "\n`copy(typedArray)` produces a shallow copy of the typed array.\n"}, - "sortText": "copy", + "documentation": { + "kind": "markdown", + "value": "\n`copy(typedArray)` produces a shallow copy of the typed array.\n" + }, "insertText": "->TypedArray.copy", - "additionalTextEdits": [{ - "range": {"start": {"line": 25, "character": 12}, "end": {"line": 25, "character": 13}}, - "newText": "" - }] - }, { - "label": "->TypedArray.someWithIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.copy", + "sortText": "copy", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 13, "line": 25 }, + "start": { "character": 12, "line": 25 } + } + } + ], "detail": "(t<'a>, ('a, int) => bool) => bool", - "documentation": {"kind": "markdown", "value": "\n`someWithIndex(typedArray, predicate)` behaves like `some`, but `predicate` also receives the element index.\n"}, - "sortText": "someWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`someWithIndex(typedArray, predicate)` behaves like `some`, but `predicate` also receives the element index.\n" + }, "insertText": "->TypedArray.someWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 25, "character": 12}, "end": {"line": 25, "character": 13}}, - "newText": "" - }] - }, { - "label": "->TypedArray.findIndexWithIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.someWithIndex", + "sortText": "someWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 13, "line": 25 }, + "start": { "character": 12, "line": 25 } + } + } + ], "detail": "(t<'a>, ('a, int) => bool) => int", - "documentation": {"kind": "markdown", "value": "\n`findIndexWithIndex(typedArray, predicate)` is the indexed variant of `findIndex`.\n"}, - "sortText": "findIndexWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`findIndexWithIndex(typedArray, predicate)` is the indexed variant of `findIndex`.\n" + }, "insertText": "->TypedArray.findIndexWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 25, "character": 12}, "end": {"line": 25, "character": 13}}, - "newText": "" - }] - }, { - "label": "->TypedArray.sliceToEnd", "kind": 12, - "tags": [1], + "label": "->TypedArray.findIndexWithIndex", + "sortText": "findIndexWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 13, "line": 25 }, + "start": { "character": 12, "line": 25 } + } + } + ], + "deprecated": true, "detail": "(t<'a>, ~start: int) => t<'a>", - "documentation": {"kind": "markdown", "value": "Deprecated: Use `slice` instead\n\n\n`sliceToEnd(typedArray, ~start)` returns the elements from `start` through the end in a new typed array.\n"}, - "sortText": "sliceToEnd", + "documentation": { + "kind": "markdown", + "value": "Deprecated: Use `slice` instead\n\n\n`sliceToEnd(typedArray, ~start)` returns the elements from `start` through the end in a new typed array.\n" + }, "insertText": "->TypedArray.sliceToEnd", - "additionalTextEdits": [{ - "range": {"start": {"line": 25, "character": 12}, "end": {"line": 25, "character": 13}}, - "newText": "" - }] - }, { - "label": "->TypedArray.slice", "kind": 12, - "tags": [], + "label": "->TypedArray.sliceToEnd", + "sortText": "sliceToEnd", + "tags": [ 1 ] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 13, "line": 25 }, + "start": { "character": 12, "line": 25 } + } + } + ], "detail": "(t<'a>, ~start: int, ~end: int=?) => t<'a>", - "documentation": {"kind": "markdown", "value": "\n`slice(typedArray, ~start, ~end)` returns a new typed array containing the elements in `[start, end)`.\n\nSee [`TypedArray.prototype.slice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/slice) on MDN.\n"}, - "sortText": "slice", + "documentation": { + "kind": "markdown", + "value": "\n`slice(typedArray, ~start, ~end)` returns a new typed array containing the elements in `[start, end)`.\n\nSee [`TypedArray.prototype.slice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/slice) on MDN.\n" + }, "insertText": "->TypedArray.slice", - "additionalTextEdits": [{ - "range": {"start": {"line": 25, "character": 12}, "end": {"line": 25, "character": 13}}, - "newText": "" - }] - }, { - "label": "->TypedArray.findLastIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.slice", + "sortText": "slice", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 13, "line": 25 }, + "start": { "character": 12, "line": 25 } + } + } + ], "detail": "(t<'a>, 'a => bool) => int", - "documentation": {"kind": "markdown", "value": "\n`findLastIndex(typedArray, predicate)` returns the index of the last matching element, or `-1` if none do.\n\nSee [`TypedArray.prototype.findLastIndex`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/findLastIndex) on MDN.\n"}, - "sortText": "findLastIndex", + "documentation": { + "kind": "markdown", + "value": "\n`findLastIndex(typedArray, predicate)` returns the index of the last matching element, or `-1` if none do.\n\nSee [`TypedArray.prototype.findLastIndex`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/findLastIndex) on MDN.\n" + }, "insertText": "->TypedArray.findLastIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 25, "character": 12}, "end": {"line": 25, "character": 13}}, - "newText": "" - }] - }, { - "label": "->TypedArray.includes", "kind": 12, - "tags": [], + "label": "->TypedArray.findLastIndex", + "sortText": "findLastIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 13, "line": 25 }, + "start": { "character": 12, "line": 25 } + } + } + ], "detail": "(t<'a>, 'a) => bool", - "documentation": {"kind": "markdown", "value": "\n`includes(typedArray, value)` returns `true` if `value` occurs in the typed array.\n\nSee [`TypedArray.prototype.includes`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/includes) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nTypedArray.includes(view, 2) == true\nTypedArray.includes(view, 10) == false\n```\n"}, - "sortText": "includes", + "documentation": { + "kind": "markdown", + "value": "\n`includes(typedArray, value)` returns `true` if `value` occurs in the typed array.\n\nSee [`TypedArray.prototype.includes`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/includes) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nTypedArray.includes(view, 2) == true\nTypedArray.includes(view, 10) == false\n```\n" + }, "insertText": "->TypedArray.includes", - "additionalTextEdits": [{ - "range": {"start": {"line": 25, "character": 12}, "end": {"line": 25, "character": 13}}, - "newText": "" - }] - }, { - "label": "->TypedArray.fillToEnd", "kind": 12, - "tags": [1], + "label": "->TypedArray.includes", + "sortText": "includes", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 13, "line": 25 }, + "start": { "character": 12, "line": 25 } + } + } + ], + "deprecated": true, "detail": "(t<'a>, 'a, ~start: int) => t<'a>", - "documentation": {"kind": "markdown", "value": "Deprecated: Use `fill` instead\n\n\n`fillToEnd(typedArray, value, ~start)` fills from `start` through the end with `value`.\n\nBeware this will *mutate* the typed array.\n"}, - "sortText": "fillToEnd", + "documentation": { + "kind": "markdown", + "value": "Deprecated: Use `fill` instead\n\n\n`fillToEnd(typedArray, value, ~start)` fills from `start` through the end with `value`.\n\nBeware this will *mutate* the typed array.\n" + }, "insertText": "->TypedArray.fillToEnd", - "additionalTextEdits": [{ - "range": {"start": {"line": 25, "character": 12}, "end": {"line": 25, "character": 13}}, - "newText": "" - }] - }, { - "label": "->TypedArray.fillAll", "kind": 12, - "tags": [], + "label": "->TypedArray.fillToEnd", + "sortText": "fillToEnd", + "tags": [ 1 ] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 13, "line": 25 }, + "start": { "character": 12, "line": 25 } + } + } + ], "detail": "(t<'a>, 'a) => t<'a>", - "documentation": {"kind": "markdown", "value": "\n`fillAll(typedArray, value)` fills every element with `value`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.fill`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/fill) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nlet _ = TypedArray.fillAll(view, 9)\nTypedArray.toString(view) == \"9,9,9\"\n```\n"}, - "sortText": "fillAll", + "documentation": { + "kind": "markdown", + "value": "\n`fillAll(typedArray, value)` fills every element with `value`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.fill`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/fill) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nlet _ = TypedArray.fillAll(view, 9)\nTypedArray.toString(view) == \"9,9,9\"\n```\n" + }, "insertText": "->TypedArray.fillAll", - "additionalTextEdits": [{ - "range": {"start": {"line": 25, "character": 12}, "end": {"line": 25, "character": 13}}, - "newText": "" - }] - }, { - "label": "->TypedArray.find", "kind": 12, - "tags": [], + "label": "->TypedArray.fillAll", + "sortText": "fillAll", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 13, "line": 25 }, + "start": { "character": 12, "line": 25 } + } + } + ], "detail": "(t<'a>, 'a => bool) => option<'a>", - "documentation": {"kind": "markdown", "value": "\n`find(typedArray, predicate)` returns the first element that satisfies `predicate`, or `None` if nothing matches.\n\nSee [`TypedArray.prototype.find`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/find) on MDN.\n"}, - "sortText": "find", + "documentation": { + "kind": "markdown", + "value": "\n`find(typedArray, predicate)` returns the first element that satisfies `predicate`, or `None` if nothing matches.\n\nSee [`TypedArray.prototype.find`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/find) on MDN.\n" + }, "insertText": "->TypedArray.find", - "additionalTextEdits": [{ - "range": {"start": {"line": 25, "character": 12}, "end": {"line": 25, "character": 13}}, - "newText": "" - }] - }, { - "label": "->TypedArray.subarrayToEnd", "kind": 12, - "tags": [1], + "label": "->TypedArray.find", + "sortText": "find", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 13, "line": 25 }, + "start": { "character": 12, "line": 25 } + } + } + ], + "deprecated": true, "detail": "(t<'a>, ~start: int) => t<'a>", - "documentation": {"kind": "markdown", "value": "Deprecated: Use `subarray` instead\n\n\n`subarrayToEnd(typedArray, ~start)` returns a new view from `start` to the end of the buffer.\n"}, - "sortText": "subarrayToEnd", + "documentation": { + "kind": "markdown", + "value": "Deprecated: Use `subarray` instead\n\n\n`subarrayToEnd(typedArray, ~start)` returns a new view from `start` to the end of the buffer.\n" + }, "insertText": "->TypedArray.subarrayToEnd", - "additionalTextEdits": [{ - "range": {"start": {"line": 25, "character": 12}, "end": {"line": 25, "character": 13}}, - "newText": "" - }] - }, { - "label": "->TypedArray.set", "kind": 12, - "tags": [], + "label": "->TypedArray.subarrayToEnd", + "sortText": "subarrayToEnd", + "tags": [ 1 ] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 13, "line": 25 }, + "start": { "character": 12, "line": 25 } + } + } + ], "detail": "(t<'a>, int, 'a) => unit", - "documentation": {"kind": "markdown", "value": "\n`set(typedArray, index, item)` sets the provided `item` at `index` of `typedArray`.\n\nBeware this will *mutate* the array.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2])\nTypedArray.set(view, 1, 5)\nTypedArray.get(view, 1) == Some(5)\n```\n"}, - "sortText": "set", + "documentation": { + "kind": "markdown", + "value": "\n`set(typedArray, index, item)` sets the provided `item` at `index` of `typedArray`.\n\nBeware this will *mutate* the array.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2])\nTypedArray.set(view, 1, 5)\nTypedArray.get(view, 1) == Some(5)\n```\n" + }, "insertText": "->TypedArray.set", - "additionalTextEdits": [{ - "range": {"start": {"line": 25, "character": 12}, "end": {"line": 25, "character": 13}}, - "newText": "" - }] - }, { - "label": "->TypedArray.toLocaleString", "kind": 12, - "tags": [], + "label": "->TypedArray.set", + "sortText": "set", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 13, "line": 25 }, + "start": { "character": 12, "line": 25 } + } + } + ], "detail": "t<'a> => string", - "documentation": {"kind": "markdown", "value": "\n`toLocaleString(typedArray)` concatenates the elements using locale-aware formatting.\n\nSee [`TypedArray.prototype.toLocaleString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/toLocaleString) on MDN.\n"}, - "sortText": "toLocaleString", + "documentation": { + "kind": "markdown", + "value": "\n`toLocaleString(typedArray)` concatenates the elements using locale-aware formatting.\n\nSee [`TypedArray.prototype.toLocaleString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/toLocaleString) on MDN.\n" + }, "insertText": "->TypedArray.toLocaleString", - "additionalTextEdits": [{ - "range": {"start": {"line": 25, "character": 12}, "end": {"line": 25, "character": 13}}, - "newText": "" - }] - }, { - "label": "->TypedArray.lastIndexOfFrom", "kind": 12, - "tags": [], + "label": "->TypedArray.toLocaleString", + "sortText": "toLocaleString", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 13, "line": 25 }, + "start": { "character": 12, "line": 25 } + } + } + ], "detail": "(t<'a>, 'a, int) => int", - "documentation": {"kind": "markdown", "value": "\n`lastIndexOfFrom(typedArray, value, fromIndex)` searches backwards starting at `fromIndex`.\n"}, - "sortText": "lastIndexOfFrom", + "documentation": { + "kind": "markdown", + "value": "\n`lastIndexOfFrom(typedArray, value, fromIndex)` searches backwards starting at `fromIndex`.\n" + }, "insertText": "->TypedArray.lastIndexOfFrom", - "additionalTextEdits": [{ - "range": {"start": {"line": 25, "character": 12}, "end": {"line": 25, "character": 13}}, - "newText": "" - }] - }, { - "label": "->TypedArray.findIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.lastIndexOfFrom", + "sortText": "lastIndexOfFrom", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 13, "line": 25 }, + "start": { "character": 12, "line": 25 } + } + } + ], "detail": "(t<'a>, 'a => bool) => int", - "documentation": {"kind": "markdown", "value": "\n`findIndex(typedArray, predicate)` returns the index of the first element that satisfies `predicate`, or `-1` if none do.\n\nSee [`TypedArray.prototype.findIndex`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/findIndex) on MDN.\n"}, - "sortText": "findIndex", + "documentation": { + "kind": "markdown", + "value": "\n`findIndex(typedArray, predicate)` returns the index of the first element that satisfies `predicate`, or `-1` if none do.\n\nSee [`TypedArray.prototype.findIndex`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/findIndex) on MDN.\n" + }, "insertText": "->TypedArray.findIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 25, "character": 12}, "end": {"line": 25, "character": 13}}, - "newText": "" - }] - }, { - "label": "->TypedArray.filterWithIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.findIndex", + "sortText": "findIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 13, "line": 25 }, + "start": { "character": 12, "line": 25 } + } + } + ], "detail": "(t<'a>, ('a, int) => bool) => t<'a>", - "documentation": {"kind": "markdown", "value": "\n`filterWithIndex(typedArray, predicate)` behaves like `filter` but also passes the index to `predicate`.\n"}, - "sortText": "filterWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`filterWithIndex(typedArray, predicate)` behaves like `filter` but also passes the index to `predicate`.\n" + }, "insertText": "->TypedArray.filterWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 25, "character": 12}, "end": {"line": 25, "character": 13}}, - "newText": "" - }] - }, { - "label": "->TypedArray.sort", "kind": 12, - "tags": [], + "label": "->TypedArray.filterWithIndex", + "sortText": "filterWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 13, "line": 25 }, + "start": { "character": 12, "line": 25 } + } + } + ], "detail": "(t<'a>, ('a, 'a) => Ordering.t) => unit", - "documentation": {"kind": "markdown", "value": "\n`sort(typedArray, comparator)` sorts the values in place using `comparator`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.sort`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/sort) on MDN.\n"}, - "sortText": "sort", + "documentation": { + "kind": "markdown", + "value": "\n`sort(typedArray, comparator)` sorts the values in place using `comparator`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.sort`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/sort) on MDN.\n" + }, "insertText": "->TypedArray.sort", - "additionalTextEdits": [{ - "range": {"start": {"line": 25, "character": 12}, "end": {"line": 25, "character": 13}}, - "newText": "" - }] - }, { - "label": "->TypedArray.mapWithIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.sort", + "sortText": "sort", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 13, "line": 25 }, + "start": { "character": 12, "line": 25 } + } + } + ], "detail": "(t<'a>, ('a, int) => 'b) => t<'b>", - "documentation": {"kind": "markdown", "value": "\n`mapWithIndex(typedArray, f)` behaves like `map`, but `f` also receives the index.\n"}, - "sortText": "mapWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`mapWithIndex(typedArray, f)` behaves like `map`, but `f` also receives the index.\n" + }, "insertText": "->TypedArray.mapWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 25, "character": 12}, "end": {"line": 25, "character": 13}}, - "newText": "" - }] - }, { - "label": "->TypedArray.every", "kind": 12, - "tags": [], + "label": "->TypedArray.mapWithIndex", + "sortText": "mapWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 13, "line": 25 }, + "start": { "character": 12, "line": 25 } + } + } + ], "detail": "(t<'a>, 'a => bool) => bool", - "documentation": {"kind": "markdown", "value": "\n`every(typedArray, predicate)` returns `true` if `predicate` returns `true` for every element.\n\nSee [`TypedArray.prototype.every`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/every) on MDN.\n"}, - "sortText": "every", + "documentation": { + "kind": "markdown", + "value": "\n`every(typedArray, predicate)` returns `true` if `predicate` returns `true` for every element.\n\nSee [`TypedArray.prototype.every`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/every) on MDN.\n" + }, "insertText": "->TypedArray.every", - "additionalTextEdits": [{ - "range": {"start": {"line": 25, "character": 12}, "end": {"line": 25, "character": 13}}, - "newText": "" - }] - }, { - "label": "->TypedArray.length", "kind": 12, - "tags": [], + "label": "->TypedArray.every", + "sortText": "every", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 13, "line": 25 }, + "start": { "character": 12, "line": 25 } + } + } + ], "detail": "t<'a> => int", - "documentation": {"kind": "markdown", "value": "\n`length(typedArray)` returns the number of elements.\n\nSee [`TypedArray.prototype.length`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/length) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nTypedArray.length(view) == 3\n```\n"}, - "sortText": "length", + "documentation": { + "kind": "markdown", + "value": "\n`length(typedArray)` returns the number of elements.\n\nSee [`TypedArray.prototype.length`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/length) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nTypedArray.length(view) == 3\n```\n" + }, "insertText": "->TypedArray.length", - "additionalTextEdits": [{ - "range": {"start": {"line": 25, "character": 12}, "end": {"line": 25, "character": 13}}, - "newText": "" - }] - }, { - "label": "->TypedArray.indexOf", "kind": 12, - "tags": [], + "label": "->TypedArray.length", + "sortText": "length", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 13, "line": 25 }, + "start": { "character": 12, "line": 25 } + } + } + ], "detail": "(t<'a>, 'a) => int", - "documentation": {"kind": "markdown", "value": "\n`indexOf(typedArray, value)` returns the first index of `value`, or `-1` when not found.\n\nSee [`TypedArray.prototype.indexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/indexOf) on MDN.\n"}, - "sortText": "indexOf", + "documentation": { + "kind": "markdown", + "value": "\n`indexOf(typedArray, value)` returns the first index of `value`, or `-1` when not found.\n\nSee [`TypedArray.prototype.indexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/indexOf) on MDN.\n" + }, "insertText": "->TypedArray.indexOf", - "additionalTextEdits": [{ - "range": {"start": {"line": 25, "character": 12}, "end": {"line": 25, "character": 13}}, - "newText": "" - }] - }, { - "label": "->TypedArray.copyWithinToEnd", "kind": 12, - "tags": [1], + "label": "->TypedArray.indexOf", + "sortText": "indexOf", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 13, "line": 25 }, + "start": { "character": 12, "line": 25 } + } + } + ], + "deprecated": true, "detail": "(t<'a>, ~target: int, ~start: int) => array<'a>", - "documentation": {"kind": "markdown", "value": "Deprecated: Use `copyWithin` instead\n\n\n`copyWithinToEnd(typedArray, ~target, ~start)` copies values from `start` through the end of the view into the range beginning at `target`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.copyWithin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/copyWithin) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3, 4])\nlet _ = TypedArray.copyWithinToEnd(view, ~target=0, ~start=2)\nTypedArray.toString(view) == \"3,4,3,4\"\n```\n"}, - "sortText": "copyWithinToEnd", + "documentation": { + "kind": "markdown", + "value": "Deprecated: Use `copyWithin` instead\n\n\n`copyWithinToEnd(typedArray, ~target, ~start)` copies values from `start` through the end of the view into the range beginning at `target`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.copyWithin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/copyWithin) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3, 4])\nlet _ = TypedArray.copyWithinToEnd(view, ~target=0, ~start=2)\nTypedArray.toString(view) == \"3,4,3,4\"\n```\n" + }, "insertText": "->TypedArray.copyWithinToEnd", - "additionalTextEdits": [{ - "range": {"start": {"line": 25, "character": 12}, "end": {"line": 25, "character": 13}}, - "newText": "" - }] - }, { - "label": "->TypedArray.some", "kind": 12, - "tags": [], + "label": "->TypedArray.copyWithinToEnd", + "sortText": "copyWithinToEnd", + "tags": [ 1 ] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 13, "line": 25 }, + "start": { "character": 12, "line": 25 } + } + } + ], "detail": "(t<'a>, 'a => bool) => bool", - "documentation": {"kind": "markdown", "value": "\n`some(typedArray, predicate)` returns `true` if `predicate` returns `true` for at least one element.\n\nSee [`TypedArray.prototype.some`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/some) on MDN.\n"}, - "sortText": "some", + "documentation": { + "kind": "markdown", + "value": "\n`some(typedArray, predicate)` returns `true` if `predicate` returns `true` for at least one element.\n\nSee [`TypedArray.prototype.some`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/some) on MDN.\n" + }, "insertText": "->TypedArray.some", - "additionalTextEdits": [{ - "range": {"start": {"line": 25, "character": 12}, "end": {"line": 25, "character": 13}}, - "newText": "" - }] - }, { - "label": "->TypedArray.reduceWithIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.some", + "sortText": "some", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 13, "line": 25 }, + "start": { "character": 12, "line": 25 } + } + } + ], "detail": "(t<'a>, ('b, 'a, int) => 'b, 'b) => 'b", - "documentation": {"kind": "markdown", "value": "\n`reduceWithIndex(typedArray, reducer, initial)` is the indexed variant of `reduce`.\n"}, - "sortText": "reduceWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`reduceWithIndex(typedArray, reducer, initial)` is the indexed variant of `reduce`.\n" + }, "insertText": "->TypedArray.reduceWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 25, "character": 12}, "end": {"line": 25, "character": 13}}, - "newText": "" - }] - }, { - "label": "->TypedArray.map", "kind": 12, - "tags": [], + "label": "->TypedArray.reduceWithIndex", + "sortText": "reduceWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 13, "line": 25 }, + "start": { "character": 12, "line": 25 } + } + } + ], "detail": "(t<'a>, 'a => 'b) => t<'b>", - "documentation": {"kind": "markdown", "value": "\n`map(typedArray, f)` returns a new typed array whose elements are produced by applying `f` to each element.\n\nSee [`TypedArray.prototype.map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/map) on MDN.\n"}, - "sortText": "map", + "documentation": { + "kind": "markdown", + "value": "\n`map(typedArray, f)` returns a new typed array whose elements are produced by applying `f` to each element.\n\nSee [`TypedArray.prototype.map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/map) on MDN.\n" + }, "insertText": "->TypedArray.map", - "additionalTextEdits": [{ - "range": {"start": {"line": 25, "character": 12}, "end": {"line": 25, "character": 13}}, - "newText": "" - }] - }, { - "label": "->TypedArray.toSorted", "kind": 12, - "tags": [], + "label": "->TypedArray.map", + "sortText": "map", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 13, "line": 25 }, + "start": { "character": 12, "line": 25 } + } + } + ], "detail": "(t<'a>, ('a, 'a) => Ordering.t) => t<'a>", - "documentation": {"kind": "markdown", "value": "\n`toSorted(typedArray, comparator)` returns a new typed array containing the sorted values, leaving the original untouched.\n\nSee [`TypedArray.prototype.toSorted`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/toSorted) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([3, 1, 2])\nlet sorted = TypedArray.toSorted(view, Int.compare)\nTypedArray.toString(sorted) == \"1,2,3\"\nTypedArray.toString(view) == \"3,1,2\"\n```\n"}, - "sortText": "toSorted", + "documentation": { + "kind": "markdown", + "value": "\n`toSorted(typedArray, comparator)` returns a new typed array containing the sorted values, leaving the original untouched.\n\nSee [`TypedArray.prototype.toSorted`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/toSorted) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([3, 1, 2])\nlet sorted = TypedArray.toSorted(view, Int.compare)\nTypedArray.toString(sorted) == \"1,2,3\"\nTypedArray.toString(view) == \"3,1,2\"\n```\n" + }, "insertText": "->TypedArray.toSorted", - "additionalTextEdits": [{ - "range": {"start": {"line": 25, "character": 12}, "end": {"line": 25, "character": 13}}, - "newText": "" - }] - }, { - "label": "->TypedArray.copyAllWithin", "kind": 12, - "tags": [], + "label": "->TypedArray.toSorted", + "sortText": "toSorted", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 13, "line": 25 }, + "start": { "character": 12, "line": 25 } + } + } + ], "detail": "(t<'a>, ~target: int) => array<'a>", - "documentation": {"kind": "markdown", "value": "\n`copyAllWithin(typedArray, ~target)` copies values starting at index `0` over the positions beginning at `target`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.copyWithin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/copyWithin) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([10, 20, 30])\nlet _ = TypedArray.copyAllWithin(view, ~target=1)\nTypedArray.toString(view) == \"10,10,20\"\n```\n"}, - "sortText": "copyAllWithin", + "documentation": { + "kind": "markdown", + "value": "\n`copyAllWithin(typedArray, ~target)` copies values starting at index `0` over the positions beginning at `target`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.copyWithin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/copyWithin) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([10, 20, 30])\nlet _ = TypedArray.copyAllWithin(view, ~target=1)\nTypedArray.toString(view) == \"10,10,20\"\n```\n" + }, "insertText": "->TypedArray.copyAllWithin", - "additionalTextEdits": [{ - "range": {"start": {"line": 25, "character": 12}, "end": {"line": 25, "character": 13}}, - "newText": "" - }] - }, { - "label": "->TypedArray.subarray", "kind": 12, - "tags": [], + "label": "->TypedArray.copyAllWithin", + "sortText": "copyAllWithin", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 13, "line": 25 }, + "start": { "character": 12, "line": 25 } + } + } + ], "detail": "(t<'a>, ~start: int, ~end: int=?) => t<'a>", - "documentation": {"kind": "markdown", "value": "\n`subarray(typedArray, ~start, ~end)` returns a new view referencing the same buffer over `[start, end)`.\n\nSee [`TypedArray.prototype.subarray`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/subarray) on MDN.\n"}, - "sortText": "subarray", + "documentation": { + "kind": "markdown", + "value": "\n`subarray(typedArray, ~start, ~end)` returns a new view referencing the same buffer over `[start, end)`.\n\nSee [`TypedArray.prototype.subarray`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/subarray) on MDN.\n" + }, "insertText": "->TypedArray.subarray", - "additionalTextEdits": [{ - "range": {"start": {"line": 25, "character": 12}, "end": {"line": 25, "character": 13}}, - "newText": "" - }] - }, { - "label": "->TypedArray.setArray", "kind": 12, - "tags": [], + "label": "->TypedArray.subarray", + "sortText": "subarray", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 13, "line": 25 }, + "start": { "character": 12, "line": 25 } + } + } + ], "detail": "(t<'a>, array<'a>) => unit", - "documentation": {"kind": "markdown", "value": "\n`setArray(target, source)` copies the values from `source` into `target`, mutating it.\n\nSee [`TypedArray.prototype.set`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/set) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([0, 0])\nTypedArray.setArray(view, [1, 2])\nTypedArray.toString(view) == \"1,2\"\n```\n"}, - "sortText": "setArray", + "documentation": { + "kind": "markdown", + "value": "\n`setArray(target, source)` copies the values from `source` into `target`, mutating it.\n\nSee [`TypedArray.prototype.set`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/set) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([0, 0])\nTypedArray.setArray(view, [1, 2])\nTypedArray.toString(view) == \"1,2\"\n```\n" + }, "insertText": "->TypedArray.setArray", - "additionalTextEdits": [{ - "range": {"start": {"line": 25, "character": 12}, "end": {"line": 25, "character": 13}}, - "newText": "" - }] - }, { - "label": "->TypedArray.get", "kind": 12, - "tags": [], + "label": "->TypedArray.setArray", + "sortText": "setArray", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 13, "line": 25 }, + "start": { "character": 12, "line": 25 } + } + } + ], "detail": "(t<'a>, int) => option<'a>", - "documentation": {"kind": "markdown", "value": "\n`get(typedArray, index)` returns the element at `index` of `typedArray`.\nReturns `None` if the index does not exist in the typed array. Equivalent to doing `typedArray[index]` in JavaScript.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nTypedArray.get(view, 0) == Some(1)\nTypedArray.get(view, 10) == None\n```\n"}, - "sortText": "get", + "documentation": { + "kind": "markdown", + "value": "\n`get(typedArray, index)` returns the element at `index` of `typedArray`.\nReturns `None` if the index does not exist in the typed array. Equivalent to doing `typedArray[index]` in JavaScript.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nTypedArray.get(view, 0) == Some(1)\nTypedArray.get(view, 10) == None\n```\n" + }, "insertText": "->TypedArray.get", - "additionalTextEdits": [{ - "range": {"start": {"line": 25, "character": 12}, "end": {"line": 25, "character": 13}}, - "newText": "" - }] - }, { - "label": "->TypedArray.with", "kind": 12, - "tags": [], + "label": "->TypedArray.get", + "sortText": "get", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 13, "line": 25 }, + "start": { "character": 12, "line": 25 } + } + } + ], "detail": "(t<'a>, int, 'a) => t<'a>", - "documentation": {"kind": "markdown", "value": "\n`with(typedArray, index, value)` returns a new typed array where the element at `index` is replaced with `value`.\n\nSee [`TypedArray.prototype.with`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/with) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nlet updated = TypedArray.with(view, 1, 10)\nTypedArray.toString(updated) == \"1,10,3\"\nTypedArray.toString(view) == \"1,2,3\"\n```\n"}, - "sortText": "with", + "documentation": { + "kind": "markdown", + "value": "\n`with(typedArray, index, value)` returns a new typed array where the element at `index` is replaced with `value`.\n\nSee [`TypedArray.prototype.with`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/with) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nlet updated = TypedArray.with(view, 1, 10)\nTypedArray.toString(updated) == \"1,10,3\"\nTypedArray.toString(view) == \"1,2,3\"\n```\n" + }, "insertText": "->TypedArray.with", - "additionalTextEdits": [{ - "range": {"start": {"line": 25, "character": 12}, "end": {"line": 25, "character": 13}}, - "newText": "" - }] - }, { - "label": "->TypedArray.toReversed", "kind": 12, - "tags": [], + "label": "->TypedArray.with", + "sortText": "with", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 13, "line": 25 }, + "start": { "character": 12, "line": 25 } + } + } + ], "detail": "t<'a> => t<'a>", - "documentation": {"kind": "markdown", "value": "\n`toReversed(typedArray)` returns a new typed array with the elements in reverse order, leaving the original untouched.\n\nSee [`TypedArray.prototype.toReversed`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/toReversed) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nlet reversed = TypedArray.toReversed(view)\nTypedArray.toString(reversed) == \"3,2,1\"\nTypedArray.toString(view) == \"1,2,3\"\n```\n"}, - "sortText": "toReversed", + "documentation": { + "kind": "markdown", + "value": "\n`toReversed(typedArray)` returns a new typed array with the elements in reverse order, leaving the original untouched.\n\nSee [`TypedArray.prototype.toReversed`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/toReversed) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nlet reversed = TypedArray.toReversed(view)\nTypedArray.toString(reversed) == \"3,2,1\"\nTypedArray.toString(view) == \"1,2,3\"\n```\n" + }, "insertText": "->TypedArray.toReversed", - "additionalTextEdits": [{ - "range": {"start": {"line": 25, "character": 12}, "end": {"line": 25, "character": 13}}, - "newText": "" - }] - }, { - "label": "->TypedArray.copyWithin", "kind": 12, - "tags": [], + "label": "->TypedArray.toReversed", + "sortText": "toReversed", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 13, "line": 25 }, + "start": { "character": 12, "line": 25 } + } + } + ], "detail": "(t<'a>, ~target: int, ~start: int, ~end: int=?) => array<'a>", - "documentation": {"kind": "markdown", "value": "\n`copyWithin(typedArray, ~target, ~start, ~end)` copies the section `[start, end)` onto the range beginning at `target`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.copyWithin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/copyWithin) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3, 4])\nlet _ = TypedArray.copyWithin(view, ~target=1, ~start=2, ~end=4)\nTypedArray.toString(view) == \"1,3,4,4\"\n```\n"}, - "sortText": "copyWithin", + "documentation": { + "kind": "markdown", + "value": "\n`copyWithin(typedArray, ~target, ~start, ~end)` copies the section `[start, end)` onto the range beginning at `target`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.copyWithin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/copyWithin) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3, 4])\nlet _ = TypedArray.copyWithin(view, ~target=1, ~start=2, ~end=4)\nTypedArray.toString(view) == \"1,3,4,4\"\n```\n" + }, "insertText": "->TypedArray.copyWithin", - "additionalTextEdits": [{ - "range": {"start": {"line": 25, "character": 12}, "end": {"line": 25, "character": 13}}, - "newText": "" - }] - }, { - "label": "->TypedArray.everyWithIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.copyWithin", + "sortText": "copyWithin", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 13, "line": 25 }, + "start": { "character": 12, "line": 25 } + } + } + ], "detail": "(t<'a>, ('a, int) => bool) => bool", - "documentation": {"kind": "markdown", "value": "\n`everyWithIndex(typedArray, checker)` is like `every` but provides the element index to `checker`.\n"}, - "sortText": "everyWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`everyWithIndex(typedArray, checker)` is like `every` but provides the element index to `checker`.\n" + }, "insertText": "->TypedArray.everyWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 25, "character": 12}, "end": {"line": 25, "character": 13}}, - "newText": "" - }] - }, { - "label": "->TypedArray.toString", "kind": 12, - "tags": [], + "label": "->TypedArray.everyWithIndex", + "sortText": "everyWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 13, "line": 25 }, + "start": { "character": 12, "line": 25 } + } + } + ], "detail": "t<'a> => string", - "documentation": {"kind": "markdown", "value": "\n`toString(typedArray)` returns a comma-separated string of the elements.\n\nSee [`TypedArray.prototype.toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/toString) on MDN.\n\n## Examples\n\n```rescript\nInt32Array.fromArray([1, 2])->TypedArray.toString == \"1,2\"\n```\n"}, - "sortText": "toString", + "documentation": { + "kind": "markdown", + "value": "\n`toString(typedArray)` returns a comma-separated string of the elements.\n\nSee [`TypedArray.prototype.toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/toString) on MDN.\n\n## Examples\n\n```rescript\nInt32Array.fromArray([1, 2])->TypedArray.toString == \"1,2\"\n```\n" + }, "insertText": "->TypedArray.toString", - "additionalTextEdits": [{ - "range": {"start": {"line": 25, "character": 12}, "end": {"line": 25, "character": 13}}, - "newText": "" - }] - }, { - "label": "->TypedArray.setArrayFrom", "kind": 12, - "tags": [], + "label": "->TypedArray.toString", + "sortText": "toString", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 13, "line": 25 }, + "start": { "character": 12, "line": 25 } + } + } + ], "detail": "(t<'a>, array<'a>, int) => unit", - "documentation": {"kind": "markdown", "value": "\n`setArrayFrom(target, source, index)` copies `source` into `target` starting at `index`.\n\nSee [`TypedArray.prototype.set`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/set) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([0, 0, 0])\nTypedArray.setArrayFrom(view, [5, 6], 1)\nTypedArray.toString(view) == \"0,5,6\"\n```\n"}, - "sortText": "setArrayFrom", + "documentation": { + "kind": "markdown", + "value": "\n`setArrayFrom(target, source, index)` copies `source` into `target` starting at `index`.\n\nSee [`TypedArray.prototype.set`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/set) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([0, 0, 0])\nTypedArray.setArrayFrom(view, [5, 6], 1)\nTypedArray.toString(view) == \"0,5,6\"\n```\n" + }, "insertText": "->TypedArray.setArrayFrom", - "additionalTextEdits": [{ - "range": {"start": {"line": 25, "character": 12}, "end": {"line": 25, "character": 13}}, - "newText": "" - }] - }, { - "label": "->TypedArray.forEach", "kind": 12, - "tags": [], + "label": "->TypedArray.setArrayFrom", + "sortText": "setArrayFrom", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 13, "line": 25 }, + "start": { "character": 12, "line": 25 } + } + } + ], "detail": "(t<'a>, 'a => unit) => unit", - "documentation": {"kind": "markdown", "value": "\n`forEach(typedArray, f)` runs `f` for every element in order.\n\nSee [`TypedArray.prototype.forEach`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/forEach) on MDN.\n"}, - "sortText": "forEach", + "documentation": { + "kind": "markdown", + "value": "\n`forEach(typedArray, f)` runs `f` for every element in order.\n\nSee [`TypedArray.prototype.forEach`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/forEach) on MDN.\n" + }, "insertText": "->TypedArray.forEach", - "additionalTextEdits": [{ - "range": {"start": {"line": 25, "character": 12}, "end": {"line": 25, "character": 13}}, - "newText": "" - }] - }, { - "label": "->TypedArray.findWithIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.forEach", + "sortText": "forEach", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 13, "line": 25 }, + "start": { "character": 12, "line": 25 } + } + } + ], "detail": "(t<'a>, ('a, int) => bool) => option<'a>", - "documentation": {"kind": "markdown", "value": "\n`findWithIndex(typedArray, predicate)` behaves like `find`, but `predicate` also receives the index.\n"}, - "sortText": "findWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`findWithIndex(typedArray, predicate)` behaves like `find`, but `predicate` also receives the index.\n" + }, "insertText": "->TypedArray.findWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 25, "character": 12}, "end": {"line": 25, "character": 13}}, - "newText": "" - }] - }, { - "label": "->TypedArray.fill", "kind": 12, - "tags": [], + "label": "->TypedArray.findWithIndex", + "sortText": "findWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 13, "line": 25 }, + "start": { "character": 12, "line": 25 } + } + } + ], "detail": "(t<'a>, 'a, ~start: int, ~end: int=?) => t<'a>", - "documentation": {"kind": "markdown", "value": "\n`fill(typedArray, value, ~start, ~end)` fills the half-open interval `[start, end)` with `value`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.fill`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/fill) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3, 4])\nlet _ = TypedArray.fill(view, 0, ~start=1, ~end=3)\nTypedArray.toString(view) == \"1,0,0,4\"\n```\n"}, - "sortText": "fill", + "documentation": { + "kind": "markdown", + "value": "\n`fill(typedArray, value, ~start, ~end)` fills the half-open interval `[start, end)` with `value`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.fill`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/fill) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3, 4])\nlet _ = TypedArray.fill(view, 0, ~start=1, ~end=3)\nTypedArray.toString(view) == \"1,0,0,4\"\n```\n" + }, "insertText": "->TypedArray.fill", - "additionalTextEdits": [{ - "range": {"start": {"line": 25, "character": 12}, "end": {"line": 25, "character": 13}}, - "newText": "" - }] - }, { - "label": "->TypedArray.indexOfFrom", "kind": 12, - "tags": [], + "label": "->TypedArray.fill", + "sortText": "fill", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 13, "line": 25 }, + "start": { "character": 12, "line": 25 } + } + } + ], "detail": "(t<'a>, 'a, int) => int", - "documentation": {"kind": "markdown", "value": "\n`indexOfFrom(typedArray, value, fromIndex)` searches for `value` starting at `fromIndex`.\n"}, - "sortText": "indexOfFrom", + "documentation": { + "kind": "markdown", + "value": "\n`indexOfFrom(typedArray, value, fromIndex)` searches for `value` starting at `fromIndex`.\n" + }, "insertText": "->TypedArray.indexOfFrom", - "additionalTextEdits": [{ - "range": {"start": {"line": 25, "character": 12}, "end": {"line": 25, "character": 13}}, - "newText": "" - }] - }, { - "label": "->TypedArray.reverse", "kind": 12, - "tags": [], + "label": "->TypedArray.indexOfFrom", + "sortText": "indexOfFrom", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 13, "line": 25 }, + "start": { "character": 12, "line": 25 } + } + } + ], "detail": "t<'a> => unit", - "documentation": {"kind": "markdown", "value": "\n`reverse(typedArray)` reverses the elements of the view in place.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.reverse`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/reverse) on MDN.\n"}, - "sortText": "reverse", + "documentation": { + "kind": "markdown", + "value": "\n`reverse(typedArray)` reverses the elements of the view in place.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.reverse`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/reverse) on MDN.\n" + }, "insertText": "->TypedArray.reverse", - "additionalTextEdits": [{ - "range": {"start": {"line": 25, "character": 12}, "end": {"line": 25, "character": 13}}, - "newText": "" - }] - }, { - "label": "->TypedArray.byteOffset", "kind": 12, - "tags": [], + "label": "->TypedArray.reverse", + "sortText": "reverse", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 13, "line": 25 }, + "start": { "character": 12, "line": 25 } + } + } + ], "detail": "t<'a> => int", - "documentation": {"kind": "markdown", "value": "\n`byteOffset(typedArray)` returns the offset in bytes from the start of the buffer.\n\nSee [`TypedArray.prototype.byteOffset`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/byteOffset) on MDN.\n"}, - "sortText": "byteOffset", + "documentation": { + "kind": "markdown", + "value": "\n`byteOffset(typedArray)` returns the offset in bytes from the start of the buffer.\n\nSee [`TypedArray.prototype.byteOffset`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/byteOffset) on MDN.\n" + }, "insertText": "->TypedArray.byteOffset", - "additionalTextEdits": [{ - "range": {"start": {"line": 25, "character": 12}, "end": {"line": 25, "character": 13}}, - "newText": "" - }] - }] + "kind": 12, + "label": "->TypedArray.byteOffset", + "sortText": "byteOffset", + "tags": [] + } +] Complete src/CompletionTypedArrays.res 29:15 posCursor:[29:15] posNoWhite:[29:14] Found expr:[29:3->29:15] @@ -4844,679 +8407,1188 @@ CPPipe pathFromEnv:Stdlib.Uint16Array found:false Path Stdlib.Uint16Array. Path Stdlib.TypedArray. Path -[{ - "label": "->Uint16Array.ignore", - "kind": 12, - "tags": [], +[ + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 29 }, + "start": { "character": 14, "line": 29 } + } + } + ], "detail": "t => unit", - "documentation": {"kind": "markdown", "value": "\n `ignore(uintArray)` ignores the provided uintArray and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further.\n"}, - "sortText": "ignore", + "documentation": { + "kind": "markdown", + "value": "\n `ignore(uintArray)` ignores the provided uintArray and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further.\n" + }, "insertText": "->Uint16Array.ignore", - "additionalTextEdits": [{ - "range": {"start": {"line": 29, "character": 14}, "end": {"line": 29, "character": 15}}, - "newText": "" - }] - }, { - "label": "->TypedArray.findLastIndexWithIndex", "kind": 12, - "tags": [], + "label": "->Uint16Array.ignore", + "sortText": "ignore", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 29 }, + "start": { "character": 14, "line": 29 } + } + } + ], "detail": "(t<'a>, ('a, int) => bool) => int", - "documentation": {"kind": "markdown", "value": "\n`findLastIndexWithIndex(typedArray, predicate)` is the indexed variant of `findLastIndex`.\n"}, - "sortText": "findLastIndexWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`findLastIndexWithIndex(typedArray, predicate)` is the indexed variant of `findLastIndex`.\n" + }, "insertText": "->TypedArray.findLastIndexWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 29, "character": 14}, "end": {"line": 29, "character": 15}}, - "newText": "" - }] - }, { - "label": "->TypedArray.lastIndexOf", "kind": 12, - "tags": [], + "label": "->TypedArray.findLastIndexWithIndex", + "sortText": "findLastIndexWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 29 }, + "start": { "character": 14, "line": 29 } + } + } + ], "detail": "(t<'a>, 'a) => int", - "documentation": {"kind": "markdown", "value": "\n`lastIndexOf(typedArray, value)` returns the last index of `value`, or `-1` if not found.\n\nSee [`TypedArray.prototype.lastIndexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/lastIndexOf) on MDN.\n"}, - "sortText": "lastIndexOf", + "documentation": { + "kind": "markdown", + "value": "\n`lastIndexOf(typedArray, value)` returns the last index of `value`, or `-1` if not found.\n\nSee [`TypedArray.prototype.lastIndexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/lastIndexOf) on MDN.\n" + }, "insertText": "->TypedArray.lastIndexOf", - "additionalTextEdits": [{ - "range": {"start": {"line": 29, "character": 14}, "end": {"line": 29, "character": 15}}, - "newText": "" - }] - }, { - "label": "->TypedArray.findLastWithIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.lastIndexOf", + "sortText": "lastIndexOf", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 29 }, + "start": { "character": 14, "line": 29 } + } + } + ], "detail": "(t<'a>, ('a, int) => bool) => option<'a>", - "documentation": {"kind": "markdown", "value": "\n`findLastWithIndex(typedArray, predicate)` is the indexed variant of `findLast`.\n"}, - "sortText": "findLastWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`findLastWithIndex(typedArray, predicate)` is the indexed variant of `findLast`.\n" + }, "insertText": "->TypedArray.findLastWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 29, "character": 14}, "end": {"line": 29, "character": 15}}, - "newText": "" - }] - }, { - "label": "->TypedArray.findLast", "kind": 12, - "tags": [], + "label": "->TypedArray.findLastWithIndex", + "sortText": "findLastWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 29 }, + "start": { "character": 14, "line": 29 } + } + } + ], "detail": "(t<'a>, 'a => bool) => option<'a>", - "documentation": {"kind": "markdown", "value": "\n`findLast(typedArray, predicate)` returns the last element that satisfies `predicate`.\n\nSee [`TypedArray.prototype.findLast`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/findLast) on MDN.\n"}, - "sortText": "findLast", + "documentation": { + "kind": "markdown", + "value": "\n`findLast(typedArray, predicate)` returns the last element that satisfies `predicate`.\n\nSee [`TypedArray.prototype.findLast`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/findLast) on MDN.\n" + }, "insertText": "->TypedArray.findLast", - "additionalTextEdits": [{ - "range": {"start": {"line": 29, "character": 14}, "end": {"line": 29, "character": 15}}, - "newText": "" - }] - }, { - "label": "->TypedArray.filter", "kind": 12, - "tags": [], + "label": "->TypedArray.findLast", + "sortText": "findLast", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 29 }, + "start": { "character": 14, "line": 29 } + } + } + ], "detail": "(t<'a>, 'a => bool) => t<'a>", - "documentation": {"kind": "markdown", "value": "\n`filter(typedArray, predicate)` returns a new typed array containing only elements that satisfy `predicate`.\n\nSee [`TypedArray.prototype.filter`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/filter) on MDN.\n"}, - "sortText": "filter", + "documentation": { + "kind": "markdown", + "value": "\n`filter(typedArray, predicate)` returns a new typed array containing only elements that satisfy `predicate`.\n\nSee [`TypedArray.prototype.filter`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/filter) on MDN.\n" + }, "insertText": "->TypedArray.filter", - "additionalTextEdits": [{ - "range": {"start": {"line": 29, "character": 14}, "end": {"line": 29, "character": 15}}, - "newText": "" - }] - }, { - "label": "->TypedArray.byteLength", "kind": 12, - "tags": [], + "label": "->TypedArray.filter", + "sortText": "filter", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 29 }, + "start": { "character": 14, "line": 29 } + } + } + ], "detail": "t<'a> => int", - "documentation": {"kind": "markdown", "value": "\n`byteLength(typedArray)` returns the length in bytes of the view.\n\nSee [`TypedArray.prototype.byteLength`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/byteLength) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2])\nTypedArray.byteLength(view) == 8\n```\n"}, - "sortText": "byteLength", + "documentation": { + "kind": "markdown", + "value": "\n`byteLength(typedArray)` returns the length in bytes of the view.\n\nSee [`TypedArray.prototype.byteLength`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/byteLength) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2])\nTypedArray.byteLength(view) == 8\n```\n" + }, "insertText": "->TypedArray.byteLength", - "additionalTextEdits": [{ - "range": {"start": {"line": 29, "character": 14}, "end": {"line": 29, "character": 15}}, - "newText": "" - }] - }, { - "label": "->TypedArray.ignore", "kind": 12, - "tags": [], + "label": "->TypedArray.byteLength", + "sortText": "byteLength", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 29 }, + "start": { "character": 14, "line": 29 } + } + } + ], "detail": "t<'a> => unit", - "documentation": {"kind": "markdown", "value": "\n `ignore(typedArray)` ignores the provided typedArray and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further.\n"}, - "sortText": "ignore", + "documentation": { + "kind": "markdown", + "value": "\n `ignore(typedArray)` ignores the provided typedArray and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further.\n" + }, "insertText": "->TypedArray.ignore", - "additionalTextEdits": [{ - "range": {"start": {"line": 29, "character": 14}, "end": {"line": 29, "character": 15}}, - "newText": "" - }] - }, { - "label": "->TypedArray.reduceRightWithIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.ignore", + "sortText": "ignore", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 29 }, + "start": { "character": 14, "line": 29 } + } + } + ], "detail": "(t<'a>, ('b, 'a, int) => 'b, 'b) => 'b", - "documentation": {"kind": "markdown", "value": "\n`reduceRightWithIndex(typedArray, reducer, initial)` is the indexed variant of `reduceRight`.\n"}, - "sortText": "reduceRightWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`reduceRightWithIndex(typedArray, reducer, initial)` is the indexed variant of `reduceRight`.\n" + }, "insertText": "->TypedArray.reduceRightWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 29, "character": 14}, "end": {"line": 29, "character": 15}}, - "newText": "" - }] - }, { - "label": "->TypedArray.reduceRight", "kind": 12, - "tags": [], + "label": "->TypedArray.reduceRightWithIndex", + "sortText": "reduceRightWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 29 }, + "start": { "character": 14, "line": 29 } + } + } + ], "detail": "(t<'a>, ('b, 'a) => 'b, 'b) => 'b", - "documentation": {"kind": "markdown", "value": "\n`reduceRight(typedArray, reducer, initial)` is like `reduce` but processes the elements from right to left.\n\nSee [`TypedArray.prototype.reduceRight`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/reduceRight) on MDN.\n"}, - "sortText": "reduceRight", + "documentation": { + "kind": "markdown", + "value": "\n`reduceRight(typedArray, reducer, initial)` is like `reduce` but processes the elements from right to left.\n\nSee [`TypedArray.prototype.reduceRight`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/reduceRight) on MDN.\n" + }, "insertText": "->TypedArray.reduceRight", - "additionalTextEdits": [{ - "range": {"start": {"line": 29, "character": 14}, "end": {"line": 29, "character": 15}}, - "newText": "" - }] - }, { - "label": "->TypedArray.joinWith", "kind": 12, - "tags": [], + "label": "->TypedArray.reduceRight", + "sortText": "reduceRight", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 29 }, + "start": { "character": 14, "line": 29 } + } + } + ], "detail": "(t<'a>, string) => string", - "documentation": {"kind": "markdown", "value": "\n`joinWith(typedArray, separator)` returns a string formed by the elements joined with `separator`.\n\nSee [`TypedArray.prototype.join`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/join) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nTypedArray.joinWith(view, \"-\") == \"1-2-3\"\n```\n"}, - "sortText": "joinWith", + "documentation": { + "kind": "markdown", + "value": "\n`joinWith(typedArray, separator)` returns a string formed by the elements joined with `separator`.\n\nSee [`TypedArray.prototype.join`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/join) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nTypedArray.joinWith(view, \"-\") == \"1-2-3\"\n```\n" + }, "insertText": "->TypedArray.joinWith", - "additionalTextEdits": [{ - "range": {"start": {"line": 29, "character": 14}, "end": {"line": 29, "character": 15}}, - "newText": "" - }] - }, { - "label": "->TypedArray.buffer", "kind": 12, - "tags": [], + "label": "->TypedArray.joinWith", + "sortText": "joinWith", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 29 }, + "start": { "character": 14, "line": 29 } + } + } + ], "detail": "t<'a> => ArrayBuffer.t", - "documentation": {"kind": "markdown", "value": "\n`buffer(typedArray)` returns the underlying `ArrayBuffer` backing this view.\n\nSee [`TypedArray.prototype.buffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/buffer) on MDN.\n"}, - "sortText": "buffer", + "documentation": { + "kind": "markdown", + "value": "\n`buffer(typedArray)` returns the underlying `ArrayBuffer` backing this view.\n\nSee [`TypedArray.prototype.buffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/buffer) on MDN.\n" + }, "insertText": "->TypedArray.buffer", - "additionalTextEdits": [{ - "range": {"start": {"line": 29, "character": 14}, "end": {"line": 29, "character": 15}}, - "newText": "" - }] - }, { - "label": "->TypedArray.reduce", "kind": 12, - "tags": [], + "label": "->TypedArray.buffer", + "sortText": "buffer", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 29 }, + "start": { "character": 14, "line": 29 } + } + } + ], "detail": "(t<'a>, ('b, 'a) => 'b, 'b) => 'b", - "documentation": {"kind": "markdown", "value": "\n`reduce(typedArray, reducer, initial)` combines the elements from left to right using `reducer`.\n\nSee [`TypedArray.prototype.reduce`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/reduce) on MDN.\n"}, - "sortText": "reduce", + "documentation": { + "kind": "markdown", + "value": "\n`reduce(typedArray, reducer, initial)` combines the elements from left to right using `reducer`.\n\nSee [`TypedArray.prototype.reduce`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/reduce) on MDN.\n" + }, "insertText": "->TypedArray.reduce", - "additionalTextEdits": [{ - "range": {"start": {"line": 29, "character": 14}, "end": {"line": 29, "character": 15}}, - "newText": "" - }] - }, { - "label": "->TypedArray.forEachWithIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.reduce", + "sortText": "reduce", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 29 }, + "start": { "character": 14, "line": 29 } + } + } + ], "detail": "(t<'a>, ('a, int) => unit) => unit", - "documentation": {"kind": "markdown", "value": "\n`forEachWithIndex(typedArray, f)` runs `f` for every element, also providing the index.\n"}, - "sortText": "forEachWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`forEachWithIndex(typedArray, f)` runs `f` for every element, also providing the index.\n" + }, "insertText": "->TypedArray.forEachWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 29, "character": 14}, "end": {"line": 29, "character": 15}}, - "newText": "" - }] - }, { - "label": "->TypedArray.copy", "kind": 12, - "tags": [], + "label": "->TypedArray.forEachWithIndex", + "sortText": "forEachWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 29 }, + "start": { "character": 14, "line": 29 } + } + } + ], "detail": "t<'a> => t<'a>", - "documentation": {"kind": "markdown", "value": "\n`copy(typedArray)` produces a shallow copy of the typed array.\n"}, - "sortText": "copy", + "documentation": { + "kind": "markdown", + "value": "\n`copy(typedArray)` produces a shallow copy of the typed array.\n" + }, "insertText": "->TypedArray.copy", - "additionalTextEdits": [{ - "range": {"start": {"line": 29, "character": 14}, "end": {"line": 29, "character": 15}}, - "newText": "" - }] - }, { - "label": "->TypedArray.someWithIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.copy", + "sortText": "copy", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 29 }, + "start": { "character": 14, "line": 29 } + } + } + ], "detail": "(t<'a>, ('a, int) => bool) => bool", - "documentation": {"kind": "markdown", "value": "\n`someWithIndex(typedArray, predicate)` behaves like `some`, but `predicate` also receives the element index.\n"}, - "sortText": "someWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`someWithIndex(typedArray, predicate)` behaves like `some`, but `predicate` also receives the element index.\n" + }, "insertText": "->TypedArray.someWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 29, "character": 14}, "end": {"line": 29, "character": 15}}, - "newText": "" - }] - }, { - "label": "->TypedArray.findIndexWithIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.someWithIndex", + "sortText": "someWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 29 }, + "start": { "character": 14, "line": 29 } + } + } + ], "detail": "(t<'a>, ('a, int) => bool) => int", - "documentation": {"kind": "markdown", "value": "\n`findIndexWithIndex(typedArray, predicate)` is the indexed variant of `findIndex`.\n"}, - "sortText": "findIndexWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`findIndexWithIndex(typedArray, predicate)` is the indexed variant of `findIndex`.\n" + }, "insertText": "->TypedArray.findIndexWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 29, "character": 14}, "end": {"line": 29, "character": 15}}, - "newText": "" - }] - }, { - "label": "->TypedArray.sliceToEnd", "kind": 12, - "tags": [1], + "label": "->TypedArray.findIndexWithIndex", + "sortText": "findIndexWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 29 }, + "start": { "character": 14, "line": 29 } + } + } + ], + "deprecated": true, "detail": "(t<'a>, ~start: int) => t<'a>", - "documentation": {"kind": "markdown", "value": "Deprecated: Use `slice` instead\n\n\n`sliceToEnd(typedArray, ~start)` returns the elements from `start` through the end in a new typed array.\n"}, - "sortText": "sliceToEnd", + "documentation": { + "kind": "markdown", + "value": "Deprecated: Use `slice` instead\n\n\n`sliceToEnd(typedArray, ~start)` returns the elements from `start` through the end in a new typed array.\n" + }, "insertText": "->TypedArray.sliceToEnd", - "additionalTextEdits": [{ - "range": {"start": {"line": 29, "character": 14}, "end": {"line": 29, "character": 15}}, - "newText": "" - }] - }, { - "label": "->TypedArray.slice", "kind": 12, - "tags": [], + "label": "->TypedArray.sliceToEnd", + "sortText": "sliceToEnd", + "tags": [ 1 ] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 29 }, + "start": { "character": 14, "line": 29 } + } + } + ], "detail": "(t<'a>, ~start: int, ~end: int=?) => t<'a>", - "documentation": {"kind": "markdown", "value": "\n`slice(typedArray, ~start, ~end)` returns a new typed array containing the elements in `[start, end)`.\n\nSee [`TypedArray.prototype.slice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/slice) on MDN.\n"}, - "sortText": "slice", + "documentation": { + "kind": "markdown", + "value": "\n`slice(typedArray, ~start, ~end)` returns a new typed array containing the elements in `[start, end)`.\n\nSee [`TypedArray.prototype.slice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/slice) on MDN.\n" + }, "insertText": "->TypedArray.slice", - "additionalTextEdits": [{ - "range": {"start": {"line": 29, "character": 14}, "end": {"line": 29, "character": 15}}, - "newText": "" - }] - }, { - "label": "->TypedArray.findLastIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.slice", + "sortText": "slice", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 29 }, + "start": { "character": 14, "line": 29 } + } + } + ], "detail": "(t<'a>, 'a => bool) => int", - "documentation": {"kind": "markdown", "value": "\n`findLastIndex(typedArray, predicate)` returns the index of the last matching element, or `-1` if none do.\n\nSee [`TypedArray.prototype.findLastIndex`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/findLastIndex) on MDN.\n"}, - "sortText": "findLastIndex", + "documentation": { + "kind": "markdown", + "value": "\n`findLastIndex(typedArray, predicate)` returns the index of the last matching element, or `-1` if none do.\n\nSee [`TypedArray.prototype.findLastIndex`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/findLastIndex) on MDN.\n" + }, "insertText": "->TypedArray.findLastIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 29, "character": 14}, "end": {"line": 29, "character": 15}}, - "newText": "" - }] - }, { - "label": "->TypedArray.includes", "kind": 12, - "tags": [], + "label": "->TypedArray.findLastIndex", + "sortText": "findLastIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 29 }, + "start": { "character": 14, "line": 29 } + } + } + ], "detail": "(t<'a>, 'a) => bool", - "documentation": {"kind": "markdown", "value": "\n`includes(typedArray, value)` returns `true` if `value` occurs in the typed array.\n\nSee [`TypedArray.prototype.includes`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/includes) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nTypedArray.includes(view, 2) == true\nTypedArray.includes(view, 10) == false\n```\n"}, - "sortText": "includes", + "documentation": { + "kind": "markdown", + "value": "\n`includes(typedArray, value)` returns `true` if `value` occurs in the typed array.\n\nSee [`TypedArray.prototype.includes`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/includes) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nTypedArray.includes(view, 2) == true\nTypedArray.includes(view, 10) == false\n```\n" + }, "insertText": "->TypedArray.includes", - "additionalTextEdits": [{ - "range": {"start": {"line": 29, "character": 14}, "end": {"line": 29, "character": 15}}, - "newText": "" - }] - }, { - "label": "->TypedArray.fillToEnd", "kind": 12, - "tags": [1], + "label": "->TypedArray.includes", + "sortText": "includes", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 29 }, + "start": { "character": 14, "line": 29 } + } + } + ], + "deprecated": true, "detail": "(t<'a>, 'a, ~start: int) => t<'a>", - "documentation": {"kind": "markdown", "value": "Deprecated: Use `fill` instead\n\n\n`fillToEnd(typedArray, value, ~start)` fills from `start` through the end with `value`.\n\nBeware this will *mutate* the typed array.\n"}, - "sortText": "fillToEnd", + "documentation": { + "kind": "markdown", + "value": "Deprecated: Use `fill` instead\n\n\n`fillToEnd(typedArray, value, ~start)` fills from `start` through the end with `value`.\n\nBeware this will *mutate* the typed array.\n" + }, "insertText": "->TypedArray.fillToEnd", - "additionalTextEdits": [{ - "range": {"start": {"line": 29, "character": 14}, "end": {"line": 29, "character": 15}}, - "newText": "" - }] - }, { - "label": "->TypedArray.fillAll", "kind": 12, - "tags": [], + "label": "->TypedArray.fillToEnd", + "sortText": "fillToEnd", + "tags": [ 1 ] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 29 }, + "start": { "character": 14, "line": 29 } + } + } + ], "detail": "(t<'a>, 'a) => t<'a>", - "documentation": {"kind": "markdown", "value": "\n`fillAll(typedArray, value)` fills every element with `value`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.fill`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/fill) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nlet _ = TypedArray.fillAll(view, 9)\nTypedArray.toString(view) == \"9,9,9\"\n```\n"}, - "sortText": "fillAll", + "documentation": { + "kind": "markdown", + "value": "\n`fillAll(typedArray, value)` fills every element with `value`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.fill`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/fill) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nlet _ = TypedArray.fillAll(view, 9)\nTypedArray.toString(view) == \"9,9,9\"\n```\n" + }, "insertText": "->TypedArray.fillAll", - "additionalTextEdits": [{ - "range": {"start": {"line": 29, "character": 14}, "end": {"line": 29, "character": 15}}, - "newText": "" - }] - }, { - "label": "->TypedArray.find", "kind": 12, - "tags": [], + "label": "->TypedArray.fillAll", + "sortText": "fillAll", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 29 }, + "start": { "character": 14, "line": 29 } + } + } + ], "detail": "(t<'a>, 'a => bool) => option<'a>", - "documentation": {"kind": "markdown", "value": "\n`find(typedArray, predicate)` returns the first element that satisfies `predicate`, or `None` if nothing matches.\n\nSee [`TypedArray.prototype.find`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/find) on MDN.\n"}, - "sortText": "find", + "documentation": { + "kind": "markdown", + "value": "\n`find(typedArray, predicate)` returns the first element that satisfies `predicate`, or `None` if nothing matches.\n\nSee [`TypedArray.prototype.find`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/find) on MDN.\n" + }, "insertText": "->TypedArray.find", - "additionalTextEdits": [{ - "range": {"start": {"line": 29, "character": 14}, "end": {"line": 29, "character": 15}}, - "newText": "" - }] - }, { - "label": "->TypedArray.subarrayToEnd", "kind": 12, - "tags": [1], + "label": "->TypedArray.find", + "sortText": "find", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 29 }, + "start": { "character": 14, "line": 29 } + } + } + ], + "deprecated": true, "detail": "(t<'a>, ~start: int) => t<'a>", - "documentation": {"kind": "markdown", "value": "Deprecated: Use `subarray` instead\n\n\n`subarrayToEnd(typedArray, ~start)` returns a new view from `start` to the end of the buffer.\n"}, - "sortText": "subarrayToEnd", + "documentation": { + "kind": "markdown", + "value": "Deprecated: Use `subarray` instead\n\n\n`subarrayToEnd(typedArray, ~start)` returns a new view from `start` to the end of the buffer.\n" + }, "insertText": "->TypedArray.subarrayToEnd", - "additionalTextEdits": [{ - "range": {"start": {"line": 29, "character": 14}, "end": {"line": 29, "character": 15}}, - "newText": "" - }] - }, { - "label": "->TypedArray.set", "kind": 12, - "tags": [], + "label": "->TypedArray.subarrayToEnd", + "sortText": "subarrayToEnd", + "tags": [ 1 ] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 29 }, + "start": { "character": 14, "line": 29 } + } + } + ], "detail": "(t<'a>, int, 'a) => unit", - "documentation": {"kind": "markdown", "value": "\n`set(typedArray, index, item)` sets the provided `item` at `index` of `typedArray`.\n\nBeware this will *mutate* the array.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2])\nTypedArray.set(view, 1, 5)\nTypedArray.get(view, 1) == Some(5)\n```\n"}, - "sortText": "set", + "documentation": { + "kind": "markdown", + "value": "\n`set(typedArray, index, item)` sets the provided `item` at `index` of `typedArray`.\n\nBeware this will *mutate* the array.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2])\nTypedArray.set(view, 1, 5)\nTypedArray.get(view, 1) == Some(5)\n```\n" + }, "insertText": "->TypedArray.set", - "additionalTextEdits": [{ - "range": {"start": {"line": 29, "character": 14}, "end": {"line": 29, "character": 15}}, - "newText": "" - }] - }, { - "label": "->TypedArray.toLocaleString", "kind": 12, - "tags": [], + "label": "->TypedArray.set", + "sortText": "set", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 29 }, + "start": { "character": 14, "line": 29 } + } + } + ], "detail": "t<'a> => string", - "documentation": {"kind": "markdown", "value": "\n`toLocaleString(typedArray)` concatenates the elements using locale-aware formatting.\n\nSee [`TypedArray.prototype.toLocaleString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/toLocaleString) on MDN.\n"}, - "sortText": "toLocaleString", + "documentation": { + "kind": "markdown", + "value": "\n`toLocaleString(typedArray)` concatenates the elements using locale-aware formatting.\n\nSee [`TypedArray.prototype.toLocaleString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/toLocaleString) on MDN.\n" + }, "insertText": "->TypedArray.toLocaleString", - "additionalTextEdits": [{ - "range": {"start": {"line": 29, "character": 14}, "end": {"line": 29, "character": 15}}, - "newText": "" - }] - }, { - "label": "->TypedArray.lastIndexOfFrom", "kind": 12, - "tags": [], + "label": "->TypedArray.toLocaleString", + "sortText": "toLocaleString", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 29 }, + "start": { "character": 14, "line": 29 } + } + } + ], "detail": "(t<'a>, 'a, int) => int", - "documentation": {"kind": "markdown", "value": "\n`lastIndexOfFrom(typedArray, value, fromIndex)` searches backwards starting at `fromIndex`.\n"}, - "sortText": "lastIndexOfFrom", + "documentation": { + "kind": "markdown", + "value": "\n`lastIndexOfFrom(typedArray, value, fromIndex)` searches backwards starting at `fromIndex`.\n" + }, "insertText": "->TypedArray.lastIndexOfFrom", - "additionalTextEdits": [{ - "range": {"start": {"line": 29, "character": 14}, "end": {"line": 29, "character": 15}}, - "newText": "" - }] - }, { - "label": "->TypedArray.findIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.lastIndexOfFrom", + "sortText": "lastIndexOfFrom", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 29 }, + "start": { "character": 14, "line": 29 } + } + } + ], "detail": "(t<'a>, 'a => bool) => int", - "documentation": {"kind": "markdown", "value": "\n`findIndex(typedArray, predicate)` returns the index of the first element that satisfies `predicate`, or `-1` if none do.\n\nSee [`TypedArray.prototype.findIndex`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/findIndex) on MDN.\n"}, - "sortText": "findIndex", + "documentation": { + "kind": "markdown", + "value": "\n`findIndex(typedArray, predicate)` returns the index of the first element that satisfies `predicate`, or `-1` if none do.\n\nSee [`TypedArray.prototype.findIndex`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/findIndex) on MDN.\n" + }, "insertText": "->TypedArray.findIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 29, "character": 14}, "end": {"line": 29, "character": 15}}, - "newText": "" - }] - }, { - "label": "->TypedArray.filterWithIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.findIndex", + "sortText": "findIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 29 }, + "start": { "character": 14, "line": 29 } + } + } + ], "detail": "(t<'a>, ('a, int) => bool) => t<'a>", - "documentation": {"kind": "markdown", "value": "\n`filterWithIndex(typedArray, predicate)` behaves like `filter` but also passes the index to `predicate`.\n"}, - "sortText": "filterWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`filterWithIndex(typedArray, predicate)` behaves like `filter` but also passes the index to `predicate`.\n" + }, "insertText": "->TypedArray.filterWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 29, "character": 14}, "end": {"line": 29, "character": 15}}, - "newText": "" - }] - }, { - "label": "->TypedArray.sort", "kind": 12, - "tags": [], + "label": "->TypedArray.filterWithIndex", + "sortText": "filterWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 29 }, + "start": { "character": 14, "line": 29 } + } + } + ], "detail": "(t<'a>, ('a, 'a) => Ordering.t) => unit", - "documentation": {"kind": "markdown", "value": "\n`sort(typedArray, comparator)` sorts the values in place using `comparator`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.sort`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/sort) on MDN.\n"}, - "sortText": "sort", + "documentation": { + "kind": "markdown", + "value": "\n`sort(typedArray, comparator)` sorts the values in place using `comparator`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.sort`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/sort) on MDN.\n" + }, "insertText": "->TypedArray.sort", - "additionalTextEdits": [{ - "range": {"start": {"line": 29, "character": 14}, "end": {"line": 29, "character": 15}}, - "newText": "" - }] - }, { - "label": "->TypedArray.mapWithIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.sort", + "sortText": "sort", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 29 }, + "start": { "character": 14, "line": 29 } + } + } + ], "detail": "(t<'a>, ('a, int) => 'b) => t<'b>", - "documentation": {"kind": "markdown", "value": "\n`mapWithIndex(typedArray, f)` behaves like `map`, but `f` also receives the index.\n"}, - "sortText": "mapWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`mapWithIndex(typedArray, f)` behaves like `map`, but `f` also receives the index.\n" + }, "insertText": "->TypedArray.mapWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 29, "character": 14}, "end": {"line": 29, "character": 15}}, - "newText": "" - }] - }, { - "label": "->TypedArray.every", "kind": 12, - "tags": [], + "label": "->TypedArray.mapWithIndex", + "sortText": "mapWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 29 }, + "start": { "character": 14, "line": 29 } + } + } + ], "detail": "(t<'a>, 'a => bool) => bool", - "documentation": {"kind": "markdown", "value": "\n`every(typedArray, predicate)` returns `true` if `predicate` returns `true` for every element.\n\nSee [`TypedArray.prototype.every`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/every) on MDN.\n"}, - "sortText": "every", + "documentation": { + "kind": "markdown", + "value": "\n`every(typedArray, predicate)` returns `true` if `predicate` returns `true` for every element.\n\nSee [`TypedArray.prototype.every`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/every) on MDN.\n" + }, "insertText": "->TypedArray.every", - "additionalTextEdits": [{ - "range": {"start": {"line": 29, "character": 14}, "end": {"line": 29, "character": 15}}, - "newText": "" - }] - }, { - "label": "->TypedArray.length", "kind": 12, - "tags": [], + "label": "->TypedArray.every", + "sortText": "every", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 29 }, + "start": { "character": 14, "line": 29 } + } + } + ], "detail": "t<'a> => int", - "documentation": {"kind": "markdown", "value": "\n`length(typedArray)` returns the number of elements.\n\nSee [`TypedArray.prototype.length`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/length) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nTypedArray.length(view) == 3\n```\n"}, - "sortText": "length", + "documentation": { + "kind": "markdown", + "value": "\n`length(typedArray)` returns the number of elements.\n\nSee [`TypedArray.prototype.length`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/length) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nTypedArray.length(view) == 3\n```\n" + }, "insertText": "->TypedArray.length", - "additionalTextEdits": [{ - "range": {"start": {"line": 29, "character": 14}, "end": {"line": 29, "character": 15}}, - "newText": "" - }] - }, { - "label": "->TypedArray.indexOf", "kind": 12, - "tags": [], + "label": "->TypedArray.length", + "sortText": "length", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 29 }, + "start": { "character": 14, "line": 29 } + } + } + ], "detail": "(t<'a>, 'a) => int", - "documentation": {"kind": "markdown", "value": "\n`indexOf(typedArray, value)` returns the first index of `value`, or `-1` when not found.\n\nSee [`TypedArray.prototype.indexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/indexOf) on MDN.\n"}, - "sortText": "indexOf", + "documentation": { + "kind": "markdown", + "value": "\n`indexOf(typedArray, value)` returns the first index of `value`, or `-1` when not found.\n\nSee [`TypedArray.prototype.indexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/indexOf) on MDN.\n" + }, "insertText": "->TypedArray.indexOf", - "additionalTextEdits": [{ - "range": {"start": {"line": 29, "character": 14}, "end": {"line": 29, "character": 15}}, - "newText": "" - }] - }, { - "label": "->TypedArray.copyWithinToEnd", "kind": 12, - "tags": [1], + "label": "->TypedArray.indexOf", + "sortText": "indexOf", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 29 }, + "start": { "character": 14, "line": 29 } + } + } + ], + "deprecated": true, "detail": "(t<'a>, ~target: int, ~start: int) => array<'a>", - "documentation": {"kind": "markdown", "value": "Deprecated: Use `copyWithin` instead\n\n\n`copyWithinToEnd(typedArray, ~target, ~start)` copies values from `start` through the end of the view into the range beginning at `target`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.copyWithin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/copyWithin) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3, 4])\nlet _ = TypedArray.copyWithinToEnd(view, ~target=0, ~start=2)\nTypedArray.toString(view) == \"3,4,3,4\"\n```\n"}, - "sortText": "copyWithinToEnd", + "documentation": { + "kind": "markdown", + "value": "Deprecated: Use `copyWithin` instead\n\n\n`copyWithinToEnd(typedArray, ~target, ~start)` copies values from `start` through the end of the view into the range beginning at `target`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.copyWithin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/copyWithin) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3, 4])\nlet _ = TypedArray.copyWithinToEnd(view, ~target=0, ~start=2)\nTypedArray.toString(view) == \"3,4,3,4\"\n```\n" + }, "insertText": "->TypedArray.copyWithinToEnd", - "additionalTextEdits": [{ - "range": {"start": {"line": 29, "character": 14}, "end": {"line": 29, "character": 15}}, - "newText": "" - }] - }, { - "label": "->TypedArray.some", "kind": 12, - "tags": [], + "label": "->TypedArray.copyWithinToEnd", + "sortText": "copyWithinToEnd", + "tags": [ 1 ] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 29 }, + "start": { "character": 14, "line": 29 } + } + } + ], "detail": "(t<'a>, 'a => bool) => bool", - "documentation": {"kind": "markdown", "value": "\n`some(typedArray, predicate)` returns `true` if `predicate` returns `true` for at least one element.\n\nSee [`TypedArray.prototype.some`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/some) on MDN.\n"}, - "sortText": "some", + "documentation": { + "kind": "markdown", + "value": "\n`some(typedArray, predicate)` returns `true` if `predicate` returns `true` for at least one element.\n\nSee [`TypedArray.prototype.some`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/some) on MDN.\n" + }, "insertText": "->TypedArray.some", - "additionalTextEdits": [{ - "range": {"start": {"line": 29, "character": 14}, "end": {"line": 29, "character": 15}}, - "newText": "" - }] - }, { - "label": "->TypedArray.reduceWithIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.some", + "sortText": "some", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 29 }, + "start": { "character": 14, "line": 29 } + } + } + ], "detail": "(t<'a>, ('b, 'a, int) => 'b, 'b) => 'b", - "documentation": {"kind": "markdown", "value": "\n`reduceWithIndex(typedArray, reducer, initial)` is the indexed variant of `reduce`.\n"}, - "sortText": "reduceWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`reduceWithIndex(typedArray, reducer, initial)` is the indexed variant of `reduce`.\n" + }, "insertText": "->TypedArray.reduceWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 29, "character": 14}, "end": {"line": 29, "character": 15}}, - "newText": "" - }] - }, { - "label": "->TypedArray.map", "kind": 12, - "tags": [], + "label": "->TypedArray.reduceWithIndex", + "sortText": "reduceWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 29 }, + "start": { "character": 14, "line": 29 } + } + } + ], "detail": "(t<'a>, 'a => 'b) => t<'b>", - "documentation": {"kind": "markdown", "value": "\n`map(typedArray, f)` returns a new typed array whose elements are produced by applying `f` to each element.\n\nSee [`TypedArray.prototype.map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/map) on MDN.\n"}, - "sortText": "map", + "documentation": { + "kind": "markdown", + "value": "\n`map(typedArray, f)` returns a new typed array whose elements are produced by applying `f` to each element.\n\nSee [`TypedArray.prototype.map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/map) on MDN.\n" + }, "insertText": "->TypedArray.map", - "additionalTextEdits": [{ - "range": {"start": {"line": 29, "character": 14}, "end": {"line": 29, "character": 15}}, - "newText": "" - }] - }, { - "label": "->TypedArray.toSorted", "kind": 12, - "tags": [], + "label": "->TypedArray.map", + "sortText": "map", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 29 }, + "start": { "character": 14, "line": 29 } + } + } + ], "detail": "(t<'a>, ('a, 'a) => Ordering.t) => t<'a>", - "documentation": {"kind": "markdown", "value": "\n`toSorted(typedArray, comparator)` returns a new typed array containing the sorted values, leaving the original untouched.\n\nSee [`TypedArray.prototype.toSorted`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/toSorted) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([3, 1, 2])\nlet sorted = TypedArray.toSorted(view, Int.compare)\nTypedArray.toString(sorted) == \"1,2,3\"\nTypedArray.toString(view) == \"3,1,2\"\n```\n"}, - "sortText": "toSorted", + "documentation": { + "kind": "markdown", + "value": "\n`toSorted(typedArray, comparator)` returns a new typed array containing the sorted values, leaving the original untouched.\n\nSee [`TypedArray.prototype.toSorted`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/toSorted) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([3, 1, 2])\nlet sorted = TypedArray.toSorted(view, Int.compare)\nTypedArray.toString(sorted) == \"1,2,3\"\nTypedArray.toString(view) == \"3,1,2\"\n```\n" + }, "insertText": "->TypedArray.toSorted", - "additionalTextEdits": [{ - "range": {"start": {"line": 29, "character": 14}, "end": {"line": 29, "character": 15}}, - "newText": "" - }] - }, { - "label": "->TypedArray.copyAllWithin", "kind": 12, - "tags": [], + "label": "->TypedArray.toSorted", + "sortText": "toSorted", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 29 }, + "start": { "character": 14, "line": 29 } + } + } + ], "detail": "(t<'a>, ~target: int) => array<'a>", - "documentation": {"kind": "markdown", "value": "\n`copyAllWithin(typedArray, ~target)` copies values starting at index `0` over the positions beginning at `target`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.copyWithin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/copyWithin) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([10, 20, 30])\nlet _ = TypedArray.copyAllWithin(view, ~target=1)\nTypedArray.toString(view) == \"10,10,20\"\n```\n"}, - "sortText": "copyAllWithin", + "documentation": { + "kind": "markdown", + "value": "\n`copyAllWithin(typedArray, ~target)` copies values starting at index `0` over the positions beginning at `target`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.copyWithin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/copyWithin) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([10, 20, 30])\nlet _ = TypedArray.copyAllWithin(view, ~target=1)\nTypedArray.toString(view) == \"10,10,20\"\n```\n" + }, "insertText": "->TypedArray.copyAllWithin", - "additionalTextEdits": [{ - "range": {"start": {"line": 29, "character": 14}, "end": {"line": 29, "character": 15}}, - "newText": "" - }] - }, { - "label": "->TypedArray.subarray", "kind": 12, - "tags": [], + "label": "->TypedArray.copyAllWithin", + "sortText": "copyAllWithin", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 29 }, + "start": { "character": 14, "line": 29 } + } + } + ], "detail": "(t<'a>, ~start: int, ~end: int=?) => t<'a>", - "documentation": {"kind": "markdown", "value": "\n`subarray(typedArray, ~start, ~end)` returns a new view referencing the same buffer over `[start, end)`.\n\nSee [`TypedArray.prototype.subarray`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/subarray) on MDN.\n"}, - "sortText": "subarray", + "documentation": { + "kind": "markdown", + "value": "\n`subarray(typedArray, ~start, ~end)` returns a new view referencing the same buffer over `[start, end)`.\n\nSee [`TypedArray.prototype.subarray`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/subarray) on MDN.\n" + }, "insertText": "->TypedArray.subarray", - "additionalTextEdits": [{ - "range": {"start": {"line": 29, "character": 14}, "end": {"line": 29, "character": 15}}, - "newText": "" - }] - }, { - "label": "->TypedArray.setArray", "kind": 12, - "tags": [], + "label": "->TypedArray.subarray", + "sortText": "subarray", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 29 }, + "start": { "character": 14, "line": 29 } + } + } + ], "detail": "(t<'a>, array<'a>) => unit", - "documentation": {"kind": "markdown", "value": "\n`setArray(target, source)` copies the values from `source` into `target`, mutating it.\n\nSee [`TypedArray.prototype.set`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/set) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([0, 0])\nTypedArray.setArray(view, [1, 2])\nTypedArray.toString(view) == \"1,2\"\n```\n"}, - "sortText": "setArray", + "documentation": { + "kind": "markdown", + "value": "\n`setArray(target, source)` copies the values from `source` into `target`, mutating it.\n\nSee [`TypedArray.prototype.set`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/set) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([0, 0])\nTypedArray.setArray(view, [1, 2])\nTypedArray.toString(view) == \"1,2\"\n```\n" + }, "insertText": "->TypedArray.setArray", - "additionalTextEdits": [{ - "range": {"start": {"line": 29, "character": 14}, "end": {"line": 29, "character": 15}}, - "newText": "" - }] - }, { - "label": "->TypedArray.get", "kind": 12, - "tags": [], + "label": "->TypedArray.setArray", + "sortText": "setArray", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 29 }, + "start": { "character": 14, "line": 29 } + } + } + ], "detail": "(t<'a>, int) => option<'a>", - "documentation": {"kind": "markdown", "value": "\n`get(typedArray, index)` returns the element at `index` of `typedArray`.\nReturns `None` if the index does not exist in the typed array. Equivalent to doing `typedArray[index]` in JavaScript.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nTypedArray.get(view, 0) == Some(1)\nTypedArray.get(view, 10) == None\n```\n"}, - "sortText": "get", + "documentation": { + "kind": "markdown", + "value": "\n`get(typedArray, index)` returns the element at `index` of `typedArray`.\nReturns `None` if the index does not exist in the typed array. Equivalent to doing `typedArray[index]` in JavaScript.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nTypedArray.get(view, 0) == Some(1)\nTypedArray.get(view, 10) == None\n```\n" + }, "insertText": "->TypedArray.get", - "additionalTextEdits": [{ - "range": {"start": {"line": 29, "character": 14}, "end": {"line": 29, "character": 15}}, - "newText": "" - }] - }, { - "label": "->TypedArray.with", "kind": 12, - "tags": [], + "label": "->TypedArray.get", + "sortText": "get", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 29 }, + "start": { "character": 14, "line": 29 } + } + } + ], "detail": "(t<'a>, int, 'a) => t<'a>", - "documentation": {"kind": "markdown", "value": "\n`with(typedArray, index, value)` returns a new typed array where the element at `index` is replaced with `value`.\n\nSee [`TypedArray.prototype.with`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/with) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nlet updated = TypedArray.with(view, 1, 10)\nTypedArray.toString(updated) == \"1,10,3\"\nTypedArray.toString(view) == \"1,2,3\"\n```\n"}, - "sortText": "with", + "documentation": { + "kind": "markdown", + "value": "\n`with(typedArray, index, value)` returns a new typed array where the element at `index` is replaced with `value`.\n\nSee [`TypedArray.prototype.with`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/with) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nlet updated = TypedArray.with(view, 1, 10)\nTypedArray.toString(updated) == \"1,10,3\"\nTypedArray.toString(view) == \"1,2,3\"\n```\n" + }, "insertText": "->TypedArray.with", - "additionalTextEdits": [{ - "range": {"start": {"line": 29, "character": 14}, "end": {"line": 29, "character": 15}}, - "newText": "" - }] - }, { - "label": "->TypedArray.toReversed", "kind": 12, - "tags": [], + "label": "->TypedArray.with", + "sortText": "with", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 29 }, + "start": { "character": 14, "line": 29 } + } + } + ], "detail": "t<'a> => t<'a>", - "documentation": {"kind": "markdown", "value": "\n`toReversed(typedArray)` returns a new typed array with the elements in reverse order, leaving the original untouched.\n\nSee [`TypedArray.prototype.toReversed`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/toReversed) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nlet reversed = TypedArray.toReversed(view)\nTypedArray.toString(reversed) == \"3,2,1\"\nTypedArray.toString(view) == \"1,2,3\"\n```\n"}, - "sortText": "toReversed", + "documentation": { + "kind": "markdown", + "value": "\n`toReversed(typedArray)` returns a new typed array with the elements in reverse order, leaving the original untouched.\n\nSee [`TypedArray.prototype.toReversed`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/toReversed) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nlet reversed = TypedArray.toReversed(view)\nTypedArray.toString(reversed) == \"3,2,1\"\nTypedArray.toString(view) == \"1,2,3\"\n```\n" + }, "insertText": "->TypedArray.toReversed", - "additionalTextEdits": [{ - "range": {"start": {"line": 29, "character": 14}, "end": {"line": 29, "character": 15}}, - "newText": "" - }] - }, { - "label": "->TypedArray.copyWithin", "kind": 12, - "tags": [], + "label": "->TypedArray.toReversed", + "sortText": "toReversed", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 29 }, + "start": { "character": 14, "line": 29 } + } + } + ], "detail": "(t<'a>, ~target: int, ~start: int, ~end: int=?) => array<'a>", - "documentation": {"kind": "markdown", "value": "\n`copyWithin(typedArray, ~target, ~start, ~end)` copies the section `[start, end)` onto the range beginning at `target`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.copyWithin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/copyWithin) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3, 4])\nlet _ = TypedArray.copyWithin(view, ~target=1, ~start=2, ~end=4)\nTypedArray.toString(view) == \"1,3,4,4\"\n```\n"}, - "sortText": "copyWithin", + "documentation": { + "kind": "markdown", + "value": "\n`copyWithin(typedArray, ~target, ~start, ~end)` copies the section `[start, end)` onto the range beginning at `target`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.copyWithin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/copyWithin) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3, 4])\nlet _ = TypedArray.copyWithin(view, ~target=1, ~start=2, ~end=4)\nTypedArray.toString(view) == \"1,3,4,4\"\n```\n" + }, "insertText": "->TypedArray.copyWithin", - "additionalTextEdits": [{ - "range": {"start": {"line": 29, "character": 14}, "end": {"line": 29, "character": 15}}, - "newText": "" - }] - }, { - "label": "->TypedArray.everyWithIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.copyWithin", + "sortText": "copyWithin", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 29 }, + "start": { "character": 14, "line": 29 } + } + } + ], "detail": "(t<'a>, ('a, int) => bool) => bool", - "documentation": {"kind": "markdown", "value": "\n`everyWithIndex(typedArray, checker)` is like `every` but provides the element index to `checker`.\n"}, - "sortText": "everyWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`everyWithIndex(typedArray, checker)` is like `every` but provides the element index to `checker`.\n" + }, "insertText": "->TypedArray.everyWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 29, "character": 14}, "end": {"line": 29, "character": 15}}, - "newText": "" - }] - }, { - "label": "->TypedArray.toString", "kind": 12, - "tags": [], + "label": "->TypedArray.everyWithIndex", + "sortText": "everyWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 29 }, + "start": { "character": 14, "line": 29 } + } + } + ], "detail": "t<'a> => string", - "documentation": {"kind": "markdown", "value": "\n`toString(typedArray)` returns a comma-separated string of the elements.\n\nSee [`TypedArray.prototype.toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/toString) on MDN.\n\n## Examples\n\n```rescript\nInt32Array.fromArray([1, 2])->TypedArray.toString == \"1,2\"\n```\n"}, - "sortText": "toString", + "documentation": { + "kind": "markdown", + "value": "\n`toString(typedArray)` returns a comma-separated string of the elements.\n\nSee [`TypedArray.prototype.toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/toString) on MDN.\n\n## Examples\n\n```rescript\nInt32Array.fromArray([1, 2])->TypedArray.toString == \"1,2\"\n```\n" + }, "insertText": "->TypedArray.toString", - "additionalTextEdits": [{ - "range": {"start": {"line": 29, "character": 14}, "end": {"line": 29, "character": 15}}, - "newText": "" - }] - }, { - "label": "->TypedArray.setArrayFrom", "kind": 12, - "tags": [], + "label": "->TypedArray.toString", + "sortText": "toString", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 29 }, + "start": { "character": 14, "line": 29 } + } + } + ], "detail": "(t<'a>, array<'a>, int) => unit", - "documentation": {"kind": "markdown", "value": "\n`setArrayFrom(target, source, index)` copies `source` into `target` starting at `index`.\n\nSee [`TypedArray.prototype.set`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/set) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([0, 0, 0])\nTypedArray.setArrayFrom(view, [5, 6], 1)\nTypedArray.toString(view) == \"0,5,6\"\n```\n"}, - "sortText": "setArrayFrom", + "documentation": { + "kind": "markdown", + "value": "\n`setArrayFrom(target, source, index)` copies `source` into `target` starting at `index`.\n\nSee [`TypedArray.prototype.set`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/set) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([0, 0, 0])\nTypedArray.setArrayFrom(view, [5, 6], 1)\nTypedArray.toString(view) == \"0,5,6\"\n```\n" + }, "insertText": "->TypedArray.setArrayFrom", - "additionalTextEdits": [{ - "range": {"start": {"line": 29, "character": 14}, "end": {"line": 29, "character": 15}}, - "newText": "" - }] - }, { - "label": "->TypedArray.forEach", "kind": 12, - "tags": [], + "label": "->TypedArray.setArrayFrom", + "sortText": "setArrayFrom", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 29 }, + "start": { "character": 14, "line": 29 } + } + } + ], "detail": "(t<'a>, 'a => unit) => unit", - "documentation": {"kind": "markdown", "value": "\n`forEach(typedArray, f)` runs `f` for every element in order.\n\nSee [`TypedArray.prototype.forEach`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/forEach) on MDN.\n"}, - "sortText": "forEach", + "documentation": { + "kind": "markdown", + "value": "\n`forEach(typedArray, f)` runs `f` for every element in order.\n\nSee [`TypedArray.prototype.forEach`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/forEach) on MDN.\n" + }, "insertText": "->TypedArray.forEach", - "additionalTextEdits": [{ - "range": {"start": {"line": 29, "character": 14}, "end": {"line": 29, "character": 15}}, - "newText": "" - }] - }, { - "label": "->TypedArray.findWithIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.forEach", + "sortText": "forEach", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 29 }, + "start": { "character": 14, "line": 29 } + } + } + ], "detail": "(t<'a>, ('a, int) => bool) => option<'a>", - "documentation": {"kind": "markdown", "value": "\n`findWithIndex(typedArray, predicate)` behaves like `find`, but `predicate` also receives the index.\n"}, - "sortText": "findWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`findWithIndex(typedArray, predicate)` behaves like `find`, but `predicate` also receives the index.\n" + }, "insertText": "->TypedArray.findWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 29, "character": 14}, "end": {"line": 29, "character": 15}}, - "newText": "" - }] - }, { - "label": "->TypedArray.fill", "kind": 12, - "tags": [], + "label": "->TypedArray.findWithIndex", + "sortText": "findWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 29 }, + "start": { "character": 14, "line": 29 } + } + } + ], "detail": "(t<'a>, 'a, ~start: int, ~end: int=?) => t<'a>", - "documentation": {"kind": "markdown", "value": "\n`fill(typedArray, value, ~start, ~end)` fills the half-open interval `[start, end)` with `value`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.fill`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/fill) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3, 4])\nlet _ = TypedArray.fill(view, 0, ~start=1, ~end=3)\nTypedArray.toString(view) == \"1,0,0,4\"\n```\n"}, - "sortText": "fill", + "documentation": { + "kind": "markdown", + "value": "\n`fill(typedArray, value, ~start, ~end)` fills the half-open interval `[start, end)` with `value`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.fill`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/fill) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3, 4])\nlet _ = TypedArray.fill(view, 0, ~start=1, ~end=3)\nTypedArray.toString(view) == \"1,0,0,4\"\n```\n" + }, "insertText": "->TypedArray.fill", - "additionalTextEdits": [{ - "range": {"start": {"line": 29, "character": 14}, "end": {"line": 29, "character": 15}}, - "newText": "" - }] - }, { - "label": "->TypedArray.indexOfFrom", "kind": 12, - "tags": [], + "label": "->TypedArray.fill", + "sortText": "fill", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 29 }, + "start": { "character": 14, "line": 29 } + } + } + ], "detail": "(t<'a>, 'a, int) => int", - "documentation": {"kind": "markdown", "value": "\n`indexOfFrom(typedArray, value, fromIndex)` searches for `value` starting at `fromIndex`.\n"}, - "sortText": "indexOfFrom", + "documentation": { + "kind": "markdown", + "value": "\n`indexOfFrom(typedArray, value, fromIndex)` searches for `value` starting at `fromIndex`.\n" + }, "insertText": "->TypedArray.indexOfFrom", - "additionalTextEdits": [{ - "range": {"start": {"line": 29, "character": 14}, "end": {"line": 29, "character": 15}}, - "newText": "" - }] - }, { - "label": "->TypedArray.reverse", "kind": 12, - "tags": [], + "label": "->TypedArray.indexOfFrom", + "sortText": "indexOfFrom", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 29 }, + "start": { "character": 14, "line": 29 } + } + } + ], "detail": "t<'a> => unit", - "documentation": {"kind": "markdown", "value": "\n`reverse(typedArray)` reverses the elements of the view in place.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.reverse`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/reverse) on MDN.\n"}, - "sortText": "reverse", + "documentation": { + "kind": "markdown", + "value": "\n`reverse(typedArray)` reverses the elements of the view in place.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.reverse`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/reverse) on MDN.\n" + }, "insertText": "->TypedArray.reverse", - "additionalTextEdits": [{ - "range": {"start": {"line": 29, "character": 14}, "end": {"line": 29, "character": 15}}, - "newText": "" - }] - }, { - "label": "->TypedArray.byteOffset", "kind": 12, - "tags": [], + "label": "->TypedArray.reverse", + "sortText": "reverse", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 29 }, + "start": { "character": 14, "line": 29 } + } + } + ], "detail": "t<'a> => int", - "documentation": {"kind": "markdown", "value": "\n`byteOffset(typedArray)` returns the offset in bytes from the start of the buffer.\n\nSee [`TypedArray.prototype.byteOffset`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/byteOffset) on MDN.\n"}, - "sortText": "byteOffset", + "documentation": { + "kind": "markdown", + "value": "\n`byteOffset(typedArray)` returns the offset in bytes from the start of the buffer.\n\nSee [`TypedArray.prototype.byteOffset`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/byteOffset) on MDN.\n" + }, "insertText": "->TypedArray.byteOffset", - "additionalTextEdits": [{ - "range": {"start": {"line": 29, "character": 14}, "end": {"line": 29, "character": 15}}, - "newText": "" - }] - }] + "kind": 12, + "label": "->TypedArray.byteOffset", + "sortText": "byteOffset", + "tags": [] + } +] Complete src/CompletionTypedArrays.res 33:15 posCursor:[33:15] posNoWhite:[33:14] Found expr:[33:3->33:15] @@ -5534,679 +9606,1188 @@ CPPipe pathFromEnv:Stdlib.Uint32Array found:false Path Stdlib.Uint32Array. Path Stdlib.TypedArray. Path -[{ - "label": "->Uint32Array.ignore", - "kind": 12, - "tags": [], +[ + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 33 }, + "start": { "character": 14, "line": 33 } + } + } + ], "detail": "t => unit", - "documentation": {"kind": "markdown", "value": "\n `ignore(uintArray)` ignores the provided uintArray and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further.\n"}, - "sortText": "ignore", + "documentation": { + "kind": "markdown", + "value": "\n `ignore(uintArray)` ignores the provided uintArray and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further.\n" + }, "insertText": "->Uint32Array.ignore", - "additionalTextEdits": [{ - "range": {"start": {"line": 33, "character": 14}, "end": {"line": 33, "character": 15}}, - "newText": "" - }] - }, { - "label": "->TypedArray.findLastIndexWithIndex", "kind": 12, - "tags": [], + "label": "->Uint32Array.ignore", + "sortText": "ignore", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 33 }, + "start": { "character": 14, "line": 33 } + } + } + ], "detail": "(t<'a>, ('a, int) => bool) => int", - "documentation": {"kind": "markdown", "value": "\n`findLastIndexWithIndex(typedArray, predicate)` is the indexed variant of `findLastIndex`.\n"}, - "sortText": "findLastIndexWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`findLastIndexWithIndex(typedArray, predicate)` is the indexed variant of `findLastIndex`.\n" + }, "insertText": "->TypedArray.findLastIndexWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 33, "character": 14}, "end": {"line": 33, "character": 15}}, - "newText": "" - }] - }, { - "label": "->TypedArray.lastIndexOf", "kind": 12, - "tags": [], + "label": "->TypedArray.findLastIndexWithIndex", + "sortText": "findLastIndexWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 33 }, + "start": { "character": 14, "line": 33 } + } + } + ], "detail": "(t<'a>, 'a) => int", - "documentation": {"kind": "markdown", "value": "\n`lastIndexOf(typedArray, value)` returns the last index of `value`, or `-1` if not found.\n\nSee [`TypedArray.prototype.lastIndexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/lastIndexOf) on MDN.\n"}, - "sortText": "lastIndexOf", + "documentation": { + "kind": "markdown", + "value": "\n`lastIndexOf(typedArray, value)` returns the last index of `value`, or `-1` if not found.\n\nSee [`TypedArray.prototype.lastIndexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/lastIndexOf) on MDN.\n" + }, "insertText": "->TypedArray.lastIndexOf", - "additionalTextEdits": [{ - "range": {"start": {"line": 33, "character": 14}, "end": {"line": 33, "character": 15}}, - "newText": "" - }] - }, { - "label": "->TypedArray.findLastWithIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.lastIndexOf", + "sortText": "lastIndexOf", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 33 }, + "start": { "character": 14, "line": 33 } + } + } + ], "detail": "(t<'a>, ('a, int) => bool) => option<'a>", - "documentation": {"kind": "markdown", "value": "\n`findLastWithIndex(typedArray, predicate)` is the indexed variant of `findLast`.\n"}, - "sortText": "findLastWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`findLastWithIndex(typedArray, predicate)` is the indexed variant of `findLast`.\n" + }, "insertText": "->TypedArray.findLastWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 33, "character": 14}, "end": {"line": 33, "character": 15}}, - "newText": "" - }] - }, { - "label": "->TypedArray.findLast", "kind": 12, - "tags": [], + "label": "->TypedArray.findLastWithIndex", + "sortText": "findLastWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 33 }, + "start": { "character": 14, "line": 33 } + } + } + ], "detail": "(t<'a>, 'a => bool) => option<'a>", - "documentation": {"kind": "markdown", "value": "\n`findLast(typedArray, predicate)` returns the last element that satisfies `predicate`.\n\nSee [`TypedArray.prototype.findLast`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/findLast) on MDN.\n"}, - "sortText": "findLast", + "documentation": { + "kind": "markdown", + "value": "\n`findLast(typedArray, predicate)` returns the last element that satisfies `predicate`.\n\nSee [`TypedArray.prototype.findLast`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/findLast) on MDN.\n" + }, "insertText": "->TypedArray.findLast", - "additionalTextEdits": [{ - "range": {"start": {"line": 33, "character": 14}, "end": {"line": 33, "character": 15}}, - "newText": "" - }] - }, { - "label": "->TypedArray.filter", "kind": 12, - "tags": [], + "label": "->TypedArray.findLast", + "sortText": "findLast", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 33 }, + "start": { "character": 14, "line": 33 } + } + } + ], "detail": "(t<'a>, 'a => bool) => t<'a>", - "documentation": {"kind": "markdown", "value": "\n`filter(typedArray, predicate)` returns a new typed array containing only elements that satisfy `predicate`.\n\nSee [`TypedArray.prototype.filter`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/filter) on MDN.\n"}, - "sortText": "filter", + "documentation": { + "kind": "markdown", + "value": "\n`filter(typedArray, predicate)` returns a new typed array containing only elements that satisfy `predicate`.\n\nSee [`TypedArray.prototype.filter`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/filter) on MDN.\n" + }, "insertText": "->TypedArray.filter", - "additionalTextEdits": [{ - "range": {"start": {"line": 33, "character": 14}, "end": {"line": 33, "character": 15}}, - "newText": "" - }] - }, { - "label": "->TypedArray.byteLength", "kind": 12, - "tags": [], + "label": "->TypedArray.filter", + "sortText": "filter", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 33 }, + "start": { "character": 14, "line": 33 } + } + } + ], "detail": "t<'a> => int", - "documentation": {"kind": "markdown", "value": "\n`byteLength(typedArray)` returns the length in bytes of the view.\n\nSee [`TypedArray.prototype.byteLength`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/byteLength) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2])\nTypedArray.byteLength(view) == 8\n```\n"}, - "sortText": "byteLength", + "documentation": { + "kind": "markdown", + "value": "\n`byteLength(typedArray)` returns the length in bytes of the view.\n\nSee [`TypedArray.prototype.byteLength`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/byteLength) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2])\nTypedArray.byteLength(view) == 8\n```\n" + }, "insertText": "->TypedArray.byteLength", - "additionalTextEdits": [{ - "range": {"start": {"line": 33, "character": 14}, "end": {"line": 33, "character": 15}}, - "newText": "" - }] - }, { - "label": "->TypedArray.ignore", "kind": 12, - "tags": [], + "label": "->TypedArray.byteLength", + "sortText": "byteLength", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 33 }, + "start": { "character": 14, "line": 33 } + } + } + ], "detail": "t<'a> => unit", - "documentation": {"kind": "markdown", "value": "\n `ignore(typedArray)` ignores the provided typedArray and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further.\n"}, - "sortText": "ignore", + "documentation": { + "kind": "markdown", + "value": "\n `ignore(typedArray)` ignores the provided typedArray and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further.\n" + }, "insertText": "->TypedArray.ignore", - "additionalTextEdits": [{ - "range": {"start": {"line": 33, "character": 14}, "end": {"line": 33, "character": 15}}, - "newText": "" - }] - }, { - "label": "->TypedArray.reduceRightWithIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.ignore", + "sortText": "ignore", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 33 }, + "start": { "character": 14, "line": 33 } + } + } + ], "detail": "(t<'a>, ('b, 'a, int) => 'b, 'b) => 'b", - "documentation": {"kind": "markdown", "value": "\n`reduceRightWithIndex(typedArray, reducer, initial)` is the indexed variant of `reduceRight`.\n"}, - "sortText": "reduceRightWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`reduceRightWithIndex(typedArray, reducer, initial)` is the indexed variant of `reduceRight`.\n" + }, "insertText": "->TypedArray.reduceRightWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 33, "character": 14}, "end": {"line": 33, "character": 15}}, - "newText": "" - }] - }, { - "label": "->TypedArray.reduceRight", "kind": 12, - "tags": [], + "label": "->TypedArray.reduceRightWithIndex", + "sortText": "reduceRightWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 33 }, + "start": { "character": 14, "line": 33 } + } + } + ], "detail": "(t<'a>, ('b, 'a) => 'b, 'b) => 'b", - "documentation": {"kind": "markdown", "value": "\n`reduceRight(typedArray, reducer, initial)` is like `reduce` but processes the elements from right to left.\n\nSee [`TypedArray.prototype.reduceRight`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/reduceRight) on MDN.\n"}, - "sortText": "reduceRight", + "documentation": { + "kind": "markdown", + "value": "\n`reduceRight(typedArray, reducer, initial)` is like `reduce` but processes the elements from right to left.\n\nSee [`TypedArray.prototype.reduceRight`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/reduceRight) on MDN.\n" + }, "insertText": "->TypedArray.reduceRight", - "additionalTextEdits": [{ - "range": {"start": {"line": 33, "character": 14}, "end": {"line": 33, "character": 15}}, - "newText": "" - }] - }, { - "label": "->TypedArray.joinWith", "kind": 12, - "tags": [], + "label": "->TypedArray.reduceRight", + "sortText": "reduceRight", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 33 }, + "start": { "character": 14, "line": 33 } + } + } + ], "detail": "(t<'a>, string) => string", - "documentation": {"kind": "markdown", "value": "\n`joinWith(typedArray, separator)` returns a string formed by the elements joined with `separator`.\n\nSee [`TypedArray.prototype.join`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/join) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nTypedArray.joinWith(view, \"-\") == \"1-2-3\"\n```\n"}, - "sortText": "joinWith", + "documentation": { + "kind": "markdown", + "value": "\n`joinWith(typedArray, separator)` returns a string formed by the elements joined with `separator`.\n\nSee [`TypedArray.prototype.join`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/join) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nTypedArray.joinWith(view, \"-\") == \"1-2-3\"\n```\n" + }, "insertText": "->TypedArray.joinWith", - "additionalTextEdits": [{ - "range": {"start": {"line": 33, "character": 14}, "end": {"line": 33, "character": 15}}, - "newText": "" - }] - }, { - "label": "->TypedArray.buffer", "kind": 12, - "tags": [], + "label": "->TypedArray.joinWith", + "sortText": "joinWith", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 33 }, + "start": { "character": 14, "line": 33 } + } + } + ], "detail": "t<'a> => ArrayBuffer.t", - "documentation": {"kind": "markdown", "value": "\n`buffer(typedArray)` returns the underlying `ArrayBuffer` backing this view.\n\nSee [`TypedArray.prototype.buffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/buffer) on MDN.\n"}, - "sortText": "buffer", + "documentation": { + "kind": "markdown", + "value": "\n`buffer(typedArray)` returns the underlying `ArrayBuffer` backing this view.\n\nSee [`TypedArray.prototype.buffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/buffer) on MDN.\n" + }, "insertText": "->TypedArray.buffer", - "additionalTextEdits": [{ - "range": {"start": {"line": 33, "character": 14}, "end": {"line": 33, "character": 15}}, - "newText": "" - }] - }, { - "label": "->TypedArray.reduce", "kind": 12, - "tags": [], + "label": "->TypedArray.buffer", + "sortText": "buffer", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 33 }, + "start": { "character": 14, "line": 33 } + } + } + ], "detail": "(t<'a>, ('b, 'a) => 'b, 'b) => 'b", - "documentation": {"kind": "markdown", "value": "\n`reduce(typedArray, reducer, initial)` combines the elements from left to right using `reducer`.\n\nSee [`TypedArray.prototype.reduce`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/reduce) on MDN.\n"}, - "sortText": "reduce", + "documentation": { + "kind": "markdown", + "value": "\n`reduce(typedArray, reducer, initial)` combines the elements from left to right using `reducer`.\n\nSee [`TypedArray.prototype.reduce`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/reduce) on MDN.\n" + }, "insertText": "->TypedArray.reduce", - "additionalTextEdits": [{ - "range": {"start": {"line": 33, "character": 14}, "end": {"line": 33, "character": 15}}, - "newText": "" - }] - }, { - "label": "->TypedArray.forEachWithIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.reduce", + "sortText": "reduce", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 33 }, + "start": { "character": 14, "line": 33 } + } + } + ], "detail": "(t<'a>, ('a, int) => unit) => unit", - "documentation": {"kind": "markdown", "value": "\n`forEachWithIndex(typedArray, f)` runs `f` for every element, also providing the index.\n"}, - "sortText": "forEachWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`forEachWithIndex(typedArray, f)` runs `f` for every element, also providing the index.\n" + }, "insertText": "->TypedArray.forEachWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 33, "character": 14}, "end": {"line": 33, "character": 15}}, - "newText": "" - }] - }, { - "label": "->TypedArray.copy", "kind": 12, - "tags": [], + "label": "->TypedArray.forEachWithIndex", + "sortText": "forEachWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 33 }, + "start": { "character": 14, "line": 33 } + } + } + ], "detail": "t<'a> => t<'a>", - "documentation": {"kind": "markdown", "value": "\n`copy(typedArray)` produces a shallow copy of the typed array.\n"}, - "sortText": "copy", + "documentation": { + "kind": "markdown", + "value": "\n`copy(typedArray)` produces a shallow copy of the typed array.\n" + }, "insertText": "->TypedArray.copy", - "additionalTextEdits": [{ - "range": {"start": {"line": 33, "character": 14}, "end": {"line": 33, "character": 15}}, - "newText": "" - }] - }, { - "label": "->TypedArray.someWithIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.copy", + "sortText": "copy", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 33 }, + "start": { "character": 14, "line": 33 } + } + } + ], "detail": "(t<'a>, ('a, int) => bool) => bool", - "documentation": {"kind": "markdown", "value": "\n`someWithIndex(typedArray, predicate)` behaves like `some`, but `predicate` also receives the element index.\n"}, - "sortText": "someWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`someWithIndex(typedArray, predicate)` behaves like `some`, but `predicate` also receives the element index.\n" + }, "insertText": "->TypedArray.someWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 33, "character": 14}, "end": {"line": 33, "character": 15}}, - "newText": "" - }] - }, { - "label": "->TypedArray.findIndexWithIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.someWithIndex", + "sortText": "someWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 33 }, + "start": { "character": 14, "line": 33 } + } + } + ], "detail": "(t<'a>, ('a, int) => bool) => int", - "documentation": {"kind": "markdown", "value": "\n`findIndexWithIndex(typedArray, predicate)` is the indexed variant of `findIndex`.\n"}, - "sortText": "findIndexWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`findIndexWithIndex(typedArray, predicate)` is the indexed variant of `findIndex`.\n" + }, "insertText": "->TypedArray.findIndexWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 33, "character": 14}, "end": {"line": 33, "character": 15}}, - "newText": "" - }] - }, { - "label": "->TypedArray.sliceToEnd", "kind": 12, - "tags": [1], + "label": "->TypedArray.findIndexWithIndex", + "sortText": "findIndexWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 33 }, + "start": { "character": 14, "line": 33 } + } + } + ], + "deprecated": true, "detail": "(t<'a>, ~start: int) => t<'a>", - "documentation": {"kind": "markdown", "value": "Deprecated: Use `slice` instead\n\n\n`sliceToEnd(typedArray, ~start)` returns the elements from `start` through the end in a new typed array.\n"}, - "sortText": "sliceToEnd", + "documentation": { + "kind": "markdown", + "value": "Deprecated: Use `slice` instead\n\n\n`sliceToEnd(typedArray, ~start)` returns the elements from `start` through the end in a new typed array.\n" + }, "insertText": "->TypedArray.sliceToEnd", - "additionalTextEdits": [{ - "range": {"start": {"line": 33, "character": 14}, "end": {"line": 33, "character": 15}}, - "newText": "" - }] - }, { - "label": "->TypedArray.slice", "kind": 12, - "tags": [], + "label": "->TypedArray.sliceToEnd", + "sortText": "sliceToEnd", + "tags": [ 1 ] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 33 }, + "start": { "character": 14, "line": 33 } + } + } + ], "detail": "(t<'a>, ~start: int, ~end: int=?) => t<'a>", - "documentation": {"kind": "markdown", "value": "\n`slice(typedArray, ~start, ~end)` returns a new typed array containing the elements in `[start, end)`.\n\nSee [`TypedArray.prototype.slice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/slice) on MDN.\n"}, - "sortText": "slice", + "documentation": { + "kind": "markdown", + "value": "\n`slice(typedArray, ~start, ~end)` returns a new typed array containing the elements in `[start, end)`.\n\nSee [`TypedArray.prototype.slice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/slice) on MDN.\n" + }, "insertText": "->TypedArray.slice", - "additionalTextEdits": [{ - "range": {"start": {"line": 33, "character": 14}, "end": {"line": 33, "character": 15}}, - "newText": "" - }] - }, { - "label": "->TypedArray.findLastIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.slice", + "sortText": "slice", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 33 }, + "start": { "character": 14, "line": 33 } + } + } + ], "detail": "(t<'a>, 'a => bool) => int", - "documentation": {"kind": "markdown", "value": "\n`findLastIndex(typedArray, predicate)` returns the index of the last matching element, or `-1` if none do.\n\nSee [`TypedArray.prototype.findLastIndex`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/findLastIndex) on MDN.\n"}, - "sortText": "findLastIndex", + "documentation": { + "kind": "markdown", + "value": "\n`findLastIndex(typedArray, predicate)` returns the index of the last matching element, or `-1` if none do.\n\nSee [`TypedArray.prototype.findLastIndex`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/findLastIndex) on MDN.\n" + }, "insertText": "->TypedArray.findLastIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 33, "character": 14}, "end": {"line": 33, "character": 15}}, - "newText": "" - }] - }, { - "label": "->TypedArray.includes", "kind": 12, - "tags": [], + "label": "->TypedArray.findLastIndex", + "sortText": "findLastIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 33 }, + "start": { "character": 14, "line": 33 } + } + } + ], "detail": "(t<'a>, 'a) => bool", - "documentation": {"kind": "markdown", "value": "\n`includes(typedArray, value)` returns `true` if `value` occurs in the typed array.\n\nSee [`TypedArray.prototype.includes`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/includes) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nTypedArray.includes(view, 2) == true\nTypedArray.includes(view, 10) == false\n```\n"}, - "sortText": "includes", + "documentation": { + "kind": "markdown", + "value": "\n`includes(typedArray, value)` returns `true` if `value` occurs in the typed array.\n\nSee [`TypedArray.prototype.includes`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/includes) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nTypedArray.includes(view, 2) == true\nTypedArray.includes(view, 10) == false\n```\n" + }, "insertText": "->TypedArray.includes", - "additionalTextEdits": [{ - "range": {"start": {"line": 33, "character": 14}, "end": {"line": 33, "character": 15}}, - "newText": "" - }] - }, { - "label": "->TypedArray.fillToEnd", "kind": 12, - "tags": [1], + "label": "->TypedArray.includes", + "sortText": "includes", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 33 }, + "start": { "character": 14, "line": 33 } + } + } + ], + "deprecated": true, "detail": "(t<'a>, 'a, ~start: int) => t<'a>", - "documentation": {"kind": "markdown", "value": "Deprecated: Use `fill` instead\n\n\n`fillToEnd(typedArray, value, ~start)` fills from `start` through the end with `value`.\n\nBeware this will *mutate* the typed array.\n"}, - "sortText": "fillToEnd", + "documentation": { + "kind": "markdown", + "value": "Deprecated: Use `fill` instead\n\n\n`fillToEnd(typedArray, value, ~start)` fills from `start` through the end with `value`.\n\nBeware this will *mutate* the typed array.\n" + }, "insertText": "->TypedArray.fillToEnd", - "additionalTextEdits": [{ - "range": {"start": {"line": 33, "character": 14}, "end": {"line": 33, "character": 15}}, - "newText": "" - }] - }, { - "label": "->TypedArray.fillAll", "kind": 12, - "tags": [], + "label": "->TypedArray.fillToEnd", + "sortText": "fillToEnd", + "tags": [ 1 ] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 33 }, + "start": { "character": 14, "line": 33 } + } + } + ], "detail": "(t<'a>, 'a) => t<'a>", - "documentation": {"kind": "markdown", "value": "\n`fillAll(typedArray, value)` fills every element with `value`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.fill`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/fill) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nlet _ = TypedArray.fillAll(view, 9)\nTypedArray.toString(view) == \"9,9,9\"\n```\n"}, - "sortText": "fillAll", + "documentation": { + "kind": "markdown", + "value": "\n`fillAll(typedArray, value)` fills every element with `value`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.fill`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/fill) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nlet _ = TypedArray.fillAll(view, 9)\nTypedArray.toString(view) == \"9,9,9\"\n```\n" + }, "insertText": "->TypedArray.fillAll", - "additionalTextEdits": [{ - "range": {"start": {"line": 33, "character": 14}, "end": {"line": 33, "character": 15}}, - "newText": "" - }] - }, { - "label": "->TypedArray.find", "kind": 12, - "tags": [], + "label": "->TypedArray.fillAll", + "sortText": "fillAll", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 33 }, + "start": { "character": 14, "line": 33 } + } + } + ], "detail": "(t<'a>, 'a => bool) => option<'a>", - "documentation": {"kind": "markdown", "value": "\n`find(typedArray, predicate)` returns the first element that satisfies `predicate`, or `None` if nothing matches.\n\nSee [`TypedArray.prototype.find`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/find) on MDN.\n"}, - "sortText": "find", + "documentation": { + "kind": "markdown", + "value": "\n`find(typedArray, predicate)` returns the first element that satisfies `predicate`, or `None` if nothing matches.\n\nSee [`TypedArray.prototype.find`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/find) on MDN.\n" + }, "insertText": "->TypedArray.find", - "additionalTextEdits": [{ - "range": {"start": {"line": 33, "character": 14}, "end": {"line": 33, "character": 15}}, - "newText": "" - }] - }, { - "label": "->TypedArray.subarrayToEnd", "kind": 12, - "tags": [1], + "label": "->TypedArray.find", + "sortText": "find", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 33 }, + "start": { "character": 14, "line": 33 } + } + } + ], + "deprecated": true, "detail": "(t<'a>, ~start: int) => t<'a>", - "documentation": {"kind": "markdown", "value": "Deprecated: Use `subarray` instead\n\n\n`subarrayToEnd(typedArray, ~start)` returns a new view from `start` to the end of the buffer.\n"}, - "sortText": "subarrayToEnd", + "documentation": { + "kind": "markdown", + "value": "Deprecated: Use `subarray` instead\n\n\n`subarrayToEnd(typedArray, ~start)` returns a new view from `start` to the end of the buffer.\n" + }, "insertText": "->TypedArray.subarrayToEnd", - "additionalTextEdits": [{ - "range": {"start": {"line": 33, "character": 14}, "end": {"line": 33, "character": 15}}, - "newText": "" - }] - }, { - "label": "->TypedArray.set", "kind": 12, - "tags": [], + "label": "->TypedArray.subarrayToEnd", + "sortText": "subarrayToEnd", + "tags": [ 1 ] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 33 }, + "start": { "character": 14, "line": 33 } + } + } + ], "detail": "(t<'a>, int, 'a) => unit", - "documentation": {"kind": "markdown", "value": "\n`set(typedArray, index, item)` sets the provided `item` at `index` of `typedArray`.\n\nBeware this will *mutate* the array.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2])\nTypedArray.set(view, 1, 5)\nTypedArray.get(view, 1) == Some(5)\n```\n"}, - "sortText": "set", + "documentation": { + "kind": "markdown", + "value": "\n`set(typedArray, index, item)` sets the provided `item` at `index` of `typedArray`.\n\nBeware this will *mutate* the array.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2])\nTypedArray.set(view, 1, 5)\nTypedArray.get(view, 1) == Some(5)\n```\n" + }, "insertText": "->TypedArray.set", - "additionalTextEdits": [{ - "range": {"start": {"line": 33, "character": 14}, "end": {"line": 33, "character": 15}}, - "newText": "" - }] - }, { - "label": "->TypedArray.toLocaleString", "kind": 12, - "tags": [], + "label": "->TypedArray.set", + "sortText": "set", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 33 }, + "start": { "character": 14, "line": 33 } + } + } + ], "detail": "t<'a> => string", - "documentation": {"kind": "markdown", "value": "\n`toLocaleString(typedArray)` concatenates the elements using locale-aware formatting.\n\nSee [`TypedArray.prototype.toLocaleString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/toLocaleString) on MDN.\n"}, - "sortText": "toLocaleString", + "documentation": { + "kind": "markdown", + "value": "\n`toLocaleString(typedArray)` concatenates the elements using locale-aware formatting.\n\nSee [`TypedArray.prototype.toLocaleString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/toLocaleString) on MDN.\n" + }, "insertText": "->TypedArray.toLocaleString", - "additionalTextEdits": [{ - "range": {"start": {"line": 33, "character": 14}, "end": {"line": 33, "character": 15}}, - "newText": "" - }] - }, { - "label": "->TypedArray.lastIndexOfFrom", "kind": 12, - "tags": [], + "label": "->TypedArray.toLocaleString", + "sortText": "toLocaleString", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 33 }, + "start": { "character": 14, "line": 33 } + } + } + ], "detail": "(t<'a>, 'a, int) => int", - "documentation": {"kind": "markdown", "value": "\n`lastIndexOfFrom(typedArray, value, fromIndex)` searches backwards starting at `fromIndex`.\n"}, - "sortText": "lastIndexOfFrom", + "documentation": { + "kind": "markdown", + "value": "\n`lastIndexOfFrom(typedArray, value, fromIndex)` searches backwards starting at `fromIndex`.\n" + }, "insertText": "->TypedArray.lastIndexOfFrom", - "additionalTextEdits": [{ - "range": {"start": {"line": 33, "character": 14}, "end": {"line": 33, "character": 15}}, - "newText": "" - }] - }, { - "label": "->TypedArray.findIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.lastIndexOfFrom", + "sortText": "lastIndexOfFrom", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 33 }, + "start": { "character": 14, "line": 33 } + } + } + ], "detail": "(t<'a>, 'a => bool) => int", - "documentation": {"kind": "markdown", "value": "\n`findIndex(typedArray, predicate)` returns the index of the first element that satisfies `predicate`, or `-1` if none do.\n\nSee [`TypedArray.prototype.findIndex`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/findIndex) on MDN.\n"}, - "sortText": "findIndex", + "documentation": { + "kind": "markdown", + "value": "\n`findIndex(typedArray, predicate)` returns the index of the first element that satisfies `predicate`, or `-1` if none do.\n\nSee [`TypedArray.prototype.findIndex`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/findIndex) on MDN.\n" + }, "insertText": "->TypedArray.findIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 33, "character": 14}, "end": {"line": 33, "character": 15}}, - "newText": "" - }] - }, { - "label": "->TypedArray.filterWithIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.findIndex", + "sortText": "findIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 33 }, + "start": { "character": 14, "line": 33 } + } + } + ], "detail": "(t<'a>, ('a, int) => bool) => t<'a>", - "documentation": {"kind": "markdown", "value": "\n`filterWithIndex(typedArray, predicate)` behaves like `filter` but also passes the index to `predicate`.\n"}, - "sortText": "filterWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`filterWithIndex(typedArray, predicate)` behaves like `filter` but also passes the index to `predicate`.\n" + }, "insertText": "->TypedArray.filterWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 33, "character": 14}, "end": {"line": 33, "character": 15}}, - "newText": "" - }] - }, { - "label": "->TypedArray.sort", "kind": 12, - "tags": [], + "label": "->TypedArray.filterWithIndex", + "sortText": "filterWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 33 }, + "start": { "character": 14, "line": 33 } + } + } + ], "detail": "(t<'a>, ('a, 'a) => Ordering.t) => unit", - "documentation": {"kind": "markdown", "value": "\n`sort(typedArray, comparator)` sorts the values in place using `comparator`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.sort`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/sort) on MDN.\n"}, - "sortText": "sort", + "documentation": { + "kind": "markdown", + "value": "\n`sort(typedArray, comparator)` sorts the values in place using `comparator`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.sort`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/sort) on MDN.\n" + }, "insertText": "->TypedArray.sort", - "additionalTextEdits": [{ - "range": {"start": {"line": 33, "character": 14}, "end": {"line": 33, "character": 15}}, - "newText": "" - }] - }, { - "label": "->TypedArray.mapWithIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.sort", + "sortText": "sort", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 33 }, + "start": { "character": 14, "line": 33 } + } + } + ], "detail": "(t<'a>, ('a, int) => 'b) => t<'b>", - "documentation": {"kind": "markdown", "value": "\n`mapWithIndex(typedArray, f)` behaves like `map`, but `f` also receives the index.\n"}, - "sortText": "mapWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`mapWithIndex(typedArray, f)` behaves like `map`, but `f` also receives the index.\n" + }, "insertText": "->TypedArray.mapWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 33, "character": 14}, "end": {"line": 33, "character": 15}}, - "newText": "" - }] - }, { - "label": "->TypedArray.every", "kind": 12, - "tags": [], + "label": "->TypedArray.mapWithIndex", + "sortText": "mapWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 33 }, + "start": { "character": 14, "line": 33 } + } + } + ], "detail": "(t<'a>, 'a => bool) => bool", - "documentation": {"kind": "markdown", "value": "\n`every(typedArray, predicate)` returns `true` if `predicate` returns `true` for every element.\n\nSee [`TypedArray.prototype.every`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/every) on MDN.\n"}, - "sortText": "every", + "documentation": { + "kind": "markdown", + "value": "\n`every(typedArray, predicate)` returns `true` if `predicate` returns `true` for every element.\n\nSee [`TypedArray.prototype.every`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/every) on MDN.\n" + }, "insertText": "->TypedArray.every", - "additionalTextEdits": [{ - "range": {"start": {"line": 33, "character": 14}, "end": {"line": 33, "character": 15}}, - "newText": "" - }] - }, { - "label": "->TypedArray.length", "kind": 12, - "tags": [], + "label": "->TypedArray.every", + "sortText": "every", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 33 }, + "start": { "character": 14, "line": 33 } + } + } + ], "detail": "t<'a> => int", - "documentation": {"kind": "markdown", "value": "\n`length(typedArray)` returns the number of elements.\n\nSee [`TypedArray.prototype.length`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/length) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nTypedArray.length(view) == 3\n```\n"}, - "sortText": "length", + "documentation": { + "kind": "markdown", + "value": "\n`length(typedArray)` returns the number of elements.\n\nSee [`TypedArray.prototype.length`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/length) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nTypedArray.length(view) == 3\n```\n" + }, "insertText": "->TypedArray.length", - "additionalTextEdits": [{ - "range": {"start": {"line": 33, "character": 14}, "end": {"line": 33, "character": 15}}, - "newText": "" - }] - }, { - "label": "->TypedArray.indexOf", "kind": 12, - "tags": [], + "label": "->TypedArray.length", + "sortText": "length", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 33 }, + "start": { "character": 14, "line": 33 } + } + } + ], "detail": "(t<'a>, 'a) => int", - "documentation": {"kind": "markdown", "value": "\n`indexOf(typedArray, value)` returns the first index of `value`, or `-1` when not found.\n\nSee [`TypedArray.prototype.indexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/indexOf) on MDN.\n"}, - "sortText": "indexOf", + "documentation": { + "kind": "markdown", + "value": "\n`indexOf(typedArray, value)` returns the first index of `value`, or `-1` when not found.\n\nSee [`TypedArray.prototype.indexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/indexOf) on MDN.\n" + }, "insertText": "->TypedArray.indexOf", - "additionalTextEdits": [{ - "range": {"start": {"line": 33, "character": 14}, "end": {"line": 33, "character": 15}}, - "newText": "" - }] - }, { - "label": "->TypedArray.copyWithinToEnd", "kind": 12, - "tags": [1], + "label": "->TypedArray.indexOf", + "sortText": "indexOf", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 33 }, + "start": { "character": 14, "line": 33 } + } + } + ], + "deprecated": true, "detail": "(t<'a>, ~target: int, ~start: int) => array<'a>", - "documentation": {"kind": "markdown", "value": "Deprecated: Use `copyWithin` instead\n\n\n`copyWithinToEnd(typedArray, ~target, ~start)` copies values from `start` through the end of the view into the range beginning at `target`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.copyWithin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/copyWithin) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3, 4])\nlet _ = TypedArray.copyWithinToEnd(view, ~target=0, ~start=2)\nTypedArray.toString(view) == \"3,4,3,4\"\n```\n"}, - "sortText": "copyWithinToEnd", + "documentation": { + "kind": "markdown", + "value": "Deprecated: Use `copyWithin` instead\n\n\n`copyWithinToEnd(typedArray, ~target, ~start)` copies values from `start` through the end of the view into the range beginning at `target`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.copyWithin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/copyWithin) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3, 4])\nlet _ = TypedArray.copyWithinToEnd(view, ~target=0, ~start=2)\nTypedArray.toString(view) == \"3,4,3,4\"\n```\n" + }, "insertText": "->TypedArray.copyWithinToEnd", - "additionalTextEdits": [{ - "range": {"start": {"line": 33, "character": 14}, "end": {"line": 33, "character": 15}}, - "newText": "" - }] - }, { - "label": "->TypedArray.some", "kind": 12, - "tags": [], + "label": "->TypedArray.copyWithinToEnd", + "sortText": "copyWithinToEnd", + "tags": [ 1 ] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 33 }, + "start": { "character": 14, "line": 33 } + } + } + ], "detail": "(t<'a>, 'a => bool) => bool", - "documentation": {"kind": "markdown", "value": "\n`some(typedArray, predicate)` returns `true` if `predicate` returns `true` for at least one element.\n\nSee [`TypedArray.prototype.some`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/some) on MDN.\n"}, - "sortText": "some", + "documentation": { + "kind": "markdown", + "value": "\n`some(typedArray, predicate)` returns `true` if `predicate` returns `true` for at least one element.\n\nSee [`TypedArray.prototype.some`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/some) on MDN.\n" + }, "insertText": "->TypedArray.some", - "additionalTextEdits": [{ - "range": {"start": {"line": 33, "character": 14}, "end": {"line": 33, "character": 15}}, - "newText": "" - }] - }, { - "label": "->TypedArray.reduceWithIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.some", + "sortText": "some", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 33 }, + "start": { "character": 14, "line": 33 } + } + } + ], "detail": "(t<'a>, ('b, 'a, int) => 'b, 'b) => 'b", - "documentation": {"kind": "markdown", "value": "\n`reduceWithIndex(typedArray, reducer, initial)` is the indexed variant of `reduce`.\n"}, - "sortText": "reduceWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`reduceWithIndex(typedArray, reducer, initial)` is the indexed variant of `reduce`.\n" + }, "insertText": "->TypedArray.reduceWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 33, "character": 14}, "end": {"line": 33, "character": 15}}, - "newText": "" - }] - }, { - "label": "->TypedArray.map", "kind": 12, - "tags": [], + "label": "->TypedArray.reduceWithIndex", + "sortText": "reduceWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 33 }, + "start": { "character": 14, "line": 33 } + } + } + ], "detail": "(t<'a>, 'a => 'b) => t<'b>", - "documentation": {"kind": "markdown", "value": "\n`map(typedArray, f)` returns a new typed array whose elements are produced by applying `f` to each element.\n\nSee [`TypedArray.prototype.map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/map) on MDN.\n"}, - "sortText": "map", + "documentation": { + "kind": "markdown", + "value": "\n`map(typedArray, f)` returns a new typed array whose elements are produced by applying `f` to each element.\n\nSee [`TypedArray.prototype.map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/map) on MDN.\n" + }, "insertText": "->TypedArray.map", - "additionalTextEdits": [{ - "range": {"start": {"line": 33, "character": 14}, "end": {"line": 33, "character": 15}}, - "newText": "" - }] - }, { - "label": "->TypedArray.toSorted", "kind": 12, - "tags": [], + "label": "->TypedArray.map", + "sortText": "map", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 33 }, + "start": { "character": 14, "line": 33 } + } + } + ], "detail": "(t<'a>, ('a, 'a) => Ordering.t) => t<'a>", - "documentation": {"kind": "markdown", "value": "\n`toSorted(typedArray, comparator)` returns a new typed array containing the sorted values, leaving the original untouched.\n\nSee [`TypedArray.prototype.toSorted`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/toSorted) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([3, 1, 2])\nlet sorted = TypedArray.toSorted(view, Int.compare)\nTypedArray.toString(sorted) == \"1,2,3\"\nTypedArray.toString(view) == \"3,1,2\"\n```\n"}, - "sortText": "toSorted", + "documentation": { + "kind": "markdown", + "value": "\n`toSorted(typedArray, comparator)` returns a new typed array containing the sorted values, leaving the original untouched.\n\nSee [`TypedArray.prototype.toSorted`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/toSorted) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([3, 1, 2])\nlet sorted = TypedArray.toSorted(view, Int.compare)\nTypedArray.toString(sorted) == \"1,2,3\"\nTypedArray.toString(view) == \"3,1,2\"\n```\n" + }, "insertText": "->TypedArray.toSorted", - "additionalTextEdits": [{ - "range": {"start": {"line": 33, "character": 14}, "end": {"line": 33, "character": 15}}, - "newText": "" - }] - }, { - "label": "->TypedArray.copyAllWithin", "kind": 12, - "tags": [], + "label": "->TypedArray.toSorted", + "sortText": "toSorted", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 33 }, + "start": { "character": 14, "line": 33 } + } + } + ], "detail": "(t<'a>, ~target: int) => array<'a>", - "documentation": {"kind": "markdown", "value": "\n`copyAllWithin(typedArray, ~target)` copies values starting at index `0` over the positions beginning at `target`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.copyWithin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/copyWithin) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([10, 20, 30])\nlet _ = TypedArray.copyAllWithin(view, ~target=1)\nTypedArray.toString(view) == \"10,10,20\"\n```\n"}, - "sortText": "copyAllWithin", + "documentation": { + "kind": "markdown", + "value": "\n`copyAllWithin(typedArray, ~target)` copies values starting at index `0` over the positions beginning at `target`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.copyWithin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/copyWithin) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([10, 20, 30])\nlet _ = TypedArray.copyAllWithin(view, ~target=1)\nTypedArray.toString(view) == \"10,10,20\"\n```\n" + }, "insertText": "->TypedArray.copyAllWithin", - "additionalTextEdits": [{ - "range": {"start": {"line": 33, "character": 14}, "end": {"line": 33, "character": 15}}, - "newText": "" - }] - }, { - "label": "->TypedArray.subarray", "kind": 12, - "tags": [], + "label": "->TypedArray.copyAllWithin", + "sortText": "copyAllWithin", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 33 }, + "start": { "character": 14, "line": 33 } + } + } + ], "detail": "(t<'a>, ~start: int, ~end: int=?) => t<'a>", - "documentation": {"kind": "markdown", "value": "\n`subarray(typedArray, ~start, ~end)` returns a new view referencing the same buffer over `[start, end)`.\n\nSee [`TypedArray.prototype.subarray`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/subarray) on MDN.\n"}, - "sortText": "subarray", + "documentation": { + "kind": "markdown", + "value": "\n`subarray(typedArray, ~start, ~end)` returns a new view referencing the same buffer over `[start, end)`.\n\nSee [`TypedArray.prototype.subarray`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/subarray) on MDN.\n" + }, "insertText": "->TypedArray.subarray", - "additionalTextEdits": [{ - "range": {"start": {"line": 33, "character": 14}, "end": {"line": 33, "character": 15}}, - "newText": "" - }] - }, { - "label": "->TypedArray.setArray", "kind": 12, - "tags": [], + "label": "->TypedArray.subarray", + "sortText": "subarray", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 33 }, + "start": { "character": 14, "line": 33 } + } + } + ], "detail": "(t<'a>, array<'a>) => unit", - "documentation": {"kind": "markdown", "value": "\n`setArray(target, source)` copies the values from `source` into `target`, mutating it.\n\nSee [`TypedArray.prototype.set`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/set) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([0, 0])\nTypedArray.setArray(view, [1, 2])\nTypedArray.toString(view) == \"1,2\"\n```\n"}, - "sortText": "setArray", + "documentation": { + "kind": "markdown", + "value": "\n`setArray(target, source)` copies the values from `source` into `target`, mutating it.\n\nSee [`TypedArray.prototype.set`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/set) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([0, 0])\nTypedArray.setArray(view, [1, 2])\nTypedArray.toString(view) == \"1,2\"\n```\n" + }, "insertText": "->TypedArray.setArray", - "additionalTextEdits": [{ - "range": {"start": {"line": 33, "character": 14}, "end": {"line": 33, "character": 15}}, - "newText": "" - }] - }, { - "label": "->TypedArray.get", "kind": 12, - "tags": [], + "label": "->TypedArray.setArray", + "sortText": "setArray", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 33 }, + "start": { "character": 14, "line": 33 } + } + } + ], "detail": "(t<'a>, int) => option<'a>", - "documentation": {"kind": "markdown", "value": "\n`get(typedArray, index)` returns the element at `index` of `typedArray`.\nReturns `None` if the index does not exist in the typed array. Equivalent to doing `typedArray[index]` in JavaScript.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nTypedArray.get(view, 0) == Some(1)\nTypedArray.get(view, 10) == None\n```\n"}, - "sortText": "get", + "documentation": { + "kind": "markdown", + "value": "\n`get(typedArray, index)` returns the element at `index` of `typedArray`.\nReturns `None` if the index does not exist in the typed array. Equivalent to doing `typedArray[index]` in JavaScript.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nTypedArray.get(view, 0) == Some(1)\nTypedArray.get(view, 10) == None\n```\n" + }, "insertText": "->TypedArray.get", - "additionalTextEdits": [{ - "range": {"start": {"line": 33, "character": 14}, "end": {"line": 33, "character": 15}}, - "newText": "" - }] - }, { - "label": "->TypedArray.with", "kind": 12, - "tags": [], + "label": "->TypedArray.get", + "sortText": "get", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 33 }, + "start": { "character": 14, "line": 33 } + } + } + ], "detail": "(t<'a>, int, 'a) => t<'a>", - "documentation": {"kind": "markdown", "value": "\n`with(typedArray, index, value)` returns a new typed array where the element at `index` is replaced with `value`.\n\nSee [`TypedArray.prototype.with`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/with) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nlet updated = TypedArray.with(view, 1, 10)\nTypedArray.toString(updated) == \"1,10,3\"\nTypedArray.toString(view) == \"1,2,3\"\n```\n"}, - "sortText": "with", + "documentation": { + "kind": "markdown", + "value": "\n`with(typedArray, index, value)` returns a new typed array where the element at `index` is replaced with `value`.\n\nSee [`TypedArray.prototype.with`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/with) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nlet updated = TypedArray.with(view, 1, 10)\nTypedArray.toString(updated) == \"1,10,3\"\nTypedArray.toString(view) == \"1,2,3\"\n```\n" + }, "insertText": "->TypedArray.with", - "additionalTextEdits": [{ - "range": {"start": {"line": 33, "character": 14}, "end": {"line": 33, "character": 15}}, - "newText": "" - }] - }, { - "label": "->TypedArray.toReversed", "kind": 12, - "tags": [], + "label": "->TypedArray.with", + "sortText": "with", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 33 }, + "start": { "character": 14, "line": 33 } + } + } + ], "detail": "t<'a> => t<'a>", - "documentation": {"kind": "markdown", "value": "\n`toReversed(typedArray)` returns a new typed array with the elements in reverse order, leaving the original untouched.\n\nSee [`TypedArray.prototype.toReversed`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/toReversed) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nlet reversed = TypedArray.toReversed(view)\nTypedArray.toString(reversed) == \"3,2,1\"\nTypedArray.toString(view) == \"1,2,3\"\n```\n"}, - "sortText": "toReversed", + "documentation": { + "kind": "markdown", + "value": "\n`toReversed(typedArray)` returns a new typed array with the elements in reverse order, leaving the original untouched.\n\nSee [`TypedArray.prototype.toReversed`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/toReversed) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nlet reversed = TypedArray.toReversed(view)\nTypedArray.toString(reversed) == \"3,2,1\"\nTypedArray.toString(view) == \"1,2,3\"\n```\n" + }, "insertText": "->TypedArray.toReversed", - "additionalTextEdits": [{ - "range": {"start": {"line": 33, "character": 14}, "end": {"line": 33, "character": 15}}, - "newText": "" - }] - }, { - "label": "->TypedArray.copyWithin", "kind": 12, - "tags": [], + "label": "->TypedArray.toReversed", + "sortText": "toReversed", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 33 }, + "start": { "character": 14, "line": 33 } + } + } + ], "detail": "(t<'a>, ~target: int, ~start: int, ~end: int=?) => array<'a>", - "documentation": {"kind": "markdown", "value": "\n`copyWithin(typedArray, ~target, ~start, ~end)` copies the section `[start, end)` onto the range beginning at `target`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.copyWithin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/copyWithin) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3, 4])\nlet _ = TypedArray.copyWithin(view, ~target=1, ~start=2, ~end=4)\nTypedArray.toString(view) == \"1,3,4,4\"\n```\n"}, - "sortText": "copyWithin", + "documentation": { + "kind": "markdown", + "value": "\n`copyWithin(typedArray, ~target, ~start, ~end)` copies the section `[start, end)` onto the range beginning at `target`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.copyWithin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/copyWithin) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3, 4])\nlet _ = TypedArray.copyWithin(view, ~target=1, ~start=2, ~end=4)\nTypedArray.toString(view) == \"1,3,4,4\"\n```\n" + }, "insertText": "->TypedArray.copyWithin", - "additionalTextEdits": [{ - "range": {"start": {"line": 33, "character": 14}, "end": {"line": 33, "character": 15}}, - "newText": "" - }] - }, { - "label": "->TypedArray.everyWithIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.copyWithin", + "sortText": "copyWithin", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 33 }, + "start": { "character": 14, "line": 33 } + } + } + ], "detail": "(t<'a>, ('a, int) => bool) => bool", - "documentation": {"kind": "markdown", "value": "\n`everyWithIndex(typedArray, checker)` is like `every` but provides the element index to `checker`.\n"}, - "sortText": "everyWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`everyWithIndex(typedArray, checker)` is like `every` but provides the element index to `checker`.\n" + }, "insertText": "->TypedArray.everyWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 33, "character": 14}, "end": {"line": 33, "character": 15}}, - "newText": "" - }] - }, { - "label": "->TypedArray.toString", "kind": 12, - "tags": [], + "label": "->TypedArray.everyWithIndex", + "sortText": "everyWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 33 }, + "start": { "character": 14, "line": 33 } + } + } + ], "detail": "t<'a> => string", - "documentation": {"kind": "markdown", "value": "\n`toString(typedArray)` returns a comma-separated string of the elements.\n\nSee [`TypedArray.prototype.toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/toString) on MDN.\n\n## Examples\n\n```rescript\nInt32Array.fromArray([1, 2])->TypedArray.toString == \"1,2\"\n```\n"}, - "sortText": "toString", + "documentation": { + "kind": "markdown", + "value": "\n`toString(typedArray)` returns a comma-separated string of the elements.\n\nSee [`TypedArray.prototype.toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/toString) on MDN.\n\n## Examples\n\n```rescript\nInt32Array.fromArray([1, 2])->TypedArray.toString == \"1,2\"\n```\n" + }, "insertText": "->TypedArray.toString", - "additionalTextEdits": [{ - "range": {"start": {"line": 33, "character": 14}, "end": {"line": 33, "character": 15}}, - "newText": "" - }] - }, { - "label": "->TypedArray.setArrayFrom", "kind": 12, - "tags": [], + "label": "->TypedArray.toString", + "sortText": "toString", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 33 }, + "start": { "character": 14, "line": 33 } + } + } + ], "detail": "(t<'a>, array<'a>, int) => unit", - "documentation": {"kind": "markdown", "value": "\n`setArrayFrom(target, source, index)` copies `source` into `target` starting at `index`.\n\nSee [`TypedArray.prototype.set`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/set) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([0, 0, 0])\nTypedArray.setArrayFrom(view, [5, 6], 1)\nTypedArray.toString(view) == \"0,5,6\"\n```\n"}, - "sortText": "setArrayFrom", + "documentation": { + "kind": "markdown", + "value": "\n`setArrayFrom(target, source, index)` copies `source` into `target` starting at `index`.\n\nSee [`TypedArray.prototype.set`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/set) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([0, 0, 0])\nTypedArray.setArrayFrom(view, [5, 6], 1)\nTypedArray.toString(view) == \"0,5,6\"\n```\n" + }, "insertText": "->TypedArray.setArrayFrom", - "additionalTextEdits": [{ - "range": {"start": {"line": 33, "character": 14}, "end": {"line": 33, "character": 15}}, - "newText": "" - }] - }, { - "label": "->TypedArray.forEach", "kind": 12, - "tags": [], + "label": "->TypedArray.setArrayFrom", + "sortText": "setArrayFrom", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 33 }, + "start": { "character": 14, "line": 33 } + } + } + ], "detail": "(t<'a>, 'a => unit) => unit", - "documentation": {"kind": "markdown", "value": "\n`forEach(typedArray, f)` runs `f` for every element in order.\n\nSee [`TypedArray.prototype.forEach`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/forEach) on MDN.\n"}, - "sortText": "forEach", + "documentation": { + "kind": "markdown", + "value": "\n`forEach(typedArray, f)` runs `f` for every element in order.\n\nSee [`TypedArray.prototype.forEach`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/forEach) on MDN.\n" + }, "insertText": "->TypedArray.forEach", - "additionalTextEdits": [{ - "range": {"start": {"line": 33, "character": 14}, "end": {"line": 33, "character": 15}}, - "newText": "" - }] - }, { - "label": "->TypedArray.findWithIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.forEach", + "sortText": "forEach", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 33 }, + "start": { "character": 14, "line": 33 } + } + } + ], "detail": "(t<'a>, ('a, int) => bool) => option<'a>", - "documentation": {"kind": "markdown", "value": "\n`findWithIndex(typedArray, predicate)` behaves like `find`, but `predicate` also receives the index.\n"}, - "sortText": "findWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`findWithIndex(typedArray, predicate)` behaves like `find`, but `predicate` also receives the index.\n" + }, "insertText": "->TypedArray.findWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 33, "character": 14}, "end": {"line": 33, "character": 15}}, - "newText": "" - }] - }, { - "label": "->TypedArray.fill", "kind": 12, - "tags": [], + "label": "->TypedArray.findWithIndex", + "sortText": "findWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 33 }, + "start": { "character": 14, "line": 33 } + } + } + ], "detail": "(t<'a>, 'a, ~start: int, ~end: int=?) => t<'a>", - "documentation": {"kind": "markdown", "value": "\n`fill(typedArray, value, ~start, ~end)` fills the half-open interval `[start, end)` with `value`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.fill`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/fill) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3, 4])\nlet _ = TypedArray.fill(view, 0, ~start=1, ~end=3)\nTypedArray.toString(view) == \"1,0,0,4\"\n```\n"}, - "sortText": "fill", + "documentation": { + "kind": "markdown", + "value": "\n`fill(typedArray, value, ~start, ~end)` fills the half-open interval `[start, end)` with `value`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.fill`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/fill) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3, 4])\nlet _ = TypedArray.fill(view, 0, ~start=1, ~end=3)\nTypedArray.toString(view) == \"1,0,0,4\"\n```\n" + }, "insertText": "->TypedArray.fill", - "additionalTextEdits": [{ - "range": {"start": {"line": 33, "character": 14}, "end": {"line": 33, "character": 15}}, - "newText": "" - }] - }, { - "label": "->TypedArray.indexOfFrom", "kind": 12, - "tags": [], + "label": "->TypedArray.fill", + "sortText": "fill", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 33 }, + "start": { "character": 14, "line": 33 } + } + } + ], "detail": "(t<'a>, 'a, int) => int", - "documentation": {"kind": "markdown", "value": "\n`indexOfFrom(typedArray, value, fromIndex)` searches for `value` starting at `fromIndex`.\n"}, - "sortText": "indexOfFrom", + "documentation": { + "kind": "markdown", + "value": "\n`indexOfFrom(typedArray, value, fromIndex)` searches for `value` starting at `fromIndex`.\n" + }, "insertText": "->TypedArray.indexOfFrom", - "additionalTextEdits": [{ - "range": {"start": {"line": 33, "character": 14}, "end": {"line": 33, "character": 15}}, - "newText": "" - }] - }, { - "label": "->TypedArray.reverse", "kind": 12, - "tags": [], + "label": "->TypedArray.indexOfFrom", + "sortText": "indexOfFrom", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 33 }, + "start": { "character": 14, "line": 33 } + } + } + ], "detail": "t<'a> => unit", - "documentation": {"kind": "markdown", "value": "\n`reverse(typedArray)` reverses the elements of the view in place.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.reverse`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/reverse) on MDN.\n"}, - "sortText": "reverse", + "documentation": { + "kind": "markdown", + "value": "\n`reverse(typedArray)` reverses the elements of the view in place.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.reverse`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/reverse) on MDN.\n" + }, "insertText": "->TypedArray.reverse", - "additionalTextEdits": [{ - "range": {"start": {"line": 33, "character": 14}, "end": {"line": 33, "character": 15}}, - "newText": "" - }] - }, { - "label": "->TypedArray.byteOffset", "kind": 12, - "tags": [], + "label": "->TypedArray.reverse", + "sortText": "reverse", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 33 }, + "start": { "character": 14, "line": 33 } + } + } + ], "detail": "t<'a> => int", - "documentation": {"kind": "markdown", "value": "\n`byteOffset(typedArray)` returns the offset in bytes from the start of the buffer.\n\nSee [`TypedArray.prototype.byteOffset`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/byteOffset) on MDN.\n"}, - "sortText": "byteOffset", + "documentation": { + "kind": "markdown", + "value": "\n`byteOffset(typedArray)` returns the offset in bytes from the start of the buffer.\n\nSee [`TypedArray.prototype.byteOffset`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/byteOffset) on MDN.\n" + }, "insertText": "->TypedArray.byteOffset", - "additionalTextEdits": [{ - "range": {"start": {"line": 33, "character": 14}, "end": {"line": 33, "character": 15}}, - "newText": "" - }] - }] + "kind": 12, + "label": "->TypedArray.byteOffset", + "sortText": "byteOffset", + "tags": [] + } +] Complete src/CompletionTypedArrays.res 37:14 posCursor:[37:14] posNoWhite:[37:13] Found expr:[37:3->37:14] @@ -6224,679 +10805,1188 @@ CPPipe pathFromEnv:Stdlib.Uint8Array found:false Path Stdlib.Uint8Array. Path Stdlib.TypedArray. Path -[{ - "label": "->Uint8Array.ignore", - "kind": 12, - "tags": [], +[ + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 37 }, + "start": { "character": 13, "line": 37 } + } + } + ], "detail": "t => unit", - "documentation": {"kind": "markdown", "value": "\n `ignore(uintArray)` ignores the provided uintArray and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further.\n"}, - "sortText": "ignore", + "documentation": { + "kind": "markdown", + "value": "\n `ignore(uintArray)` ignores the provided uintArray and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further.\n" + }, "insertText": "->Uint8Array.ignore", - "additionalTextEdits": [{ - "range": {"start": {"line": 37, "character": 13}, "end": {"line": 37, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.findLastIndexWithIndex", "kind": 12, - "tags": [], + "label": "->Uint8Array.ignore", + "sortText": "ignore", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 37 }, + "start": { "character": 13, "line": 37 } + } + } + ], "detail": "(t<'a>, ('a, int) => bool) => int", - "documentation": {"kind": "markdown", "value": "\n`findLastIndexWithIndex(typedArray, predicate)` is the indexed variant of `findLastIndex`.\n"}, - "sortText": "findLastIndexWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`findLastIndexWithIndex(typedArray, predicate)` is the indexed variant of `findLastIndex`.\n" + }, "insertText": "->TypedArray.findLastIndexWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 37, "character": 13}, "end": {"line": 37, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.lastIndexOf", "kind": 12, - "tags": [], + "label": "->TypedArray.findLastIndexWithIndex", + "sortText": "findLastIndexWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 37 }, + "start": { "character": 13, "line": 37 } + } + } + ], "detail": "(t<'a>, 'a) => int", - "documentation": {"kind": "markdown", "value": "\n`lastIndexOf(typedArray, value)` returns the last index of `value`, or `-1` if not found.\n\nSee [`TypedArray.prototype.lastIndexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/lastIndexOf) on MDN.\n"}, - "sortText": "lastIndexOf", + "documentation": { + "kind": "markdown", + "value": "\n`lastIndexOf(typedArray, value)` returns the last index of `value`, or `-1` if not found.\n\nSee [`TypedArray.prototype.lastIndexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/lastIndexOf) on MDN.\n" + }, "insertText": "->TypedArray.lastIndexOf", - "additionalTextEdits": [{ - "range": {"start": {"line": 37, "character": 13}, "end": {"line": 37, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.findLastWithIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.lastIndexOf", + "sortText": "lastIndexOf", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 37 }, + "start": { "character": 13, "line": 37 } + } + } + ], "detail": "(t<'a>, ('a, int) => bool) => option<'a>", - "documentation": {"kind": "markdown", "value": "\n`findLastWithIndex(typedArray, predicate)` is the indexed variant of `findLast`.\n"}, - "sortText": "findLastWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`findLastWithIndex(typedArray, predicate)` is the indexed variant of `findLast`.\n" + }, "insertText": "->TypedArray.findLastWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 37, "character": 13}, "end": {"line": 37, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.findLast", "kind": 12, - "tags": [], + "label": "->TypedArray.findLastWithIndex", + "sortText": "findLastWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 37 }, + "start": { "character": 13, "line": 37 } + } + } + ], "detail": "(t<'a>, 'a => bool) => option<'a>", - "documentation": {"kind": "markdown", "value": "\n`findLast(typedArray, predicate)` returns the last element that satisfies `predicate`.\n\nSee [`TypedArray.prototype.findLast`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/findLast) on MDN.\n"}, - "sortText": "findLast", + "documentation": { + "kind": "markdown", + "value": "\n`findLast(typedArray, predicate)` returns the last element that satisfies `predicate`.\n\nSee [`TypedArray.prototype.findLast`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/findLast) on MDN.\n" + }, "insertText": "->TypedArray.findLast", - "additionalTextEdits": [{ - "range": {"start": {"line": 37, "character": 13}, "end": {"line": 37, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.filter", "kind": 12, - "tags": [], + "label": "->TypedArray.findLast", + "sortText": "findLast", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 37 }, + "start": { "character": 13, "line": 37 } + } + } + ], "detail": "(t<'a>, 'a => bool) => t<'a>", - "documentation": {"kind": "markdown", "value": "\n`filter(typedArray, predicate)` returns a new typed array containing only elements that satisfy `predicate`.\n\nSee [`TypedArray.prototype.filter`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/filter) on MDN.\n"}, - "sortText": "filter", + "documentation": { + "kind": "markdown", + "value": "\n`filter(typedArray, predicate)` returns a new typed array containing only elements that satisfy `predicate`.\n\nSee [`TypedArray.prototype.filter`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/filter) on MDN.\n" + }, "insertText": "->TypedArray.filter", - "additionalTextEdits": [{ - "range": {"start": {"line": 37, "character": 13}, "end": {"line": 37, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.byteLength", "kind": 12, - "tags": [], + "label": "->TypedArray.filter", + "sortText": "filter", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 37 }, + "start": { "character": 13, "line": 37 } + } + } + ], "detail": "t<'a> => int", - "documentation": {"kind": "markdown", "value": "\n`byteLength(typedArray)` returns the length in bytes of the view.\n\nSee [`TypedArray.prototype.byteLength`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/byteLength) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2])\nTypedArray.byteLength(view) == 8\n```\n"}, - "sortText": "byteLength", + "documentation": { + "kind": "markdown", + "value": "\n`byteLength(typedArray)` returns the length in bytes of the view.\n\nSee [`TypedArray.prototype.byteLength`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/byteLength) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2])\nTypedArray.byteLength(view) == 8\n```\n" + }, "insertText": "->TypedArray.byteLength", - "additionalTextEdits": [{ - "range": {"start": {"line": 37, "character": 13}, "end": {"line": 37, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.ignore", "kind": 12, - "tags": [], + "label": "->TypedArray.byteLength", + "sortText": "byteLength", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 37 }, + "start": { "character": 13, "line": 37 } + } + } + ], "detail": "t<'a> => unit", - "documentation": {"kind": "markdown", "value": "\n `ignore(typedArray)` ignores the provided typedArray and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further.\n"}, - "sortText": "ignore", + "documentation": { + "kind": "markdown", + "value": "\n `ignore(typedArray)` ignores the provided typedArray and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further.\n" + }, "insertText": "->TypedArray.ignore", - "additionalTextEdits": [{ - "range": {"start": {"line": 37, "character": 13}, "end": {"line": 37, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.reduceRightWithIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.ignore", + "sortText": "ignore", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 37 }, + "start": { "character": 13, "line": 37 } + } + } + ], "detail": "(t<'a>, ('b, 'a, int) => 'b, 'b) => 'b", - "documentation": {"kind": "markdown", "value": "\n`reduceRightWithIndex(typedArray, reducer, initial)` is the indexed variant of `reduceRight`.\n"}, - "sortText": "reduceRightWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`reduceRightWithIndex(typedArray, reducer, initial)` is the indexed variant of `reduceRight`.\n" + }, "insertText": "->TypedArray.reduceRightWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 37, "character": 13}, "end": {"line": 37, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.reduceRight", "kind": 12, - "tags": [], + "label": "->TypedArray.reduceRightWithIndex", + "sortText": "reduceRightWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 37 }, + "start": { "character": 13, "line": 37 } + } + } + ], "detail": "(t<'a>, ('b, 'a) => 'b, 'b) => 'b", - "documentation": {"kind": "markdown", "value": "\n`reduceRight(typedArray, reducer, initial)` is like `reduce` but processes the elements from right to left.\n\nSee [`TypedArray.prototype.reduceRight`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/reduceRight) on MDN.\n"}, - "sortText": "reduceRight", + "documentation": { + "kind": "markdown", + "value": "\n`reduceRight(typedArray, reducer, initial)` is like `reduce` but processes the elements from right to left.\n\nSee [`TypedArray.prototype.reduceRight`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/reduceRight) on MDN.\n" + }, "insertText": "->TypedArray.reduceRight", - "additionalTextEdits": [{ - "range": {"start": {"line": 37, "character": 13}, "end": {"line": 37, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.joinWith", "kind": 12, - "tags": [], + "label": "->TypedArray.reduceRight", + "sortText": "reduceRight", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 37 }, + "start": { "character": 13, "line": 37 } + } + } + ], "detail": "(t<'a>, string) => string", - "documentation": {"kind": "markdown", "value": "\n`joinWith(typedArray, separator)` returns a string formed by the elements joined with `separator`.\n\nSee [`TypedArray.prototype.join`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/join) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nTypedArray.joinWith(view, \"-\") == \"1-2-3\"\n```\n"}, - "sortText": "joinWith", + "documentation": { + "kind": "markdown", + "value": "\n`joinWith(typedArray, separator)` returns a string formed by the elements joined with `separator`.\n\nSee [`TypedArray.prototype.join`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/join) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nTypedArray.joinWith(view, \"-\") == \"1-2-3\"\n```\n" + }, "insertText": "->TypedArray.joinWith", - "additionalTextEdits": [{ - "range": {"start": {"line": 37, "character": 13}, "end": {"line": 37, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.buffer", "kind": 12, - "tags": [], + "label": "->TypedArray.joinWith", + "sortText": "joinWith", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 37 }, + "start": { "character": 13, "line": 37 } + } + } + ], "detail": "t<'a> => ArrayBuffer.t", - "documentation": {"kind": "markdown", "value": "\n`buffer(typedArray)` returns the underlying `ArrayBuffer` backing this view.\n\nSee [`TypedArray.prototype.buffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/buffer) on MDN.\n"}, - "sortText": "buffer", + "documentation": { + "kind": "markdown", + "value": "\n`buffer(typedArray)` returns the underlying `ArrayBuffer` backing this view.\n\nSee [`TypedArray.prototype.buffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/buffer) on MDN.\n" + }, "insertText": "->TypedArray.buffer", - "additionalTextEdits": [{ - "range": {"start": {"line": 37, "character": 13}, "end": {"line": 37, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.reduce", "kind": 12, - "tags": [], + "label": "->TypedArray.buffer", + "sortText": "buffer", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 37 }, + "start": { "character": 13, "line": 37 } + } + } + ], "detail": "(t<'a>, ('b, 'a) => 'b, 'b) => 'b", - "documentation": {"kind": "markdown", "value": "\n`reduce(typedArray, reducer, initial)` combines the elements from left to right using `reducer`.\n\nSee [`TypedArray.prototype.reduce`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/reduce) on MDN.\n"}, - "sortText": "reduce", + "documentation": { + "kind": "markdown", + "value": "\n`reduce(typedArray, reducer, initial)` combines the elements from left to right using `reducer`.\n\nSee [`TypedArray.prototype.reduce`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/reduce) on MDN.\n" + }, "insertText": "->TypedArray.reduce", - "additionalTextEdits": [{ - "range": {"start": {"line": 37, "character": 13}, "end": {"line": 37, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.forEachWithIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.reduce", + "sortText": "reduce", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 37 }, + "start": { "character": 13, "line": 37 } + } + } + ], "detail": "(t<'a>, ('a, int) => unit) => unit", - "documentation": {"kind": "markdown", "value": "\n`forEachWithIndex(typedArray, f)` runs `f` for every element, also providing the index.\n"}, - "sortText": "forEachWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`forEachWithIndex(typedArray, f)` runs `f` for every element, also providing the index.\n" + }, "insertText": "->TypedArray.forEachWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 37, "character": 13}, "end": {"line": 37, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.copy", "kind": 12, - "tags": [], + "label": "->TypedArray.forEachWithIndex", + "sortText": "forEachWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 37 }, + "start": { "character": 13, "line": 37 } + } + } + ], "detail": "t<'a> => t<'a>", - "documentation": {"kind": "markdown", "value": "\n`copy(typedArray)` produces a shallow copy of the typed array.\n"}, - "sortText": "copy", + "documentation": { + "kind": "markdown", + "value": "\n`copy(typedArray)` produces a shallow copy of the typed array.\n" + }, "insertText": "->TypedArray.copy", - "additionalTextEdits": [{ - "range": {"start": {"line": 37, "character": 13}, "end": {"line": 37, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.someWithIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.copy", + "sortText": "copy", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 37 }, + "start": { "character": 13, "line": 37 } + } + } + ], "detail": "(t<'a>, ('a, int) => bool) => bool", - "documentation": {"kind": "markdown", "value": "\n`someWithIndex(typedArray, predicate)` behaves like `some`, but `predicate` also receives the element index.\n"}, - "sortText": "someWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`someWithIndex(typedArray, predicate)` behaves like `some`, but `predicate` also receives the element index.\n" + }, "insertText": "->TypedArray.someWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 37, "character": 13}, "end": {"line": 37, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.findIndexWithIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.someWithIndex", + "sortText": "someWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 37 }, + "start": { "character": 13, "line": 37 } + } + } + ], "detail": "(t<'a>, ('a, int) => bool) => int", - "documentation": {"kind": "markdown", "value": "\n`findIndexWithIndex(typedArray, predicate)` is the indexed variant of `findIndex`.\n"}, - "sortText": "findIndexWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`findIndexWithIndex(typedArray, predicate)` is the indexed variant of `findIndex`.\n" + }, "insertText": "->TypedArray.findIndexWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 37, "character": 13}, "end": {"line": 37, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.sliceToEnd", "kind": 12, - "tags": [1], + "label": "->TypedArray.findIndexWithIndex", + "sortText": "findIndexWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 37 }, + "start": { "character": 13, "line": 37 } + } + } + ], + "deprecated": true, "detail": "(t<'a>, ~start: int) => t<'a>", - "documentation": {"kind": "markdown", "value": "Deprecated: Use `slice` instead\n\n\n`sliceToEnd(typedArray, ~start)` returns the elements from `start` through the end in a new typed array.\n"}, - "sortText": "sliceToEnd", + "documentation": { + "kind": "markdown", + "value": "Deprecated: Use `slice` instead\n\n\n`sliceToEnd(typedArray, ~start)` returns the elements from `start` through the end in a new typed array.\n" + }, "insertText": "->TypedArray.sliceToEnd", - "additionalTextEdits": [{ - "range": {"start": {"line": 37, "character": 13}, "end": {"line": 37, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.slice", "kind": 12, - "tags": [], + "label": "->TypedArray.sliceToEnd", + "sortText": "sliceToEnd", + "tags": [ 1 ] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 37 }, + "start": { "character": 13, "line": 37 } + } + } + ], "detail": "(t<'a>, ~start: int, ~end: int=?) => t<'a>", - "documentation": {"kind": "markdown", "value": "\n`slice(typedArray, ~start, ~end)` returns a new typed array containing the elements in `[start, end)`.\n\nSee [`TypedArray.prototype.slice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/slice) on MDN.\n"}, - "sortText": "slice", + "documentation": { + "kind": "markdown", + "value": "\n`slice(typedArray, ~start, ~end)` returns a new typed array containing the elements in `[start, end)`.\n\nSee [`TypedArray.prototype.slice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/slice) on MDN.\n" + }, "insertText": "->TypedArray.slice", - "additionalTextEdits": [{ - "range": {"start": {"line": 37, "character": 13}, "end": {"line": 37, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.findLastIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.slice", + "sortText": "slice", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 37 }, + "start": { "character": 13, "line": 37 } + } + } + ], "detail": "(t<'a>, 'a => bool) => int", - "documentation": {"kind": "markdown", "value": "\n`findLastIndex(typedArray, predicate)` returns the index of the last matching element, or `-1` if none do.\n\nSee [`TypedArray.prototype.findLastIndex`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/findLastIndex) on MDN.\n"}, - "sortText": "findLastIndex", + "documentation": { + "kind": "markdown", + "value": "\n`findLastIndex(typedArray, predicate)` returns the index of the last matching element, or `-1` if none do.\n\nSee [`TypedArray.prototype.findLastIndex`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/findLastIndex) on MDN.\n" + }, "insertText": "->TypedArray.findLastIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 37, "character": 13}, "end": {"line": 37, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.includes", "kind": 12, - "tags": [], + "label": "->TypedArray.findLastIndex", + "sortText": "findLastIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 37 }, + "start": { "character": 13, "line": 37 } + } + } + ], "detail": "(t<'a>, 'a) => bool", - "documentation": {"kind": "markdown", "value": "\n`includes(typedArray, value)` returns `true` if `value` occurs in the typed array.\n\nSee [`TypedArray.prototype.includes`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/includes) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nTypedArray.includes(view, 2) == true\nTypedArray.includes(view, 10) == false\n```\n"}, - "sortText": "includes", + "documentation": { + "kind": "markdown", + "value": "\n`includes(typedArray, value)` returns `true` if `value` occurs in the typed array.\n\nSee [`TypedArray.prototype.includes`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/includes) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nTypedArray.includes(view, 2) == true\nTypedArray.includes(view, 10) == false\n```\n" + }, "insertText": "->TypedArray.includes", - "additionalTextEdits": [{ - "range": {"start": {"line": 37, "character": 13}, "end": {"line": 37, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.fillToEnd", "kind": 12, - "tags": [1], + "label": "->TypedArray.includes", + "sortText": "includes", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 37 }, + "start": { "character": 13, "line": 37 } + } + } + ], + "deprecated": true, "detail": "(t<'a>, 'a, ~start: int) => t<'a>", - "documentation": {"kind": "markdown", "value": "Deprecated: Use `fill` instead\n\n\n`fillToEnd(typedArray, value, ~start)` fills from `start` through the end with `value`.\n\nBeware this will *mutate* the typed array.\n"}, - "sortText": "fillToEnd", + "documentation": { + "kind": "markdown", + "value": "Deprecated: Use `fill` instead\n\n\n`fillToEnd(typedArray, value, ~start)` fills from `start` through the end with `value`.\n\nBeware this will *mutate* the typed array.\n" + }, "insertText": "->TypedArray.fillToEnd", - "additionalTextEdits": [{ - "range": {"start": {"line": 37, "character": 13}, "end": {"line": 37, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.fillAll", "kind": 12, - "tags": [], + "label": "->TypedArray.fillToEnd", + "sortText": "fillToEnd", + "tags": [ 1 ] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 37 }, + "start": { "character": 13, "line": 37 } + } + } + ], "detail": "(t<'a>, 'a) => t<'a>", - "documentation": {"kind": "markdown", "value": "\n`fillAll(typedArray, value)` fills every element with `value`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.fill`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/fill) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nlet _ = TypedArray.fillAll(view, 9)\nTypedArray.toString(view) == \"9,9,9\"\n```\n"}, - "sortText": "fillAll", + "documentation": { + "kind": "markdown", + "value": "\n`fillAll(typedArray, value)` fills every element with `value`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.fill`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/fill) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nlet _ = TypedArray.fillAll(view, 9)\nTypedArray.toString(view) == \"9,9,9\"\n```\n" + }, "insertText": "->TypedArray.fillAll", - "additionalTextEdits": [{ - "range": {"start": {"line": 37, "character": 13}, "end": {"line": 37, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.find", "kind": 12, - "tags": [], + "label": "->TypedArray.fillAll", + "sortText": "fillAll", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 37 }, + "start": { "character": 13, "line": 37 } + } + } + ], "detail": "(t<'a>, 'a => bool) => option<'a>", - "documentation": {"kind": "markdown", "value": "\n`find(typedArray, predicate)` returns the first element that satisfies `predicate`, or `None` if nothing matches.\n\nSee [`TypedArray.prototype.find`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/find) on MDN.\n"}, - "sortText": "find", + "documentation": { + "kind": "markdown", + "value": "\n`find(typedArray, predicate)` returns the first element that satisfies `predicate`, or `None` if nothing matches.\n\nSee [`TypedArray.prototype.find`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/find) on MDN.\n" + }, "insertText": "->TypedArray.find", - "additionalTextEdits": [{ - "range": {"start": {"line": 37, "character": 13}, "end": {"line": 37, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.subarrayToEnd", "kind": 12, - "tags": [1], + "label": "->TypedArray.find", + "sortText": "find", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 37 }, + "start": { "character": 13, "line": 37 } + } + } + ], + "deprecated": true, "detail": "(t<'a>, ~start: int) => t<'a>", - "documentation": {"kind": "markdown", "value": "Deprecated: Use `subarray` instead\n\n\n`subarrayToEnd(typedArray, ~start)` returns a new view from `start` to the end of the buffer.\n"}, - "sortText": "subarrayToEnd", + "documentation": { + "kind": "markdown", + "value": "Deprecated: Use `subarray` instead\n\n\n`subarrayToEnd(typedArray, ~start)` returns a new view from `start` to the end of the buffer.\n" + }, "insertText": "->TypedArray.subarrayToEnd", - "additionalTextEdits": [{ - "range": {"start": {"line": 37, "character": 13}, "end": {"line": 37, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.set", "kind": 12, - "tags": [], + "label": "->TypedArray.subarrayToEnd", + "sortText": "subarrayToEnd", + "tags": [ 1 ] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 37 }, + "start": { "character": 13, "line": 37 } + } + } + ], "detail": "(t<'a>, int, 'a) => unit", - "documentation": {"kind": "markdown", "value": "\n`set(typedArray, index, item)` sets the provided `item` at `index` of `typedArray`.\n\nBeware this will *mutate* the array.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2])\nTypedArray.set(view, 1, 5)\nTypedArray.get(view, 1) == Some(5)\n```\n"}, - "sortText": "set", + "documentation": { + "kind": "markdown", + "value": "\n`set(typedArray, index, item)` sets the provided `item` at `index` of `typedArray`.\n\nBeware this will *mutate* the array.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2])\nTypedArray.set(view, 1, 5)\nTypedArray.get(view, 1) == Some(5)\n```\n" + }, "insertText": "->TypedArray.set", - "additionalTextEdits": [{ - "range": {"start": {"line": 37, "character": 13}, "end": {"line": 37, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.toLocaleString", "kind": 12, - "tags": [], + "label": "->TypedArray.set", + "sortText": "set", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 37 }, + "start": { "character": 13, "line": 37 } + } + } + ], "detail": "t<'a> => string", - "documentation": {"kind": "markdown", "value": "\n`toLocaleString(typedArray)` concatenates the elements using locale-aware formatting.\n\nSee [`TypedArray.prototype.toLocaleString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/toLocaleString) on MDN.\n"}, - "sortText": "toLocaleString", + "documentation": { + "kind": "markdown", + "value": "\n`toLocaleString(typedArray)` concatenates the elements using locale-aware formatting.\n\nSee [`TypedArray.prototype.toLocaleString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/toLocaleString) on MDN.\n" + }, "insertText": "->TypedArray.toLocaleString", - "additionalTextEdits": [{ - "range": {"start": {"line": 37, "character": 13}, "end": {"line": 37, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.lastIndexOfFrom", "kind": 12, - "tags": [], + "label": "->TypedArray.toLocaleString", + "sortText": "toLocaleString", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 37 }, + "start": { "character": 13, "line": 37 } + } + } + ], "detail": "(t<'a>, 'a, int) => int", - "documentation": {"kind": "markdown", "value": "\n`lastIndexOfFrom(typedArray, value, fromIndex)` searches backwards starting at `fromIndex`.\n"}, - "sortText": "lastIndexOfFrom", + "documentation": { + "kind": "markdown", + "value": "\n`lastIndexOfFrom(typedArray, value, fromIndex)` searches backwards starting at `fromIndex`.\n" + }, "insertText": "->TypedArray.lastIndexOfFrom", - "additionalTextEdits": [{ - "range": {"start": {"line": 37, "character": 13}, "end": {"line": 37, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.findIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.lastIndexOfFrom", + "sortText": "lastIndexOfFrom", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 37 }, + "start": { "character": 13, "line": 37 } + } + } + ], "detail": "(t<'a>, 'a => bool) => int", - "documentation": {"kind": "markdown", "value": "\n`findIndex(typedArray, predicate)` returns the index of the first element that satisfies `predicate`, or `-1` if none do.\n\nSee [`TypedArray.prototype.findIndex`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/findIndex) on MDN.\n"}, - "sortText": "findIndex", + "documentation": { + "kind": "markdown", + "value": "\n`findIndex(typedArray, predicate)` returns the index of the first element that satisfies `predicate`, or `-1` if none do.\n\nSee [`TypedArray.prototype.findIndex`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/findIndex) on MDN.\n" + }, "insertText": "->TypedArray.findIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 37, "character": 13}, "end": {"line": 37, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.filterWithIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.findIndex", + "sortText": "findIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 37 }, + "start": { "character": 13, "line": 37 } + } + } + ], "detail": "(t<'a>, ('a, int) => bool) => t<'a>", - "documentation": {"kind": "markdown", "value": "\n`filterWithIndex(typedArray, predicate)` behaves like `filter` but also passes the index to `predicate`.\n"}, - "sortText": "filterWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`filterWithIndex(typedArray, predicate)` behaves like `filter` but also passes the index to `predicate`.\n" + }, "insertText": "->TypedArray.filterWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 37, "character": 13}, "end": {"line": 37, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.sort", "kind": 12, - "tags": [], + "label": "->TypedArray.filterWithIndex", + "sortText": "filterWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 37 }, + "start": { "character": 13, "line": 37 } + } + } + ], "detail": "(t<'a>, ('a, 'a) => Ordering.t) => unit", - "documentation": {"kind": "markdown", "value": "\n`sort(typedArray, comparator)` sorts the values in place using `comparator`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.sort`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/sort) on MDN.\n"}, - "sortText": "sort", + "documentation": { + "kind": "markdown", + "value": "\n`sort(typedArray, comparator)` sorts the values in place using `comparator`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.sort`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/sort) on MDN.\n" + }, "insertText": "->TypedArray.sort", - "additionalTextEdits": [{ - "range": {"start": {"line": 37, "character": 13}, "end": {"line": 37, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.mapWithIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.sort", + "sortText": "sort", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 37 }, + "start": { "character": 13, "line": 37 } + } + } + ], "detail": "(t<'a>, ('a, int) => 'b) => t<'b>", - "documentation": {"kind": "markdown", "value": "\n`mapWithIndex(typedArray, f)` behaves like `map`, but `f` also receives the index.\n"}, - "sortText": "mapWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`mapWithIndex(typedArray, f)` behaves like `map`, but `f` also receives the index.\n" + }, "insertText": "->TypedArray.mapWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 37, "character": 13}, "end": {"line": 37, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.every", "kind": 12, - "tags": [], + "label": "->TypedArray.mapWithIndex", + "sortText": "mapWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 37 }, + "start": { "character": 13, "line": 37 } + } + } + ], "detail": "(t<'a>, 'a => bool) => bool", - "documentation": {"kind": "markdown", "value": "\n`every(typedArray, predicate)` returns `true` if `predicate` returns `true` for every element.\n\nSee [`TypedArray.prototype.every`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/every) on MDN.\n"}, - "sortText": "every", + "documentation": { + "kind": "markdown", + "value": "\n`every(typedArray, predicate)` returns `true` if `predicate` returns `true` for every element.\n\nSee [`TypedArray.prototype.every`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/every) on MDN.\n" + }, "insertText": "->TypedArray.every", - "additionalTextEdits": [{ - "range": {"start": {"line": 37, "character": 13}, "end": {"line": 37, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.length", "kind": 12, - "tags": [], + "label": "->TypedArray.every", + "sortText": "every", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 37 }, + "start": { "character": 13, "line": 37 } + } + } + ], "detail": "t<'a> => int", - "documentation": {"kind": "markdown", "value": "\n`length(typedArray)` returns the number of elements.\n\nSee [`TypedArray.prototype.length`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/length) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nTypedArray.length(view) == 3\n```\n"}, - "sortText": "length", + "documentation": { + "kind": "markdown", + "value": "\n`length(typedArray)` returns the number of elements.\n\nSee [`TypedArray.prototype.length`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/length) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nTypedArray.length(view) == 3\n```\n" + }, "insertText": "->TypedArray.length", - "additionalTextEdits": [{ - "range": {"start": {"line": 37, "character": 13}, "end": {"line": 37, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.indexOf", "kind": 12, - "tags": [], + "label": "->TypedArray.length", + "sortText": "length", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 37 }, + "start": { "character": 13, "line": 37 } + } + } + ], "detail": "(t<'a>, 'a) => int", - "documentation": {"kind": "markdown", "value": "\n`indexOf(typedArray, value)` returns the first index of `value`, or `-1` when not found.\n\nSee [`TypedArray.prototype.indexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/indexOf) on MDN.\n"}, - "sortText": "indexOf", + "documentation": { + "kind": "markdown", + "value": "\n`indexOf(typedArray, value)` returns the first index of `value`, or `-1` when not found.\n\nSee [`TypedArray.prototype.indexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/indexOf) on MDN.\n" + }, "insertText": "->TypedArray.indexOf", - "additionalTextEdits": [{ - "range": {"start": {"line": 37, "character": 13}, "end": {"line": 37, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.copyWithinToEnd", "kind": 12, - "tags": [1], + "label": "->TypedArray.indexOf", + "sortText": "indexOf", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 37 }, + "start": { "character": 13, "line": 37 } + } + } + ], + "deprecated": true, "detail": "(t<'a>, ~target: int, ~start: int) => array<'a>", - "documentation": {"kind": "markdown", "value": "Deprecated: Use `copyWithin` instead\n\n\n`copyWithinToEnd(typedArray, ~target, ~start)` copies values from `start` through the end of the view into the range beginning at `target`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.copyWithin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/copyWithin) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3, 4])\nlet _ = TypedArray.copyWithinToEnd(view, ~target=0, ~start=2)\nTypedArray.toString(view) == \"3,4,3,4\"\n```\n"}, - "sortText": "copyWithinToEnd", + "documentation": { + "kind": "markdown", + "value": "Deprecated: Use `copyWithin` instead\n\n\n`copyWithinToEnd(typedArray, ~target, ~start)` copies values from `start` through the end of the view into the range beginning at `target`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.copyWithin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/copyWithin) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3, 4])\nlet _ = TypedArray.copyWithinToEnd(view, ~target=0, ~start=2)\nTypedArray.toString(view) == \"3,4,3,4\"\n```\n" + }, "insertText": "->TypedArray.copyWithinToEnd", - "additionalTextEdits": [{ - "range": {"start": {"line": 37, "character": 13}, "end": {"line": 37, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.some", "kind": 12, - "tags": [], + "label": "->TypedArray.copyWithinToEnd", + "sortText": "copyWithinToEnd", + "tags": [ 1 ] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 37 }, + "start": { "character": 13, "line": 37 } + } + } + ], "detail": "(t<'a>, 'a => bool) => bool", - "documentation": {"kind": "markdown", "value": "\n`some(typedArray, predicate)` returns `true` if `predicate` returns `true` for at least one element.\n\nSee [`TypedArray.prototype.some`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/some) on MDN.\n"}, - "sortText": "some", + "documentation": { + "kind": "markdown", + "value": "\n`some(typedArray, predicate)` returns `true` if `predicate` returns `true` for at least one element.\n\nSee [`TypedArray.prototype.some`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/some) on MDN.\n" + }, "insertText": "->TypedArray.some", - "additionalTextEdits": [{ - "range": {"start": {"line": 37, "character": 13}, "end": {"line": 37, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.reduceWithIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.some", + "sortText": "some", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 37 }, + "start": { "character": 13, "line": 37 } + } + } + ], "detail": "(t<'a>, ('b, 'a, int) => 'b, 'b) => 'b", - "documentation": {"kind": "markdown", "value": "\n`reduceWithIndex(typedArray, reducer, initial)` is the indexed variant of `reduce`.\n"}, - "sortText": "reduceWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`reduceWithIndex(typedArray, reducer, initial)` is the indexed variant of `reduce`.\n" + }, "insertText": "->TypedArray.reduceWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 37, "character": 13}, "end": {"line": 37, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.map", "kind": 12, - "tags": [], + "label": "->TypedArray.reduceWithIndex", + "sortText": "reduceWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 37 }, + "start": { "character": 13, "line": 37 } + } + } + ], "detail": "(t<'a>, 'a => 'b) => t<'b>", - "documentation": {"kind": "markdown", "value": "\n`map(typedArray, f)` returns a new typed array whose elements are produced by applying `f` to each element.\n\nSee [`TypedArray.prototype.map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/map) on MDN.\n"}, - "sortText": "map", + "documentation": { + "kind": "markdown", + "value": "\n`map(typedArray, f)` returns a new typed array whose elements are produced by applying `f` to each element.\n\nSee [`TypedArray.prototype.map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/map) on MDN.\n" + }, "insertText": "->TypedArray.map", - "additionalTextEdits": [{ - "range": {"start": {"line": 37, "character": 13}, "end": {"line": 37, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.toSorted", "kind": 12, - "tags": [], + "label": "->TypedArray.map", + "sortText": "map", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 37 }, + "start": { "character": 13, "line": 37 } + } + } + ], "detail": "(t<'a>, ('a, 'a) => Ordering.t) => t<'a>", - "documentation": {"kind": "markdown", "value": "\n`toSorted(typedArray, comparator)` returns a new typed array containing the sorted values, leaving the original untouched.\n\nSee [`TypedArray.prototype.toSorted`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/toSorted) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([3, 1, 2])\nlet sorted = TypedArray.toSorted(view, Int.compare)\nTypedArray.toString(sorted) == \"1,2,3\"\nTypedArray.toString(view) == \"3,1,2\"\n```\n"}, - "sortText": "toSorted", + "documentation": { + "kind": "markdown", + "value": "\n`toSorted(typedArray, comparator)` returns a new typed array containing the sorted values, leaving the original untouched.\n\nSee [`TypedArray.prototype.toSorted`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/toSorted) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([3, 1, 2])\nlet sorted = TypedArray.toSorted(view, Int.compare)\nTypedArray.toString(sorted) == \"1,2,3\"\nTypedArray.toString(view) == \"3,1,2\"\n```\n" + }, "insertText": "->TypedArray.toSorted", - "additionalTextEdits": [{ - "range": {"start": {"line": 37, "character": 13}, "end": {"line": 37, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.copyAllWithin", "kind": 12, - "tags": [], + "label": "->TypedArray.toSorted", + "sortText": "toSorted", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 37 }, + "start": { "character": 13, "line": 37 } + } + } + ], "detail": "(t<'a>, ~target: int) => array<'a>", - "documentation": {"kind": "markdown", "value": "\n`copyAllWithin(typedArray, ~target)` copies values starting at index `0` over the positions beginning at `target`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.copyWithin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/copyWithin) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([10, 20, 30])\nlet _ = TypedArray.copyAllWithin(view, ~target=1)\nTypedArray.toString(view) == \"10,10,20\"\n```\n"}, - "sortText": "copyAllWithin", + "documentation": { + "kind": "markdown", + "value": "\n`copyAllWithin(typedArray, ~target)` copies values starting at index `0` over the positions beginning at `target`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.copyWithin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/copyWithin) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([10, 20, 30])\nlet _ = TypedArray.copyAllWithin(view, ~target=1)\nTypedArray.toString(view) == \"10,10,20\"\n```\n" + }, "insertText": "->TypedArray.copyAllWithin", - "additionalTextEdits": [{ - "range": {"start": {"line": 37, "character": 13}, "end": {"line": 37, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.subarray", "kind": 12, - "tags": [], + "label": "->TypedArray.copyAllWithin", + "sortText": "copyAllWithin", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 37 }, + "start": { "character": 13, "line": 37 } + } + } + ], "detail": "(t<'a>, ~start: int, ~end: int=?) => t<'a>", - "documentation": {"kind": "markdown", "value": "\n`subarray(typedArray, ~start, ~end)` returns a new view referencing the same buffer over `[start, end)`.\n\nSee [`TypedArray.prototype.subarray`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/subarray) on MDN.\n"}, - "sortText": "subarray", + "documentation": { + "kind": "markdown", + "value": "\n`subarray(typedArray, ~start, ~end)` returns a new view referencing the same buffer over `[start, end)`.\n\nSee [`TypedArray.prototype.subarray`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/subarray) on MDN.\n" + }, "insertText": "->TypedArray.subarray", - "additionalTextEdits": [{ - "range": {"start": {"line": 37, "character": 13}, "end": {"line": 37, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.setArray", "kind": 12, - "tags": [], + "label": "->TypedArray.subarray", + "sortText": "subarray", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 37 }, + "start": { "character": 13, "line": 37 } + } + } + ], "detail": "(t<'a>, array<'a>) => unit", - "documentation": {"kind": "markdown", "value": "\n`setArray(target, source)` copies the values from `source` into `target`, mutating it.\n\nSee [`TypedArray.prototype.set`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/set) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([0, 0])\nTypedArray.setArray(view, [1, 2])\nTypedArray.toString(view) == \"1,2\"\n```\n"}, - "sortText": "setArray", + "documentation": { + "kind": "markdown", + "value": "\n`setArray(target, source)` copies the values from `source` into `target`, mutating it.\n\nSee [`TypedArray.prototype.set`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/set) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([0, 0])\nTypedArray.setArray(view, [1, 2])\nTypedArray.toString(view) == \"1,2\"\n```\n" + }, "insertText": "->TypedArray.setArray", - "additionalTextEdits": [{ - "range": {"start": {"line": 37, "character": 13}, "end": {"line": 37, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.get", "kind": 12, - "tags": [], + "label": "->TypedArray.setArray", + "sortText": "setArray", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 37 }, + "start": { "character": 13, "line": 37 } + } + } + ], "detail": "(t<'a>, int) => option<'a>", - "documentation": {"kind": "markdown", "value": "\n`get(typedArray, index)` returns the element at `index` of `typedArray`.\nReturns `None` if the index does not exist in the typed array. Equivalent to doing `typedArray[index]` in JavaScript.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nTypedArray.get(view, 0) == Some(1)\nTypedArray.get(view, 10) == None\n```\n"}, - "sortText": "get", + "documentation": { + "kind": "markdown", + "value": "\n`get(typedArray, index)` returns the element at `index` of `typedArray`.\nReturns `None` if the index does not exist in the typed array. Equivalent to doing `typedArray[index]` in JavaScript.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nTypedArray.get(view, 0) == Some(1)\nTypedArray.get(view, 10) == None\n```\n" + }, "insertText": "->TypedArray.get", - "additionalTextEdits": [{ - "range": {"start": {"line": 37, "character": 13}, "end": {"line": 37, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.with", "kind": 12, - "tags": [], + "label": "->TypedArray.get", + "sortText": "get", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 37 }, + "start": { "character": 13, "line": 37 } + } + } + ], "detail": "(t<'a>, int, 'a) => t<'a>", - "documentation": {"kind": "markdown", "value": "\n`with(typedArray, index, value)` returns a new typed array where the element at `index` is replaced with `value`.\n\nSee [`TypedArray.prototype.with`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/with) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nlet updated = TypedArray.with(view, 1, 10)\nTypedArray.toString(updated) == \"1,10,3\"\nTypedArray.toString(view) == \"1,2,3\"\n```\n"}, - "sortText": "with", + "documentation": { + "kind": "markdown", + "value": "\n`with(typedArray, index, value)` returns a new typed array where the element at `index` is replaced with `value`.\n\nSee [`TypedArray.prototype.with`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/with) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nlet updated = TypedArray.with(view, 1, 10)\nTypedArray.toString(updated) == \"1,10,3\"\nTypedArray.toString(view) == \"1,2,3\"\n```\n" + }, "insertText": "->TypedArray.with", - "additionalTextEdits": [{ - "range": {"start": {"line": 37, "character": 13}, "end": {"line": 37, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.toReversed", "kind": 12, - "tags": [], + "label": "->TypedArray.with", + "sortText": "with", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 37 }, + "start": { "character": 13, "line": 37 } + } + } + ], "detail": "t<'a> => t<'a>", - "documentation": {"kind": "markdown", "value": "\n`toReversed(typedArray)` returns a new typed array with the elements in reverse order, leaving the original untouched.\n\nSee [`TypedArray.prototype.toReversed`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/toReversed) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nlet reversed = TypedArray.toReversed(view)\nTypedArray.toString(reversed) == \"3,2,1\"\nTypedArray.toString(view) == \"1,2,3\"\n```\n"}, - "sortText": "toReversed", + "documentation": { + "kind": "markdown", + "value": "\n`toReversed(typedArray)` returns a new typed array with the elements in reverse order, leaving the original untouched.\n\nSee [`TypedArray.prototype.toReversed`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/toReversed) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nlet reversed = TypedArray.toReversed(view)\nTypedArray.toString(reversed) == \"3,2,1\"\nTypedArray.toString(view) == \"1,2,3\"\n```\n" + }, "insertText": "->TypedArray.toReversed", - "additionalTextEdits": [{ - "range": {"start": {"line": 37, "character": 13}, "end": {"line": 37, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.copyWithin", "kind": 12, - "tags": [], + "label": "->TypedArray.toReversed", + "sortText": "toReversed", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 37 }, + "start": { "character": 13, "line": 37 } + } + } + ], "detail": "(t<'a>, ~target: int, ~start: int, ~end: int=?) => array<'a>", - "documentation": {"kind": "markdown", "value": "\n`copyWithin(typedArray, ~target, ~start, ~end)` copies the section `[start, end)` onto the range beginning at `target`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.copyWithin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/copyWithin) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3, 4])\nlet _ = TypedArray.copyWithin(view, ~target=1, ~start=2, ~end=4)\nTypedArray.toString(view) == \"1,3,4,4\"\n```\n"}, - "sortText": "copyWithin", + "documentation": { + "kind": "markdown", + "value": "\n`copyWithin(typedArray, ~target, ~start, ~end)` copies the section `[start, end)` onto the range beginning at `target`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.copyWithin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/copyWithin) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3, 4])\nlet _ = TypedArray.copyWithin(view, ~target=1, ~start=2, ~end=4)\nTypedArray.toString(view) == \"1,3,4,4\"\n```\n" + }, "insertText": "->TypedArray.copyWithin", - "additionalTextEdits": [{ - "range": {"start": {"line": 37, "character": 13}, "end": {"line": 37, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.everyWithIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.copyWithin", + "sortText": "copyWithin", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 37 }, + "start": { "character": 13, "line": 37 } + } + } + ], "detail": "(t<'a>, ('a, int) => bool) => bool", - "documentation": {"kind": "markdown", "value": "\n`everyWithIndex(typedArray, checker)` is like `every` but provides the element index to `checker`.\n"}, - "sortText": "everyWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`everyWithIndex(typedArray, checker)` is like `every` but provides the element index to `checker`.\n" + }, "insertText": "->TypedArray.everyWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 37, "character": 13}, "end": {"line": 37, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.toString", "kind": 12, - "tags": [], + "label": "->TypedArray.everyWithIndex", + "sortText": "everyWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 37 }, + "start": { "character": 13, "line": 37 } + } + } + ], "detail": "t<'a> => string", - "documentation": {"kind": "markdown", "value": "\n`toString(typedArray)` returns a comma-separated string of the elements.\n\nSee [`TypedArray.prototype.toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/toString) on MDN.\n\n## Examples\n\n```rescript\nInt32Array.fromArray([1, 2])->TypedArray.toString == \"1,2\"\n```\n"}, - "sortText": "toString", + "documentation": { + "kind": "markdown", + "value": "\n`toString(typedArray)` returns a comma-separated string of the elements.\n\nSee [`TypedArray.prototype.toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/toString) on MDN.\n\n## Examples\n\n```rescript\nInt32Array.fromArray([1, 2])->TypedArray.toString == \"1,2\"\n```\n" + }, "insertText": "->TypedArray.toString", - "additionalTextEdits": [{ - "range": {"start": {"line": 37, "character": 13}, "end": {"line": 37, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.setArrayFrom", "kind": 12, - "tags": [], + "label": "->TypedArray.toString", + "sortText": "toString", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 37 }, + "start": { "character": 13, "line": 37 } + } + } + ], "detail": "(t<'a>, array<'a>, int) => unit", - "documentation": {"kind": "markdown", "value": "\n`setArrayFrom(target, source, index)` copies `source` into `target` starting at `index`.\n\nSee [`TypedArray.prototype.set`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/set) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([0, 0, 0])\nTypedArray.setArrayFrom(view, [5, 6], 1)\nTypedArray.toString(view) == \"0,5,6\"\n```\n"}, - "sortText": "setArrayFrom", + "documentation": { + "kind": "markdown", + "value": "\n`setArrayFrom(target, source, index)` copies `source` into `target` starting at `index`.\n\nSee [`TypedArray.prototype.set`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/set) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([0, 0, 0])\nTypedArray.setArrayFrom(view, [5, 6], 1)\nTypedArray.toString(view) == \"0,5,6\"\n```\n" + }, "insertText": "->TypedArray.setArrayFrom", - "additionalTextEdits": [{ - "range": {"start": {"line": 37, "character": 13}, "end": {"line": 37, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.forEach", "kind": 12, - "tags": [], + "label": "->TypedArray.setArrayFrom", + "sortText": "setArrayFrom", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 37 }, + "start": { "character": 13, "line": 37 } + } + } + ], "detail": "(t<'a>, 'a => unit) => unit", - "documentation": {"kind": "markdown", "value": "\n`forEach(typedArray, f)` runs `f` for every element in order.\n\nSee [`TypedArray.prototype.forEach`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/forEach) on MDN.\n"}, - "sortText": "forEach", + "documentation": { + "kind": "markdown", + "value": "\n`forEach(typedArray, f)` runs `f` for every element in order.\n\nSee [`TypedArray.prototype.forEach`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/forEach) on MDN.\n" + }, "insertText": "->TypedArray.forEach", - "additionalTextEdits": [{ - "range": {"start": {"line": 37, "character": 13}, "end": {"line": 37, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.findWithIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.forEach", + "sortText": "forEach", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 37 }, + "start": { "character": 13, "line": 37 } + } + } + ], "detail": "(t<'a>, ('a, int) => bool) => option<'a>", - "documentation": {"kind": "markdown", "value": "\n`findWithIndex(typedArray, predicate)` behaves like `find`, but `predicate` also receives the index.\n"}, - "sortText": "findWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`findWithIndex(typedArray, predicate)` behaves like `find`, but `predicate` also receives the index.\n" + }, "insertText": "->TypedArray.findWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 37, "character": 13}, "end": {"line": 37, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.fill", "kind": 12, - "tags": [], + "label": "->TypedArray.findWithIndex", + "sortText": "findWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 37 }, + "start": { "character": 13, "line": 37 } + } + } + ], "detail": "(t<'a>, 'a, ~start: int, ~end: int=?) => t<'a>", - "documentation": {"kind": "markdown", "value": "\n`fill(typedArray, value, ~start, ~end)` fills the half-open interval `[start, end)` with `value`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.fill`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/fill) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3, 4])\nlet _ = TypedArray.fill(view, 0, ~start=1, ~end=3)\nTypedArray.toString(view) == \"1,0,0,4\"\n```\n"}, - "sortText": "fill", + "documentation": { + "kind": "markdown", + "value": "\n`fill(typedArray, value, ~start, ~end)` fills the half-open interval `[start, end)` with `value`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.fill`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/fill) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3, 4])\nlet _ = TypedArray.fill(view, 0, ~start=1, ~end=3)\nTypedArray.toString(view) == \"1,0,0,4\"\n```\n" + }, "insertText": "->TypedArray.fill", - "additionalTextEdits": [{ - "range": {"start": {"line": 37, "character": 13}, "end": {"line": 37, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.indexOfFrom", "kind": 12, - "tags": [], + "label": "->TypedArray.fill", + "sortText": "fill", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 37 }, + "start": { "character": 13, "line": 37 } + } + } + ], "detail": "(t<'a>, 'a, int) => int", - "documentation": {"kind": "markdown", "value": "\n`indexOfFrom(typedArray, value, fromIndex)` searches for `value` starting at `fromIndex`.\n"}, - "sortText": "indexOfFrom", + "documentation": { + "kind": "markdown", + "value": "\n`indexOfFrom(typedArray, value, fromIndex)` searches for `value` starting at `fromIndex`.\n" + }, "insertText": "->TypedArray.indexOfFrom", - "additionalTextEdits": [{ - "range": {"start": {"line": 37, "character": 13}, "end": {"line": 37, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.reverse", "kind": 12, - "tags": [], + "label": "->TypedArray.indexOfFrom", + "sortText": "indexOfFrom", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 37 }, + "start": { "character": 13, "line": 37 } + } + } + ], "detail": "t<'a> => unit", - "documentation": {"kind": "markdown", "value": "\n`reverse(typedArray)` reverses the elements of the view in place.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.reverse`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/reverse) on MDN.\n"}, - "sortText": "reverse", + "documentation": { + "kind": "markdown", + "value": "\n`reverse(typedArray)` reverses the elements of the view in place.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.reverse`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/reverse) on MDN.\n" + }, "insertText": "->TypedArray.reverse", - "additionalTextEdits": [{ - "range": {"start": {"line": 37, "character": 13}, "end": {"line": 37, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.byteOffset", "kind": 12, - "tags": [], + "label": "->TypedArray.reverse", + "sortText": "reverse", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 37 }, + "start": { "character": 13, "line": 37 } + } + } + ], "detail": "t<'a> => int", - "documentation": {"kind": "markdown", "value": "\n`byteOffset(typedArray)` returns the offset in bytes from the start of the buffer.\n\nSee [`TypedArray.prototype.byteOffset`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/byteOffset) on MDN.\n"}, - "sortText": "byteOffset", + "documentation": { + "kind": "markdown", + "value": "\n`byteOffset(typedArray)` returns the offset in bytes from the start of the buffer.\n\nSee [`TypedArray.prototype.byteOffset`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/byteOffset) on MDN.\n" + }, "insertText": "->TypedArray.byteOffset", - "additionalTextEdits": [{ - "range": {"start": {"line": 37, "character": 13}, "end": {"line": 37, "character": 14}}, - "newText": "" - }] - }] + "kind": 12, + "label": "->TypedArray.byteOffset", + "sortText": "byteOffset", + "tags": [] + } +] Complete src/CompletionTypedArrays.res 41:21 posCursor:[41:21] posNoWhite:[41:20] Found expr:[41:3->41:21] @@ -6914,677 +12004,1186 @@ CPPipe pathFromEnv:Stdlib.Uint8ClampedArray found:false Path Stdlib.Uint8ClampedArray. Path Stdlib.TypedArray. Path -[{ - "label": "->Uint8ClampedArray.ignore", - "kind": 12, - "tags": [], +[ + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 21, "line": 41 }, + "start": { "character": 20, "line": 41 } + } + } + ], "detail": "t => unit", - "documentation": {"kind": "markdown", "value": "\n `ignore(uintArray)` ignores the provided uintArray and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further.\n"}, - "sortText": "ignore", + "documentation": { + "kind": "markdown", + "value": "\n `ignore(uintArray)` ignores the provided uintArray and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further.\n" + }, "insertText": "->Uint8ClampedArray.ignore", - "additionalTextEdits": [{ - "range": {"start": {"line": 41, "character": 20}, "end": {"line": 41, "character": 21}}, - "newText": "" - }] - }, { - "label": "->TypedArray.findLastIndexWithIndex", "kind": 12, - "tags": [], + "label": "->Uint8ClampedArray.ignore", + "sortText": "ignore", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 21, "line": 41 }, + "start": { "character": 20, "line": 41 } + } + } + ], "detail": "(t<'a>, ('a, int) => bool) => int", - "documentation": {"kind": "markdown", "value": "\n`findLastIndexWithIndex(typedArray, predicate)` is the indexed variant of `findLastIndex`.\n"}, - "sortText": "findLastIndexWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`findLastIndexWithIndex(typedArray, predicate)` is the indexed variant of `findLastIndex`.\n" + }, "insertText": "->TypedArray.findLastIndexWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 41, "character": 20}, "end": {"line": 41, "character": 21}}, - "newText": "" - }] - }, { - "label": "->TypedArray.lastIndexOf", "kind": 12, - "tags": [], + "label": "->TypedArray.findLastIndexWithIndex", + "sortText": "findLastIndexWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 21, "line": 41 }, + "start": { "character": 20, "line": 41 } + } + } + ], "detail": "(t<'a>, 'a) => int", - "documentation": {"kind": "markdown", "value": "\n`lastIndexOf(typedArray, value)` returns the last index of `value`, or `-1` if not found.\n\nSee [`TypedArray.prototype.lastIndexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/lastIndexOf) on MDN.\n"}, - "sortText": "lastIndexOf", + "documentation": { + "kind": "markdown", + "value": "\n`lastIndexOf(typedArray, value)` returns the last index of `value`, or `-1` if not found.\n\nSee [`TypedArray.prototype.lastIndexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/lastIndexOf) on MDN.\n" + }, "insertText": "->TypedArray.lastIndexOf", - "additionalTextEdits": [{ - "range": {"start": {"line": 41, "character": 20}, "end": {"line": 41, "character": 21}}, - "newText": "" - }] - }, { - "label": "->TypedArray.findLastWithIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.lastIndexOf", + "sortText": "lastIndexOf", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 21, "line": 41 }, + "start": { "character": 20, "line": 41 } + } + } + ], "detail": "(t<'a>, ('a, int) => bool) => option<'a>", - "documentation": {"kind": "markdown", "value": "\n`findLastWithIndex(typedArray, predicate)` is the indexed variant of `findLast`.\n"}, - "sortText": "findLastWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`findLastWithIndex(typedArray, predicate)` is the indexed variant of `findLast`.\n" + }, "insertText": "->TypedArray.findLastWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 41, "character": 20}, "end": {"line": 41, "character": 21}}, - "newText": "" - }] - }, { - "label": "->TypedArray.findLast", "kind": 12, - "tags": [], + "label": "->TypedArray.findLastWithIndex", + "sortText": "findLastWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 21, "line": 41 }, + "start": { "character": 20, "line": 41 } + } + } + ], "detail": "(t<'a>, 'a => bool) => option<'a>", - "documentation": {"kind": "markdown", "value": "\n`findLast(typedArray, predicate)` returns the last element that satisfies `predicate`.\n\nSee [`TypedArray.prototype.findLast`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/findLast) on MDN.\n"}, - "sortText": "findLast", + "documentation": { + "kind": "markdown", + "value": "\n`findLast(typedArray, predicate)` returns the last element that satisfies `predicate`.\n\nSee [`TypedArray.prototype.findLast`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/findLast) on MDN.\n" + }, "insertText": "->TypedArray.findLast", - "additionalTextEdits": [{ - "range": {"start": {"line": 41, "character": 20}, "end": {"line": 41, "character": 21}}, - "newText": "" - }] - }, { - "label": "->TypedArray.filter", "kind": 12, - "tags": [], + "label": "->TypedArray.findLast", + "sortText": "findLast", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 21, "line": 41 }, + "start": { "character": 20, "line": 41 } + } + } + ], "detail": "(t<'a>, 'a => bool) => t<'a>", - "documentation": {"kind": "markdown", "value": "\n`filter(typedArray, predicate)` returns a new typed array containing only elements that satisfy `predicate`.\n\nSee [`TypedArray.prototype.filter`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/filter) on MDN.\n"}, - "sortText": "filter", + "documentation": { + "kind": "markdown", + "value": "\n`filter(typedArray, predicate)` returns a new typed array containing only elements that satisfy `predicate`.\n\nSee [`TypedArray.prototype.filter`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/filter) on MDN.\n" + }, "insertText": "->TypedArray.filter", - "additionalTextEdits": [{ - "range": {"start": {"line": 41, "character": 20}, "end": {"line": 41, "character": 21}}, - "newText": "" - }] - }, { - "label": "->TypedArray.byteLength", "kind": 12, - "tags": [], + "label": "->TypedArray.filter", + "sortText": "filter", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 21, "line": 41 }, + "start": { "character": 20, "line": 41 } + } + } + ], "detail": "t<'a> => int", - "documentation": {"kind": "markdown", "value": "\n`byteLength(typedArray)` returns the length in bytes of the view.\n\nSee [`TypedArray.prototype.byteLength`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/byteLength) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2])\nTypedArray.byteLength(view) == 8\n```\n"}, - "sortText": "byteLength", + "documentation": { + "kind": "markdown", + "value": "\n`byteLength(typedArray)` returns the length in bytes of the view.\n\nSee [`TypedArray.prototype.byteLength`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/byteLength) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2])\nTypedArray.byteLength(view) == 8\n```\n" + }, "insertText": "->TypedArray.byteLength", - "additionalTextEdits": [{ - "range": {"start": {"line": 41, "character": 20}, "end": {"line": 41, "character": 21}}, - "newText": "" - }] - }, { - "label": "->TypedArray.ignore", "kind": 12, - "tags": [], + "label": "->TypedArray.byteLength", + "sortText": "byteLength", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 21, "line": 41 }, + "start": { "character": 20, "line": 41 } + } + } + ], "detail": "t<'a> => unit", - "documentation": {"kind": "markdown", "value": "\n `ignore(typedArray)` ignores the provided typedArray and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further.\n"}, - "sortText": "ignore", + "documentation": { + "kind": "markdown", + "value": "\n `ignore(typedArray)` ignores the provided typedArray and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further.\n" + }, "insertText": "->TypedArray.ignore", - "additionalTextEdits": [{ - "range": {"start": {"line": 41, "character": 20}, "end": {"line": 41, "character": 21}}, - "newText": "" - }] - }, { - "label": "->TypedArray.reduceRightWithIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.ignore", + "sortText": "ignore", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 21, "line": 41 }, + "start": { "character": 20, "line": 41 } + } + } + ], "detail": "(t<'a>, ('b, 'a, int) => 'b, 'b) => 'b", - "documentation": {"kind": "markdown", "value": "\n`reduceRightWithIndex(typedArray, reducer, initial)` is the indexed variant of `reduceRight`.\n"}, - "sortText": "reduceRightWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`reduceRightWithIndex(typedArray, reducer, initial)` is the indexed variant of `reduceRight`.\n" + }, "insertText": "->TypedArray.reduceRightWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 41, "character": 20}, "end": {"line": 41, "character": 21}}, - "newText": "" - }] - }, { - "label": "->TypedArray.reduceRight", "kind": 12, - "tags": [], + "label": "->TypedArray.reduceRightWithIndex", + "sortText": "reduceRightWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 21, "line": 41 }, + "start": { "character": 20, "line": 41 } + } + } + ], "detail": "(t<'a>, ('b, 'a) => 'b, 'b) => 'b", - "documentation": {"kind": "markdown", "value": "\n`reduceRight(typedArray, reducer, initial)` is like `reduce` but processes the elements from right to left.\n\nSee [`TypedArray.prototype.reduceRight`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/reduceRight) on MDN.\n"}, - "sortText": "reduceRight", + "documentation": { + "kind": "markdown", + "value": "\n`reduceRight(typedArray, reducer, initial)` is like `reduce` but processes the elements from right to left.\n\nSee [`TypedArray.prototype.reduceRight`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/reduceRight) on MDN.\n" + }, "insertText": "->TypedArray.reduceRight", - "additionalTextEdits": [{ - "range": {"start": {"line": 41, "character": 20}, "end": {"line": 41, "character": 21}}, - "newText": "" - }] - }, { - "label": "->TypedArray.joinWith", "kind": 12, - "tags": [], + "label": "->TypedArray.reduceRight", + "sortText": "reduceRight", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 21, "line": 41 }, + "start": { "character": 20, "line": 41 } + } + } + ], "detail": "(t<'a>, string) => string", - "documentation": {"kind": "markdown", "value": "\n`joinWith(typedArray, separator)` returns a string formed by the elements joined with `separator`.\n\nSee [`TypedArray.prototype.join`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/join) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nTypedArray.joinWith(view, \"-\") == \"1-2-3\"\n```\n"}, - "sortText": "joinWith", + "documentation": { + "kind": "markdown", + "value": "\n`joinWith(typedArray, separator)` returns a string formed by the elements joined with `separator`.\n\nSee [`TypedArray.prototype.join`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/join) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nTypedArray.joinWith(view, \"-\") == \"1-2-3\"\n```\n" + }, "insertText": "->TypedArray.joinWith", - "additionalTextEdits": [{ - "range": {"start": {"line": 41, "character": 20}, "end": {"line": 41, "character": 21}}, - "newText": "" - }] - }, { - "label": "->TypedArray.buffer", "kind": 12, - "tags": [], + "label": "->TypedArray.joinWith", + "sortText": "joinWith", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 21, "line": 41 }, + "start": { "character": 20, "line": 41 } + } + } + ], "detail": "t<'a> => ArrayBuffer.t", - "documentation": {"kind": "markdown", "value": "\n`buffer(typedArray)` returns the underlying `ArrayBuffer` backing this view.\n\nSee [`TypedArray.prototype.buffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/buffer) on MDN.\n"}, - "sortText": "buffer", + "documentation": { + "kind": "markdown", + "value": "\n`buffer(typedArray)` returns the underlying `ArrayBuffer` backing this view.\n\nSee [`TypedArray.prototype.buffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/buffer) on MDN.\n" + }, "insertText": "->TypedArray.buffer", - "additionalTextEdits": [{ - "range": {"start": {"line": 41, "character": 20}, "end": {"line": 41, "character": 21}}, - "newText": "" - }] - }, { - "label": "->TypedArray.reduce", "kind": 12, - "tags": [], + "label": "->TypedArray.buffer", + "sortText": "buffer", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 21, "line": 41 }, + "start": { "character": 20, "line": 41 } + } + } + ], "detail": "(t<'a>, ('b, 'a) => 'b, 'b) => 'b", - "documentation": {"kind": "markdown", "value": "\n`reduce(typedArray, reducer, initial)` combines the elements from left to right using `reducer`.\n\nSee [`TypedArray.prototype.reduce`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/reduce) on MDN.\n"}, - "sortText": "reduce", + "documentation": { + "kind": "markdown", + "value": "\n`reduce(typedArray, reducer, initial)` combines the elements from left to right using `reducer`.\n\nSee [`TypedArray.prototype.reduce`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/reduce) on MDN.\n" + }, "insertText": "->TypedArray.reduce", - "additionalTextEdits": [{ - "range": {"start": {"line": 41, "character": 20}, "end": {"line": 41, "character": 21}}, - "newText": "" - }] - }, { - "label": "->TypedArray.forEachWithIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.reduce", + "sortText": "reduce", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 21, "line": 41 }, + "start": { "character": 20, "line": 41 } + } + } + ], "detail": "(t<'a>, ('a, int) => unit) => unit", - "documentation": {"kind": "markdown", "value": "\n`forEachWithIndex(typedArray, f)` runs `f` for every element, also providing the index.\n"}, - "sortText": "forEachWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`forEachWithIndex(typedArray, f)` runs `f` for every element, also providing the index.\n" + }, "insertText": "->TypedArray.forEachWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 41, "character": 20}, "end": {"line": 41, "character": 21}}, - "newText": "" - }] - }, { - "label": "->TypedArray.copy", "kind": 12, - "tags": [], + "label": "->TypedArray.forEachWithIndex", + "sortText": "forEachWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 21, "line": 41 }, + "start": { "character": 20, "line": 41 } + } + } + ], "detail": "t<'a> => t<'a>", - "documentation": {"kind": "markdown", "value": "\n`copy(typedArray)` produces a shallow copy of the typed array.\n"}, - "sortText": "copy", + "documentation": { + "kind": "markdown", + "value": "\n`copy(typedArray)` produces a shallow copy of the typed array.\n" + }, "insertText": "->TypedArray.copy", - "additionalTextEdits": [{ - "range": {"start": {"line": 41, "character": 20}, "end": {"line": 41, "character": 21}}, - "newText": "" - }] - }, { - "label": "->TypedArray.someWithIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.copy", + "sortText": "copy", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 21, "line": 41 }, + "start": { "character": 20, "line": 41 } + } + } + ], "detail": "(t<'a>, ('a, int) => bool) => bool", - "documentation": {"kind": "markdown", "value": "\n`someWithIndex(typedArray, predicate)` behaves like `some`, but `predicate` also receives the element index.\n"}, - "sortText": "someWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`someWithIndex(typedArray, predicate)` behaves like `some`, but `predicate` also receives the element index.\n" + }, "insertText": "->TypedArray.someWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 41, "character": 20}, "end": {"line": 41, "character": 21}}, - "newText": "" - }] - }, { - "label": "->TypedArray.findIndexWithIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.someWithIndex", + "sortText": "someWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 21, "line": 41 }, + "start": { "character": 20, "line": 41 } + } + } + ], "detail": "(t<'a>, ('a, int) => bool) => int", - "documentation": {"kind": "markdown", "value": "\n`findIndexWithIndex(typedArray, predicate)` is the indexed variant of `findIndex`.\n"}, - "sortText": "findIndexWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`findIndexWithIndex(typedArray, predicate)` is the indexed variant of `findIndex`.\n" + }, "insertText": "->TypedArray.findIndexWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 41, "character": 20}, "end": {"line": 41, "character": 21}}, - "newText": "" - }] - }, { - "label": "->TypedArray.sliceToEnd", "kind": 12, - "tags": [1], + "label": "->TypedArray.findIndexWithIndex", + "sortText": "findIndexWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 21, "line": 41 }, + "start": { "character": 20, "line": 41 } + } + } + ], + "deprecated": true, "detail": "(t<'a>, ~start: int) => t<'a>", - "documentation": {"kind": "markdown", "value": "Deprecated: Use `slice` instead\n\n\n`sliceToEnd(typedArray, ~start)` returns the elements from `start` through the end in a new typed array.\n"}, - "sortText": "sliceToEnd", + "documentation": { + "kind": "markdown", + "value": "Deprecated: Use `slice` instead\n\n\n`sliceToEnd(typedArray, ~start)` returns the elements from `start` through the end in a new typed array.\n" + }, "insertText": "->TypedArray.sliceToEnd", - "additionalTextEdits": [{ - "range": {"start": {"line": 41, "character": 20}, "end": {"line": 41, "character": 21}}, - "newText": "" - }] - }, { - "label": "->TypedArray.slice", "kind": 12, - "tags": [], + "label": "->TypedArray.sliceToEnd", + "sortText": "sliceToEnd", + "tags": [ 1 ] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 21, "line": 41 }, + "start": { "character": 20, "line": 41 } + } + } + ], "detail": "(t<'a>, ~start: int, ~end: int=?) => t<'a>", - "documentation": {"kind": "markdown", "value": "\n`slice(typedArray, ~start, ~end)` returns a new typed array containing the elements in `[start, end)`.\n\nSee [`TypedArray.prototype.slice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/slice) on MDN.\n"}, - "sortText": "slice", + "documentation": { + "kind": "markdown", + "value": "\n`slice(typedArray, ~start, ~end)` returns a new typed array containing the elements in `[start, end)`.\n\nSee [`TypedArray.prototype.slice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/slice) on MDN.\n" + }, "insertText": "->TypedArray.slice", - "additionalTextEdits": [{ - "range": {"start": {"line": 41, "character": 20}, "end": {"line": 41, "character": 21}}, - "newText": "" - }] - }, { - "label": "->TypedArray.findLastIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.slice", + "sortText": "slice", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 21, "line": 41 }, + "start": { "character": 20, "line": 41 } + } + } + ], "detail": "(t<'a>, 'a => bool) => int", - "documentation": {"kind": "markdown", "value": "\n`findLastIndex(typedArray, predicate)` returns the index of the last matching element, or `-1` if none do.\n\nSee [`TypedArray.prototype.findLastIndex`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/findLastIndex) on MDN.\n"}, - "sortText": "findLastIndex", + "documentation": { + "kind": "markdown", + "value": "\n`findLastIndex(typedArray, predicate)` returns the index of the last matching element, or `-1` if none do.\n\nSee [`TypedArray.prototype.findLastIndex`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/findLastIndex) on MDN.\n" + }, "insertText": "->TypedArray.findLastIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 41, "character": 20}, "end": {"line": 41, "character": 21}}, - "newText": "" - }] - }, { - "label": "->TypedArray.includes", "kind": 12, - "tags": [], + "label": "->TypedArray.findLastIndex", + "sortText": "findLastIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 21, "line": 41 }, + "start": { "character": 20, "line": 41 } + } + } + ], "detail": "(t<'a>, 'a) => bool", - "documentation": {"kind": "markdown", "value": "\n`includes(typedArray, value)` returns `true` if `value` occurs in the typed array.\n\nSee [`TypedArray.prototype.includes`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/includes) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nTypedArray.includes(view, 2) == true\nTypedArray.includes(view, 10) == false\n```\n"}, - "sortText": "includes", + "documentation": { + "kind": "markdown", + "value": "\n`includes(typedArray, value)` returns `true` if `value` occurs in the typed array.\n\nSee [`TypedArray.prototype.includes`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/includes) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nTypedArray.includes(view, 2) == true\nTypedArray.includes(view, 10) == false\n```\n" + }, "insertText": "->TypedArray.includes", - "additionalTextEdits": [{ - "range": {"start": {"line": 41, "character": 20}, "end": {"line": 41, "character": 21}}, - "newText": "" - }] - }, { - "label": "->TypedArray.fillToEnd", "kind": 12, - "tags": [1], + "label": "->TypedArray.includes", + "sortText": "includes", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 21, "line": 41 }, + "start": { "character": 20, "line": 41 } + } + } + ], + "deprecated": true, "detail": "(t<'a>, 'a, ~start: int) => t<'a>", - "documentation": {"kind": "markdown", "value": "Deprecated: Use `fill` instead\n\n\n`fillToEnd(typedArray, value, ~start)` fills from `start` through the end with `value`.\n\nBeware this will *mutate* the typed array.\n"}, - "sortText": "fillToEnd", + "documentation": { + "kind": "markdown", + "value": "Deprecated: Use `fill` instead\n\n\n`fillToEnd(typedArray, value, ~start)` fills from `start` through the end with `value`.\n\nBeware this will *mutate* the typed array.\n" + }, "insertText": "->TypedArray.fillToEnd", - "additionalTextEdits": [{ - "range": {"start": {"line": 41, "character": 20}, "end": {"line": 41, "character": 21}}, - "newText": "" - }] - }, { - "label": "->TypedArray.fillAll", "kind": 12, - "tags": [], + "label": "->TypedArray.fillToEnd", + "sortText": "fillToEnd", + "tags": [ 1 ] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 21, "line": 41 }, + "start": { "character": 20, "line": 41 } + } + } + ], "detail": "(t<'a>, 'a) => t<'a>", - "documentation": {"kind": "markdown", "value": "\n`fillAll(typedArray, value)` fills every element with `value`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.fill`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/fill) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nlet _ = TypedArray.fillAll(view, 9)\nTypedArray.toString(view) == \"9,9,9\"\n```\n"}, - "sortText": "fillAll", + "documentation": { + "kind": "markdown", + "value": "\n`fillAll(typedArray, value)` fills every element with `value`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.fill`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/fill) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nlet _ = TypedArray.fillAll(view, 9)\nTypedArray.toString(view) == \"9,9,9\"\n```\n" + }, "insertText": "->TypedArray.fillAll", - "additionalTextEdits": [{ - "range": {"start": {"line": 41, "character": 20}, "end": {"line": 41, "character": 21}}, - "newText": "" - }] - }, { - "label": "->TypedArray.find", "kind": 12, - "tags": [], + "label": "->TypedArray.fillAll", + "sortText": "fillAll", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 21, "line": 41 }, + "start": { "character": 20, "line": 41 } + } + } + ], "detail": "(t<'a>, 'a => bool) => option<'a>", - "documentation": {"kind": "markdown", "value": "\n`find(typedArray, predicate)` returns the first element that satisfies `predicate`, or `None` if nothing matches.\n\nSee [`TypedArray.prototype.find`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/find) on MDN.\n"}, - "sortText": "find", + "documentation": { + "kind": "markdown", + "value": "\n`find(typedArray, predicate)` returns the first element that satisfies `predicate`, or `None` if nothing matches.\n\nSee [`TypedArray.prototype.find`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/find) on MDN.\n" + }, "insertText": "->TypedArray.find", - "additionalTextEdits": [{ - "range": {"start": {"line": 41, "character": 20}, "end": {"line": 41, "character": 21}}, - "newText": "" - }] - }, { - "label": "->TypedArray.subarrayToEnd", "kind": 12, - "tags": [1], + "label": "->TypedArray.find", + "sortText": "find", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 21, "line": 41 }, + "start": { "character": 20, "line": 41 } + } + } + ], + "deprecated": true, "detail": "(t<'a>, ~start: int) => t<'a>", - "documentation": {"kind": "markdown", "value": "Deprecated: Use `subarray` instead\n\n\n`subarrayToEnd(typedArray, ~start)` returns a new view from `start` to the end of the buffer.\n"}, - "sortText": "subarrayToEnd", + "documentation": { + "kind": "markdown", + "value": "Deprecated: Use `subarray` instead\n\n\n`subarrayToEnd(typedArray, ~start)` returns a new view from `start` to the end of the buffer.\n" + }, "insertText": "->TypedArray.subarrayToEnd", - "additionalTextEdits": [{ - "range": {"start": {"line": 41, "character": 20}, "end": {"line": 41, "character": 21}}, - "newText": "" - }] - }, { - "label": "->TypedArray.set", "kind": 12, - "tags": [], + "label": "->TypedArray.subarrayToEnd", + "sortText": "subarrayToEnd", + "tags": [ 1 ] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 21, "line": 41 }, + "start": { "character": 20, "line": 41 } + } + } + ], "detail": "(t<'a>, int, 'a) => unit", - "documentation": {"kind": "markdown", "value": "\n`set(typedArray, index, item)` sets the provided `item` at `index` of `typedArray`.\n\nBeware this will *mutate* the array.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2])\nTypedArray.set(view, 1, 5)\nTypedArray.get(view, 1) == Some(5)\n```\n"}, - "sortText": "set", + "documentation": { + "kind": "markdown", + "value": "\n`set(typedArray, index, item)` sets the provided `item` at `index` of `typedArray`.\n\nBeware this will *mutate* the array.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2])\nTypedArray.set(view, 1, 5)\nTypedArray.get(view, 1) == Some(5)\n```\n" + }, "insertText": "->TypedArray.set", - "additionalTextEdits": [{ - "range": {"start": {"line": 41, "character": 20}, "end": {"line": 41, "character": 21}}, - "newText": "" - }] - }, { - "label": "->TypedArray.toLocaleString", "kind": 12, - "tags": [], + "label": "->TypedArray.set", + "sortText": "set", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 21, "line": 41 }, + "start": { "character": 20, "line": 41 } + } + } + ], "detail": "t<'a> => string", - "documentation": {"kind": "markdown", "value": "\n`toLocaleString(typedArray)` concatenates the elements using locale-aware formatting.\n\nSee [`TypedArray.prototype.toLocaleString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/toLocaleString) on MDN.\n"}, - "sortText": "toLocaleString", + "documentation": { + "kind": "markdown", + "value": "\n`toLocaleString(typedArray)` concatenates the elements using locale-aware formatting.\n\nSee [`TypedArray.prototype.toLocaleString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/toLocaleString) on MDN.\n" + }, "insertText": "->TypedArray.toLocaleString", - "additionalTextEdits": [{ - "range": {"start": {"line": 41, "character": 20}, "end": {"line": 41, "character": 21}}, - "newText": "" - }] - }, { - "label": "->TypedArray.lastIndexOfFrom", "kind": 12, - "tags": [], + "label": "->TypedArray.toLocaleString", + "sortText": "toLocaleString", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 21, "line": 41 }, + "start": { "character": 20, "line": 41 } + } + } + ], "detail": "(t<'a>, 'a, int) => int", - "documentation": {"kind": "markdown", "value": "\n`lastIndexOfFrom(typedArray, value, fromIndex)` searches backwards starting at `fromIndex`.\n"}, - "sortText": "lastIndexOfFrom", + "documentation": { + "kind": "markdown", + "value": "\n`lastIndexOfFrom(typedArray, value, fromIndex)` searches backwards starting at `fromIndex`.\n" + }, "insertText": "->TypedArray.lastIndexOfFrom", - "additionalTextEdits": [{ - "range": {"start": {"line": 41, "character": 20}, "end": {"line": 41, "character": 21}}, - "newText": "" - }] - }, { - "label": "->TypedArray.findIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.lastIndexOfFrom", + "sortText": "lastIndexOfFrom", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 21, "line": 41 }, + "start": { "character": 20, "line": 41 } + } + } + ], "detail": "(t<'a>, 'a => bool) => int", - "documentation": {"kind": "markdown", "value": "\n`findIndex(typedArray, predicate)` returns the index of the first element that satisfies `predicate`, or `-1` if none do.\n\nSee [`TypedArray.prototype.findIndex`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/findIndex) on MDN.\n"}, - "sortText": "findIndex", + "documentation": { + "kind": "markdown", + "value": "\n`findIndex(typedArray, predicate)` returns the index of the first element that satisfies `predicate`, or `-1` if none do.\n\nSee [`TypedArray.prototype.findIndex`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/findIndex) on MDN.\n" + }, "insertText": "->TypedArray.findIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 41, "character": 20}, "end": {"line": 41, "character": 21}}, - "newText": "" - }] - }, { - "label": "->TypedArray.filterWithIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.findIndex", + "sortText": "findIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 21, "line": 41 }, + "start": { "character": 20, "line": 41 } + } + } + ], "detail": "(t<'a>, ('a, int) => bool) => t<'a>", - "documentation": {"kind": "markdown", "value": "\n`filterWithIndex(typedArray, predicate)` behaves like `filter` but also passes the index to `predicate`.\n"}, - "sortText": "filterWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`filterWithIndex(typedArray, predicate)` behaves like `filter` but also passes the index to `predicate`.\n" + }, "insertText": "->TypedArray.filterWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 41, "character": 20}, "end": {"line": 41, "character": 21}}, - "newText": "" - }] - }, { - "label": "->TypedArray.sort", "kind": 12, - "tags": [], + "label": "->TypedArray.filterWithIndex", + "sortText": "filterWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 21, "line": 41 }, + "start": { "character": 20, "line": 41 } + } + } + ], "detail": "(t<'a>, ('a, 'a) => Ordering.t) => unit", - "documentation": {"kind": "markdown", "value": "\n`sort(typedArray, comparator)` sorts the values in place using `comparator`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.sort`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/sort) on MDN.\n"}, - "sortText": "sort", + "documentation": { + "kind": "markdown", + "value": "\n`sort(typedArray, comparator)` sorts the values in place using `comparator`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.sort`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/sort) on MDN.\n" + }, "insertText": "->TypedArray.sort", - "additionalTextEdits": [{ - "range": {"start": {"line": 41, "character": 20}, "end": {"line": 41, "character": 21}}, - "newText": "" - }] - }, { - "label": "->TypedArray.mapWithIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.sort", + "sortText": "sort", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 21, "line": 41 }, + "start": { "character": 20, "line": 41 } + } + } + ], "detail": "(t<'a>, ('a, int) => 'b) => t<'b>", - "documentation": {"kind": "markdown", "value": "\n`mapWithIndex(typedArray, f)` behaves like `map`, but `f` also receives the index.\n"}, - "sortText": "mapWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`mapWithIndex(typedArray, f)` behaves like `map`, but `f` also receives the index.\n" + }, "insertText": "->TypedArray.mapWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 41, "character": 20}, "end": {"line": 41, "character": 21}}, - "newText": "" - }] - }, { - "label": "->TypedArray.every", "kind": 12, - "tags": [], + "label": "->TypedArray.mapWithIndex", + "sortText": "mapWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 21, "line": 41 }, + "start": { "character": 20, "line": 41 } + } + } + ], "detail": "(t<'a>, 'a => bool) => bool", - "documentation": {"kind": "markdown", "value": "\n`every(typedArray, predicate)` returns `true` if `predicate` returns `true` for every element.\n\nSee [`TypedArray.prototype.every`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/every) on MDN.\n"}, - "sortText": "every", + "documentation": { + "kind": "markdown", + "value": "\n`every(typedArray, predicate)` returns `true` if `predicate` returns `true` for every element.\n\nSee [`TypedArray.prototype.every`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/every) on MDN.\n" + }, "insertText": "->TypedArray.every", - "additionalTextEdits": [{ - "range": {"start": {"line": 41, "character": 20}, "end": {"line": 41, "character": 21}}, - "newText": "" - }] - }, { - "label": "->TypedArray.length", "kind": 12, - "tags": [], + "label": "->TypedArray.every", + "sortText": "every", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 21, "line": 41 }, + "start": { "character": 20, "line": 41 } + } + } + ], "detail": "t<'a> => int", - "documentation": {"kind": "markdown", "value": "\n`length(typedArray)` returns the number of elements.\n\nSee [`TypedArray.prototype.length`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/length) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nTypedArray.length(view) == 3\n```\n"}, - "sortText": "length", + "documentation": { + "kind": "markdown", + "value": "\n`length(typedArray)` returns the number of elements.\n\nSee [`TypedArray.prototype.length`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/length) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nTypedArray.length(view) == 3\n```\n" + }, "insertText": "->TypedArray.length", - "additionalTextEdits": [{ - "range": {"start": {"line": 41, "character": 20}, "end": {"line": 41, "character": 21}}, - "newText": "" - }] - }, { - "label": "->TypedArray.indexOf", "kind": 12, - "tags": [], + "label": "->TypedArray.length", + "sortText": "length", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 21, "line": 41 }, + "start": { "character": 20, "line": 41 } + } + } + ], "detail": "(t<'a>, 'a) => int", - "documentation": {"kind": "markdown", "value": "\n`indexOf(typedArray, value)` returns the first index of `value`, or `-1` when not found.\n\nSee [`TypedArray.prototype.indexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/indexOf) on MDN.\n"}, - "sortText": "indexOf", + "documentation": { + "kind": "markdown", + "value": "\n`indexOf(typedArray, value)` returns the first index of `value`, or `-1` when not found.\n\nSee [`TypedArray.prototype.indexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/indexOf) on MDN.\n" + }, "insertText": "->TypedArray.indexOf", - "additionalTextEdits": [{ - "range": {"start": {"line": 41, "character": 20}, "end": {"line": 41, "character": 21}}, - "newText": "" - }] - }, { - "label": "->TypedArray.copyWithinToEnd", "kind": 12, - "tags": [1], + "label": "->TypedArray.indexOf", + "sortText": "indexOf", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 21, "line": 41 }, + "start": { "character": 20, "line": 41 } + } + } + ], + "deprecated": true, "detail": "(t<'a>, ~target: int, ~start: int) => array<'a>", - "documentation": {"kind": "markdown", "value": "Deprecated: Use `copyWithin` instead\n\n\n`copyWithinToEnd(typedArray, ~target, ~start)` copies values from `start` through the end of the view into the range beginning at `target`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.copyWithin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/copyWithin) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3, 4])\nlet _ = TypedArray.copyWithinToEnd(view, ~target=0, ~start=2)\nTypedArray.toString(view) == \"3,4,3,4\"\n```\n"}, - "sortText": "copyWithinToEnd", + "documentation": { + "kind": "markdown", + "value": "Deprecated: Use `copyWithin` instead\n\n\n`copyWithinToEnd(typedArray, ~target, ~start)` copies values from `start` through the end of the view into the range beginning at `target`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.copyWithin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/copyWithin) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3, 4])\nlet _ = TypedArray.copyWithinToEnd(view, ~target=0, ~start=2)\nTypedArray.toString(view) == \"3,4,3,4\"\n```\n" + }, "insertText": "->TypedArray.copyWithinToEnd", - "additionalTextEdits": [{ - "range": {"start": {"line": 41, "character": 20}, "end": {"line": 41, "character": 21}}, - "newText": "" - }] - }, { - "label": "->TypedArray.some", "kind": 12, - "tags": [], + "label": "->TypedArray.copyWithinToEnd", + "sortText": "copyWithinToEnd", + "tags": [ 1 ] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 21, "line": 41 }, + "start": { "character": 20, "line": 41 } + } + } + ], "detail": "(t<'a>, 'a => bool) => bool", - "documentation": {"kind": "markdown", "value": "\n`some(typedArray, predicate)` returns `true` if `predicate` returns `true` for at least one element.\n\nSee [`TypedArray.prototype.some`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/some) on MDN.\n"}, - "sortText": "some", + "documentation": { + "kind": "markdown", + "value": "\n`some(typedArray, predicate)` returns `true` if `predicate` returns `true` for at least one element.\n\nSee [`TypedArray.prototype.some`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/some) on MDN.\n" + }, "insertText": "->TypedArray.some", - "additionalTextEdits": [{ - "range": {"start": {"line": 41, "character": 20}, "end": {"line": 41, "character": 21}}, - "newText": "" - }] - }, { - "label": "->TypedArray.reduceWithIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.some", + "sortText": "some", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 21, "line": 41 }, + "start": { "character": 20, "line": 41 } + } + } + ], "detail": "(t<'a>, ('b, 'a, int) => 'b, 'b) => 'b", - "documentation": {"kind": "markdown", "value": "\n`reduceWithIndex(typedArray, reducer, initial)` is the indexed variant of `reduce`.\n"}, - "sortText": "reduceWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`reduceWithIndex(typedArray, reducer, initial)` is the indexed variant of `reduce`.\n" + }, "insertText": "->TypedArray.reduceWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 41, "character": 20}, "end": {"line": 41, "character": 21}}, - "newText": "" - }] - }, { - "label": "->TypedArray.map", "kind": 12, - "tags": [], + "label": "->TypedArray.reduceWithIndex", + "sortText": "reduceWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 21, "line": 41 }, + "start": { "character": 20, "line": 41 } + } + } + ], "detail": "(t<'a>, 'a => 'b) => t<'b>", - "documentation": {"kind": "markdown", "value": "\n`map(typedArray, f)` returns a new typed array whose elements are produced by applying `f` to each element.\n\nSee [`TypedArray.prototype.map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/map) on MDN.\n"}, - "sortText": "map", + "documentation": { + "kind": "markdown", + "value": "\n`map(typedArray, f)` returns a new typed array whose elements are produced by applying `f` to each element.\n\nSee [`TypedArray.prototype.map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/map) on MDN.\n" + }, "insertText": "->TypedArray.map", - "additionalTextEdits": [{ - "range": {"start": {"line": 41, "character": 20}, "end": {"line": 41, "character": 21}}, - "newText": "" - }] - }, { - "label": "->TypedArray.toSorted", "kind": 12, - "tags": [], + "label": "->TypedArray.map", + "sortText": "map", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 21, "line": 41 }, + "start": { "character": 20, "line": 41 } + } + } + ], "detail": "(t<'a>, ('a, 'a) => Ordering.t) => t<'a>", - "documentation": {"kind": "markdown", "value": "\n`toSorted(typedArray, comparator)` returns a new typed array containing the sorted values, leaving the original untouched.\n\nSee [`TypedArray.prototype.toSorted`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/toSorted) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([3, 1, 2])\nlet sorted = TypedArray.toSorted(view, Int.compare)\nTypedArray.toString(sorted) == \"1,2,3\"\nTypedArray.toString(view) == \"3,1,2\"\n```\n"}, - "sortText": "toSorted", + "documentation": { + "kind": "markdown", + "value": "\n`toSorted(typedArray, comparator)` returns a new typed array containing the sorted values, leaving the original untouched.\n\nSee [`TypedArray.prototype.toSorted`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/toSorted) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([3, 1, 2])\nlet sorted = TypedArray.toSorted(view, Int.compare)\nTypedArray.toString(sorted) == \"1,2,3\"\nTypedArray.toString(view) == \"3,1,2\"\n```\n" + }, "insertText": "->TypedArray.toSorted", - "additionalTextEdits": [{ - "range": {"start": {"line": 41, "character": 20}, "end": {"line": 41, "character": 21}}, - "newText": "" - }] - }, { - "label": "->TypedArray.copyAllWithin", "kind": 12, - "tags": [], + "label": "->TypedArray.toSorted", + "sortText": "toSorted", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 21, "line": 41 }, + "start": { "character": 20, "line": 41 } + } + } + ], "detail": "(t<'a>, ~target: int) => array<'a>", - "documentation": {"kind": "markdown", "value": "\n`copyAllWithin(typedArray, ~target)` copies values starting at index `0` over the positions beginning at `target`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.copyWithin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/copyWithin) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([10, 20, 30])\nlet _ = TypedArray.copyAllWithin(view, ~target=1)\nTypedArray.toString(view) == \"10,10,20\"\n```\n"}, - "sortText": "copyAllWithin", + "documentation": { + "kind": "markdown", + "value": "\n`copyAllWithin(typedArray, ~target)` copies values starting at index `0` over the positions beginning at `target`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.copyWithin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/copyWithin) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([10, 20, 30])\nlet _ = TypedArray.copyAllWithin(view, ~target=1)\nTypedArray.toString(view) == \"10,10,20\"\n```\n" + }, "insertText": "->TypedArray.copyAllWithin", - "additionalTextEdits": [{ - "range": {"start": {"line": 41, "character": 20}, "end": {"line": 41, "character": 21}}, - "newText": "" - }] - }, { - "label": "->TypedArray.subarray", "kind": 12, - "tags": [], + "label": "->TypedArray.copyAllWithin", + "sortText": "copyAllWithin", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 21, "line": 41 }, + "start": { "character": 20, "line": 41 } + } + } + ], "detail": "(t<'a>, ~start: int, ~end: int=?) => t<'a>", - "documentation": {"kind": "markdown", "value": "\n`subarray(typedArray, ~start, ~end)` returns a new view referencing the same buffer over `[start, end)`.\n\nSee [`TypedArray.prototype.subarray`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/subarray) on MDN.\n"}, - "sortText": "subarray", + "documentation": { + "kind": "markdown", + "value": "\n`subarray(typedArray, ~start, ~end)` returns a new view referencing the same buffer over `[start, end)`.\n\nSee [`TypedArray.prototype.subarray`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/subarray) on MDN.\n" + }, "insertText": "->TypedArray.subarray", - "additionalTextEdits": [{ - "range": {"start": {"line": 41, "character": 20}, "end": {"line": 41, "character": 21}}, - "newText": "" - }] - }, { - "label": "->TypedArray.setArray", "kind": 12, - "tags": [], + "label": "->TypedArray.subarray", + "sortText": "subarray", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 21, "line": 41 }, + "start": { "character": 20, "line": 41 } + } + } + ], "detail": "(t<'a>, array<'a>) => unit", - "documentation": {"kind": "markdown", "value": "\n`setArray(target, source)` copies the values from `source` into `target`, mutating it.\n\nSee [`TypedArray.prototype.set`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/set) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([0, 0])\nTypedArray.setArray(view, [1, 2])\nTypedArray.toString(view) == \"1,2\"\n```\n"}, - "sortText": "setArray", + "documentation": { + "kind": "markdown", + "value": "\n`setArray(target, source)` copies the values from `source` into `target`, mutating it.\n\nSee [`TypedArray.prototype.set`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/set) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([0, 0])\nTypedArray.setArray(view, [1, 2])\nTypedArray.toString(view) == \"1,2\"\n```\n" + }, "insertText": "->TypedArray.setArray", - "additionalTextEdits": [{ - "range": {"start": {"line": 41, "character": 20}, "end": {"line": 41, "character": 21}}, - "newText": "" - }] - }, { - "label": "->TypedArray.get", "kind": 12, - "tags": [], + "label": "->TypedArray.setArray", + "sortText": "setArray", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 21, "line": 41 }, + "start": { "character": 20, "line": 41 } + } + } + ], "detail": "(t<'a>, int) => option<'a>", - "documentation": {"kind": "markdown", "value": "\n`get(typedArray, index)` returns the element at `index` of `typedArray`.\nReturns `None` if the index does not exist in the typed array. Equivalent to doing `typedArray[index]` in JavaScript.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nTypedArray.get(view, 0) == Some(1)\nTypedArray.get(view, 10) == None\n```\n"}, - "sortText": "get", + "documentation": { + "kind": "markdown", + "value": "\n`get(typedArray, index)` returns the element at `index` of `typedArray`.\nReturns `None` if the index does not exist in the typed array. Equivalent to doing `typedArray[index]` in JavaScript.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nTypedArray.get(view, 0) == Some(1)\nTypedArray.get(view, 10) == None\n```\n" + }, "insertText": "->TypedArray.get", - "additionalTextEdits": [{ - "range": {"start": {"line": 41, "character": 20}, "end": {"line": 41, "character": 21}}, - "newText": "" - }] - }, { - "label": "->TypedArray.with", "kind": 12, - "tags": [], + "label": "->TypedArray.get", + "sortText": "get", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 21, "line": 41 }, + "start": { "character": 20, "line": 41 } + } + } + ], "detail": "(t<'a>, int, 'a) => t<'a>", - "documentation": {"kind": "markdown", "value": "\n`with(typedArray, index, value)` returns a new typed array where the element at `index` is replaced with `value`.\n\nSee [`TypedArray.prototype.with`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/with) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nlet updated = TypedArray.with(view, 1, 10)\nTypedArray.toString(updated) == \"1,10,3\"\nTypedArray.toString(view) == \"1,2,3\"\n```\n"}, - "sortText": "with", + "documentation": { + "kind": "markdown", + "value": "\n`with(typedArray, index, value)` returns a new typed array where the element at `index` is replaced with `value`.\n\nSee [`TypedArray.prototype.with`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/with) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nlet updated = TypedArray.with(view, 1, 10)\nTypedArray.toString(updated) == \"1,10,3\"\nTypedArray.toString(view) == \"1,2,3\"\n```\n" + }, "insertText": "->TypedArray.with", - "additionalTextEdits": [{ - "range": {"start": {"line": 41, "character": 20}, "end": {"line": 41, "character": 21}}, - "newText": "" - }] - }, { - "label": "->TypedArray.toReversed", "kind": 12, - "tags": [], + "label": "->TypedArray.with", + "sortText": "with", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 21, "line": 41 }, + "start": { "character": 20, "line": 41 } + } + } + ], "detail": "t<'a> => t<'a>", - "documentation": {"kind": "markdown", "value": "\n`toReversed(typedArray)` returns a new typed array with the elements in reverse order, leaving the original untouched.\n\nSee [`TypedArray.prototype.toReversed`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/toReversed) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nlet reversed = TypedArray.toReversed(view)\nTypedArray.toString(reversed) == \"3,2,1\"\nTypedArray.toString(view) == \"1,2,3\"\n```\n"}, - "sortText": "toReversed", + "documentation": { + "kind": "markdown", + "value": "\n`toReversed(typedArray)` returns a new typed array with the elements in reverse order, leaving the original untouched.\n\nSee [`TypedArray.prototype.toReversed`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/toReversed) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nlet reversed = TypedArray.toReversed(view)\nTypedArray.toString(reversed) == \"3,2,1\"\nTypedArray.toString(view) == \"1,2,3\"\n```\n" + }, "insertText": "->TypedArray.toReversed", - "additionalTextEdits": [{ - "range": {"start": {"line": 41, "character": 20}, "end": {"line": 41, "character": 21}}, - "newText": "" - }] - }, { - "label": "->TypedArray.copyWithin", "kind": 12, - "tags": [], + "label": "->TypedArray.toReversed", + "sortText": "toReversed", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 21, "line": 41 }, + "start": { "character": 20, "line": 41 } + } + } + ], "detail": "(t<'a>, ~target: int, ~start: int, ~end: int=?) => array<'a>", - "documentation": {"kind": "markdown", "value": "\n`copyWithin(typedArray, ~target, ~start, ~end)` copies the section `[start, end)` onto the range beginning at `target`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.copyWithin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/copyWithin) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3, 4])\nlet _ = TypedArray.copyWithin(view, ~target=1, ~start=2, ~end=4)\nTypedArray.toString(view) == \"1,3,4,4\"\n```\n"}, - "sortText": "copyWithin", + "documentation": { + "kind": "markdown", + "value": "\n`copyWithin(typedArray, ~target, ~start, ~end)` copies the section `[start, end)` onto the range beginning at `target`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.copyWithin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/copyWithin) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3, 4])\nlet _ = TypedArray.copyWithin(view, ~target=1, ~start=2, ~end=4)\nTypedArray.toString(view) == \"1,3,4,4\"\n```\n" + }, "insertText": "->TypedArray.copyWithin", - "additionalTextEdits": [{ - "range": {"start": {"line": 41, "character": 20}, "end": {"line": 41, "character": 21}}, - "newText": "" - }] - }, { - "label": "->TypedArray.everyWithIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.copyWithin", + "sortText": "copyWithin", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 21, "line": 41 }, + "start": { "character": 20, "line": 41 } + } + } + ], "detail": "(t<'a>, ('a, int) => bool) => bool", - "documentation": {"kind": "markdown", "value": "\n`everyWithIndex(typedArray, checker)` is like `every` but provides the element index to `checker`.\n"}, - "sortText": "everyWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`everyWithIndex(typedArray, checker)` is like `every` but provides the element index to `checker`.\n" + }, "insertText": "->TypedArray.everyWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 41, "character": 20}, "end": {"line": 41, "character": 21}}, - "newText": "" - }] - }, { - "label": "->TypedArray.toString", "kind": 12, - "tags": [], + "label": "->TypedArray.everyWithIndex", + "sortText": "everyWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 21, "line": 41 }, + "start": { "character": 20, "line": 41 } + } + } + ], "detail": "t<'a> => string", - "documentation": {"kind": "markdown", "value": "\n`toString(typedArray)` returns a comma-separated string of the elements.\n\nSee [`TypedArray.prototype.toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/toString) on MDN.\n\n## Examples\n\n```rescript\nInt32Array.fromArray([1, 2])->TypedArray.toString == \"1,2\"\n```\n"}, - "sortText": "toString", + "documentation": { + "kind": "markdown", + "value": "\n`toString(typedArray)` returns a comma-separated string of the elements.\n\nSee [`TypedArray.prototype.toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/toString) on MDN.\n\n## Examples\n\n```rescript\nInt32Array.fromArray([1, 2])->TypedArray.toString == \"1,2\"\n```\n" + }, "insertText": "->TypedArray.toString", - "additionalTextEdits": [{ - "range": {"start": {"line": 41, "character": 20}, "end": {"line": 41, "character": 21}}, - "newText": "" - }] - }, { - "label": "->TypedArray.setArrayFrom", "kind": 12, - "tags": [], + "label": "->TypedArray.toString", + "sortText": "toString", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 21, "line": 41 }, + "start": { "character": 20, "line": 41 } + } + } + ], "detail": "(t<'a>, array<'a>, int) => unit", - "documentation": {"kind": "markdown", "value": "\n`setArrayFrom(target, source, index)` copies `source` into `target` starting at `index`.\n\nSee [`TypedArray.prototype.set`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/set) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([0, 0, 0])\nTypedArray.setArrayFrom(view, [5, 6], 1)\nTypedArray.toString(view) == \"0,5,6\"\n```\n"}, - "sortText": "setArrayFrom", + "documentation": { + "kind": "markdown", + "value": "\n`setArrayFrom(target, source, index)` copies `source` into `target` starting at `index`.\n\nSee [`TypedArray.prototype.set`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/set) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([0, 0, 0])\nTypedArray.setArrayFrom(view, [5, 6], 1)\nTypedArray.toString(view) == \"0,5,6\"\n```\n" + }, "insertText": "->TypedArray.setArrayFrom", - "additionalTextEdits": [{ - "range": {"start": {"line": 41, "character": 20}, "end": {"line": 41, "character": 21}}, - "newText": "" - }] - }, { - "label": "->TypedArray.forEach", "kind": 12, - "tags": [], + "label": "->TypedArray.setArrayFrom", + "sortText": "setArrayFrom", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 21, "line": 41 }, + "start": { "character": 20, "line": 41 } + } + } + ], "detail": "(t<'a>, 'a => unit) => unit", - "documentation": {"kind": "markdown", "value": "\n`forEach(typedArray, f)` runs `f` for every element in order.\n\nSee [`TypedArray.prototype.forEach`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/forEach) on MDN.\n"}, - "sortText": "forEach", + "documentation": { + "kind": "markdown", + "value": "\n`forEach(typedArray, f)` runs `f` for every element in order.\n\nSee [`TypedArray.prototype.forEach`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/forEach) on MDN.\n" + }, "insertText": "->TypedArray.forEach", - "additionalTextEdits": [{ - "range": {"start": {"line": 41, "character": 20}, "end": {"line": 41, "character": 21}}, - "newText": "" - }] - }, { - "label": "->TypedArray.findWithIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.forEach", + "sortText": "forEach", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 21, "line": 41 }, + "start": { "character": 20, "line": 41 } + } + } + ], "detail": "(t<'a>, ('a, int) => bool) => option<'a>", - "documentation": {"kind": "markdown", "value": "\n`findWithIndex(typedArray, predicate)` behaves like `find`, but `predicate` also receives the index.\n"}, - "sortText": "findWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`findWithIndex(typedArray, predicate)` behaves like `find`, but `predicate` also receives the index.\n" + }, "insertText": "->TypedArray.findWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 41, "character": 20}, "end": {"line": 41, "character": 21}}, - "newText": "" - }] - }, { - "label": "->TypedArray.fill", "kind": 12, - "tags": [], + "label": "->TypedArray.findWithIndex", + "sortText": "findWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 21, "line": 41 }, + "start": { "character": 20, "line": 41 } + } + } + ], "detail": "(t<'a>, 'a, ~start: int, ~end: int=?) => t<'a>", - "documentation": {"kind": "markdown", "value": "\n`fill(typedArray, value, ~start, ~end)` fills the half-open interval `[start, end)` with `value`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.fill`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/fill) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3, 4])\nlet _ = TypedArray.fill(view, 0, ~start=1, ~end=3)\nTypedArray.toString(view) == \"1,0,0,4\"\n```\n"}, - "sortText": "fill", + "documentation": { + "kind": "markdown", + "value": "\n`fill(typedArray, value, ~start, ~end)` fills the half-open interval `[start, end)` with `value`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.fill`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/fill) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3, 4])\nlet _ = TypedArray.fill(view, 0, ~start=1, ~end=3)\nTypedArray.toString(view) == \"1,0,0,4\"\n```\n" + }, "insertText": "->TypedArray.fill", - "additionalTextEdits": [{ - "range": {"start": {"line": 41, "character": 20}, "end": {"line": 41, "character": 21}}, - "newText": "" - }] - }, { - "label": "->TypedArray.indexOfFrom", "kind": 12, - "tags": [], + "label": "->TypedArray.fill", + "sortText": "fill", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 21, "line": 41 }, + "start": { "character": 20, "line": 41 } + } + } + ], "detail": "(t<'a>, 'a, int) => int", - "documentation": {"kind": "markdown", "value": "\n`indexOfFrom(typedArray, value, fromIndex)` searches for `value` starting at `fromIndex`.\n"}, - "sortText": "indexOfFrom", + "documentation": { + "kind": "markdown", + "value": "\n`indexOfFrom(typedArray, value, fromIndex)` searches for `value` starting at `fromIndex`.\n" + }, "insertText": "->TypedArray.indexOfFrom", - "additionalTextEdits": [{ - "range": {"start": {"line": 41, "character": 20}, "end": {"line": 41, "character": 21}}, - "newText": "" - }] - }, { - "label": "->TypedArray.reverse", "kind": 12, - "tags": [], + "label": "->TypedArray.indexOfFrom", + "sortText": "indexOfFrom", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 21, "line": 41 }, + "start": { "character": 20, "line": 41 } + } + } + ], "detail": "t<'a> => unit", - "documentation": {"kind": "markdown", "value": "\n`reverse(typedArray)` reverses the elements of the view in place.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.reverse`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/reverse) on MDN.\n"}, - "sortText": "reverse", + "documentation": { + "kind": "markdown", + "value": "\n`reverse(typedArray)` reverses the elements of the view in place.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.reverse`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/reverse) on MDN.\n" + }, "insertText": "->TypedArray.reverse", - "additionalTextEdits": [{ - "range": {"start": {"line": 41, "character": 20}, "end": {"line": 41, "character": 21}}, - "newText": "" - }] - }, { - "label": "->TypedArray.byteOffset", "kind": 12, - "tags": [], + "label": "->TypedArray.reverse", + "sortText": "reverse", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 21, "line": 41 }, + "start": { "character": 20, "line": 41 } + } + } + ], "detail": "t<'a> => int", - "documentation": {"kind": "markdown", "value": "\n`byteOffset(typedArray)` returns the offset in bytes from the start of the buffer.\n\nSee [`TypedArray.prototype.byteOffset`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/byteOffset) on MDN.\n"}, - "sortText": "byteOffset", + "documentation": { + "kind": "markdown", + "value": "\n`byteOffset(typedArray)` returns the offset in bytes from the start of the buffer.\n\nSee [`TypedArray.prototype.byteOffset`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/byteOffset) on MDN.\n" + }, "insertText": "->TypedArray.byteOffset", - "additionalTextEdits": [{ - "range": {"start": {"line": 41, "character": 20}, "end": {"line": 41, "character": 21}}, - "newText": "" - }] - }] + "kind": 12, + "label": "->TypedArray.byteOffset", + "sortText": "byteOffset", + "tags": [] + } +] diff --git a/tests/analysis_tests/tests/src/expected/Cross.res.txt b/tests/analysis_tests/tests/src/expected/Cross.res.txt index 9cbbdc6d998..24a89762cfd 100644 --- a/tests/analysis_tests/tests/src/expected/Cross.res.txt +++ b/tests/analysis_tests/tests/src/expected/Cross.res.txt @@ -1,97 +1,201 @@ References src/Cross.res 0:17 [ -{"uri": "Cross.res", "range": {"start": {"line": 0, "character": 15}, "end": {"line": 0, "character": 25}}}, -{"uri": "Cross.res", "range": {"start": {"line": 3, "character": 16}, "end": {"line": 3, "character": 26}}}, -{"uri": "Cross.res", "range": {"start": {"line": 5, "character": 13}, "end": {"line": 5, "character": 23}}}, -{"uri": "Cross.res", "range": {"start": {"line": 7, "character": 16}, "end": {"line": 7, "character": 26}}}, -{"uri": "References.res", "range": {"start": {"line": 0, "character": 0}, "end": {"line": 0, "character": 0}}} + { + "range": { + "end": { "character": 25, "line": 0 }, + "start": { "character": 15, "line": 0 } + }, + "uri": "file:///Cross.res" + }, + { + "range": { + "end": { "character": 26, "line": 3 }, + "start": { "character": 16, "line": 3 } + }, + "uri": "file:///Cross.res" + }, + { + "range": { + "end": { "character": 23, "line": 5 }, + "start": { "character": 13, "line": 5 } + }, + "uri": "file:///Cross.res" + }, + { + "range": { + "end": { "character": 26, "line": 7 }, + "start": { "character": 16, "line": 7 } + }, + "uri": "file:///Cross.res" + }, + { + "range": { + "end": { "character": 0, "line": 0 }, + "start": { "character": 0, "line": 0 } + }, + "uri": "file:///References.res" + } ] References src/Cross.res 9:31 [ -{"uri": "Cross.res", "range": {"start": {"line": 9, "character": 28}, "end": {"line": 9, "character": 51}}}, -{"uri": "Cross.res", "range": {"start": {"line": 12, "character": 29}, "end": {"line": 12, "character": 52}}}, -{"uri": "Cross.res", "range": {"start": {"line": 14, "character": 26}, "end": {"line": 14, "character": 49}}}, -{"uri": "Cross.res", "range": {"start": {"line": 16, "character": 29}, "end": {"line": 16, "character": 52}}}, -{"uri": "ReferencesWithInterface.res", "range": {"start": {"line": 0, "character": 0}, "end": {"line": 0, "character": 0}}}, -{"uri": "ReferencesWithInterface.resi", "range": {"start": {"line": 0, "character": 0}, "end": {"line": 0, "character": 0}}} + { + "range": { + "end": { "character": 51, "line": 9 }, + "start": { "character": 28, "line": 9 } + }, + "uri": "file:///Cross.res" + }, + { + "range": { + "end": { "character": 52, "line": 12 }, + "start": { "character": 29, "line": 12 } + }, + "uri": "file:///Cross.res" + }, + { + "range": { + "end": { "character": 49, "line": 14 }, + "start": { "character": 26, "line": 14 } + }, + "uri": "file:///Cross.res" + }, + { + "range": { + "end": { "character": 52, "line": 16 }, + "start": { "character": 29, "line": 16 } + }, + "uri": "file:///Cross.res" + }, + { + "range": { + "end": { "character": 0, "line": 0 }, + "start": { "character": 0, "line": 0 } + }, + "uri": "file:///ReferencesWithInterface.res" + }, + { + "range": { + "end": { "character": 0, "line": 0 }, + "start": { "character": 0, "line": 0 } + }, + "uri": "file:///ReferencesWithInterface.resi" + } ] Rename src/Cross.res 18:13 RenameWithInterfacePrime [ -{ - "kind": "rename", - "oldUri": "RenameWithInterface.resi", - "newUri": "RenameWithInterfacePrime.resi" -}, -{ - "kind": "rename", - "oldUri": "RenameWithInterface.res", - "newUri": "RenameWithInterfacePrime.res" -}, -{ - "textDocument": { - "version": null, - "uri": "Cross.res" - }, - "edits": [{ - "range": {"start": {"line": 18, "character": 8}, "end": {"line": 18, "character": 27}}, - "newText": "RenameWithInterfacePrime" - }, { - "range": {"start": {"line": 21, "character": 8}, "end": {"line": 21, "character": 27}}, - "newText": "RenameWithInterfacePrime" - }] + { + "kind": "rename", + "newUri": "file:///RenameWithInterfacePrime.resi", + "oldUri": "file:///RenameWithInterface.resi" + }, + { + "kind": "rename", + "newUri": "file:///RenameWithInterfacePrime.res", + "oldUri": "file:///RenameWithInterface.res" + }, + { + "edits": [ + { + "newText": "RenameWithInterfacePrime", + "range": { + "end": { "character": 27, "line": 18 }, + "start": { "character": 8, "line": 18 } + } + }, + { + "newText": "RenameWithInterfacePrime", + "range": { + "end": { "character": 27, "line": 21 }, + "start": { "character": 8, "line": 21 } + } + } + ], + "textDocument": { "uri": "file:///Cross.res", "version": 0 } } ] Rename src/Cross.res 21:28 xPrime [ -{ - "textDocument": { - "version": null, - "uri": "RenameWithInterface.resi" - }, - "edits": [{ - "range": {"start": {"line": 0, "character": 4}, "end": {"line": 0, "character": 5}}, - "newText": "xPrime" - }] - }, -{ - "textDocument": { - "version": null, - "uri": "RenameWithInterface.res" + { + "edits": [ + { + "newText": "xPrime", + "range": { + "end": { "character": 5, "line": 0 }, + "start": { "character": 4, "line": 0 } + } + }, + { + "newText": "xPrime", + "range": { + "end": { "character": 5, "line": 0 }, + "start": { "character": 4, "line": 0 } + } + } + ], + "textDocument": { + "uri": "file:///RenameWithInterface.resi", + "version": 0 + } }, - "edits": [{ - "range": {"start": {"line": 0, "character": 4}, "end": {"line": 0, "character": 5}}, - "newText": "xPrime" - }] - }, -{ - "textDocument": { - "version": null, - "uri": "Cross.res" - }, - "edits": [{ - "range": {"start": {"line": 18, "character": 28}, "end": {"line": 18, "character": 29}}, - "newText": "xPrime" - }, { - "range": {"start": {"line": 21, "character": 28}, "end": {"line": 21, "character": 29}}, - "newText": "xPrime" - }] + { + "edits": [ + { + "newText": "xPrime", + "range": { + "end": { "character": 29, "line": 18 }, + "start": { "character": 28, "line": 18 } + } + }, + { + "newText": "xPrime", + "range": { + "end": { "character": 29, "line": 21 }, + "start": { "character": 28, "line": 21 } + } + } + ], + "textDocument": { "uri": "file:///Cross.res", "version": 0 } } ] TypeDefinition src/Cross.res 24:5 -{"uri": "TypeDefinition.res", "range": {"start": {"line": 2, "character": 0}, "end": {"line": 2, "character": 28}}} +{ + "range": { + "end": { "character": 28, "line": 2 }, + "start": { "character": 0, "line": 2 } + }, + "uri": "file:///TypeDefinition.res" +} Definition src/Cross.res 27:32 -{"uri": "DefinitionWithInterface.res", "range": {"start": {"line": 0, "character": 4}, "end": {"line": 0, "character": 5}}} +{ + "range": { + "end": { "character": 5, "line": 0 }, + "start": { "character": 4, "line": 0 } + }, + "uri": "file:///DefinitionWithInterface.resi" +} Definition src/Cross.res 30:36 -{"uri": "DefinitionWithInterface.res", "range": {"start": {"line": 3, "character": 5}, "end": {"line": 3, "character": 6}}} +{ + "range": { + "end": { "character": 6, "line": 3 }, + "start": { "character": 5, "line": 3 } + }, + "uri": "file:///DefinitionWithInterface.resi" +} TypeDefinition src/Cross.res 33:37 -{"uri": "DefinitionWithInterface.resi", "range": {"start": {"line": 3, "character": 0}, "end": {"line": 3, "character": 6}}} +{ + "range": { + "end": { "character": 6, "line": 3 }, + "start": { "character": 0, "line": 3 } + }, + "uri": "file:///DefinitionWithInterface.resi" +} Complete src/Cross.res 36:28 posCursor:[36:28] posNoWhite:[36:27] Found expr:[36:3->36:28] @@ -104,5 +208,11 @@ Path DefinitionWithInterface.a [] Definition src/Cross.res 39:39 -{"uri": "DefinitionWithInterface.res", "range": {"start": {"line": 9, "character": 6}, "end": {"line": 9, "character": 7}}} +{ + "range": { + "end": { "character": 12, "line": 6 }, + "start": { "character": 2, "line": 6 } + }, + "uri": "file:///DefinitionWithInterface.resi" +} diff --git a/tests/analysis_tests/tests/src/expected/Debug.res.txt b/tests/analysis_tests/tests/src/expected/Debug.res.txt index 3c94d138aaa..53064946e9a 100644 --- a/tests/analysis_tests/tests/src/expected/Debug.res.txt +++ b/tests/analysis_tests/tests/src/expected/Debug.res.txt @@ -1,5 +1,11 @@ Definition src/Debug.res 2:27 -{"uri": "ShadowedBelt.res", "range": {"start": {"line": 1, "character": 6}, "end": {"line": 1, "character": 9}}} +{ + "range": { + "end": { "character": 9, "line": 1 }, + "start": { "character": 6, "line": 1 } + }, + "uri": "file:///ShadowedBelt.res" +} Complete src/Debug.res 11:8 posCursor:[11:8] posNoWhite:[11:7] Found expr:[11:5->11:8] @@ -10,18 +16,29 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 2 Stdlib Js ContextPath Value[eqN] Path eqN -[{ - "label": "eqNullable", - "kind": 12, - "tags": [1], +[ + { + "deprecated": true, "detail": "('a, nullable<'a>) => bool", - "documentation": {"kind": "markdown", "value": "Deprecated: Use `eqNullable` directly instead.\n\n"} - }, { - "label": "eqNull", + "documentation": { + "kind": "markdown", + "value": "Deprecated: Use `eqNullable` directly instead.\n\n" + }, "kind": 12, - "tags": [1], + "label": "eqNullable", + "tags": [ 1 ] + }, + { + "deprecated": true, "detail": "('a, null<'a>) => bool", - "documentation": {"kind": "markdown", "value": "Deprecated: Use `eqNull` directly instead.\n\n"} - }] + "documentation": { + "kind": "markdown", + "value": "Deprecated: Use `eqNull` directly instead.\n\n" + }, + "kind": 12, + "label": "eqNull", + "tags": [ 1 ] + } +] diff --git a/tests/analysis_tests/tests/src/expected/Definition.res.txt b/tests/analysis_tests/tests/src/expected/Definition.res.txt index 824f03e3c5d..ae0362539ca 100644 --- a/tests/analysis_tests/tests/src/expected/Definition.res.txt +++ b/tests/analysis_tests/tests/src/expected/Definition.res.txt @@ -1,18 +1,51 @@ Definition src/Definition.res 2:8 -{"uri": "Definition.res", "range": {"start": {"line": 0, "character": 4}, "end": {"line": 0, "character": 6}}} +{ + "range": { + "end": { "character": 6, "line": 0 }, + "start": { "character": 4, "line": 0 } + }, + "uri": "file:///Definition.res" +} Definition src/Definition.res 10:23 -{"uri": "Definition.res", "range": {"start": {"line": 6, "character": 7}, "end": {"line": 6, "character": 13}}} +{ + "range": { + "end": { "character": 13, "line": 6 }, + "start": { "character": 7, "line": 6 } + }, + "uri": "file:///Definition.res" +} Hover src/Definition.res 14:14 -{"contents": {"kind": "markdown", "value": "```rescript\n(list<'a>, 'a => 'b) => list<'b>\n```\n---\n\n`map(list, f)` returns a new list with `f` applied to each element of `list`.\n\n## Examples\n\n```rescript\nlist{1, 2}->List.map(x => x + 1) == list{2, 3}\n```\n"}} +{ + "contents": { + "kind": "markdown", + "value": "```rescript\n(list<'a>, 'a => 'b) => list<'b>\n```\n---\n\n`map(list, f)` returns a new list with `f` applied to each element of `list`.\n\n## Examples\n\n```rescript\nlist{1, 2}->List.map(x => x + 1) == list{2, 3}\n```\n" + } +} Hover src/Definition.res 18:14 -{"contents": {"kind": "markdown", "value": "```rescript\n('a => 'b, list<'a>) => list<'b>\n```"}} +{ + "contents": { + "kind": "markdown", + "value": "```rescript\n('a => 'b, list<'a>) => list<'b>\n```" + } +} Hover src/Definition.res 23:3 -{"contents": {"kind": "markdown", "value": "```rescript\n(int, int) => int\n```"}} +{ + "contents": { + "kind": "markdown", + "value": "```rescript\n(int, int) => int\n```" + } +} Definition src/Definition.res 26:3 -{"uri": "Definition.res", "range": {"start": {"line": 21, "character": 4}, "end": {"line": 21, "character": 13}}} +{ + "range": { + "end": { "character": 13, "line": 21 }, + "start": { "character": 4, "line": 21 } + }, + "uri": "file:///Definition.res" +} diff --git a/tests/analysis_tests/tests/src/expected/DefinitionWithInterface.res.txt b/tests/analysis_tests/tests/src/expected/DefinitionWithInterface.res.txt index f8d85032d22..fa6c727e3db 100644 --- a/tests/analysis_tests/tests/src/expected/DefinitionWithInterface.res.txt +++ b/tests/analysis_tests/tests/src/expected/DefinitionWithInterface.res.txt @@ -1,6 +1,18 @@ Definition src/DefinitionWithInterface.res 0:4 -{"uri": "DefinitionWithInterface.resi", "range": {"start": {"line": 0, "character": 4}, "end": {"line": 0, "character": 5}}} +{ + "range": { + "end": { "character": 5, "line": 0 }, + "start": { "character": 4, "line": 0 } + }, + "uri": "file:///DefinitionWithInterface.resi" +} Definition src/DefinitionWithInterface.res 9:6 -{"uri": "DefinitionWithInterface.resi", "range": {"start": {"line": 6, "character": 2}, "end": {"line": 6, "character": 12}}} +{ + "range": { + "end": { "character": 12, "line": 6 }, + "start": { "character": 2, "line": 6 } + }, + "uri": "file:///DefinitionWithInterface.resi" +} diff --git a/tests/analysis_tests/tests/src/expected/DefinitionWithInterface.resi.txt b/tests/analysis_tests/tests/src/expected/DefinitionWithInterface.resi.txt index 10bc343390a..e6f9264f2ce 100644 --- a/tests/analysis_tests/tests/src/expected/DefinitionWithInterface.resi.txt +++ b/tests/analysis_tests/tests/src/expected/DefinitionWithInterface.resi.txt @@ -1,6 +1,18 @@ Definition src/DefinitionWithInterface.resi 0:4 -{"uri": "DefinitionWithInterface.res", "range": {"start": {"line": 0, "character": 4}, "end": {"line": 0, "character": 5}}} +{ + "range": { + "end": { "character": 5, "line": 0 }, + "start": { "character": 4, "line": 0 } + }, + "uri": "file:///DefinitionWithInterface.resi" +} Definition src/DefinitionWithInterface.resi 6:6 -{"uri": "DefinitionWithInterface.res", "range": {"start": {"line": 9, "character": 6}, "end": {"line": 9, "character": 7}}} +{ + "range": { + "end": { "character": 12, "line": 6 }, + "start": { "character": 2, "line": 6 } + }, + "uri": "file:///DefinitionWithInterface.resi" +} diff --git a/tests/analysis_tests/tests/src/expected/Destructuring.res.txt b/tests/analysis_tests/tests/src/expected/Destructuring.res.txt index cd442729444..ef93ff42af2 100644 --- a/tests/analysis_tests/tests/src/expected/Destructuring.res.txt +++ b/tests/analysis_tests/tests/src/expected/Destructuring.res.txt @@ -5,13 +5,18 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Value[x] Path x -[{ - "label": "age", - "kind": 5, - "tags": [], +[ + { "detail": "int", - "documentation": {"kind": "markdown", "value": "```rescript\nage: int\n```\n\n```rescript\ntype x = {name: string, age: int}\n```"} - }] + "documentation": { + "kind": "markdown", + "value": "```rescript\nage: int\n```\n\n```rescript\ntype x = {name: string, age: int}\n```" + }, + "kind": 5, + "label": "age", + "tags": [] + } +] Complete src/Destructuring.res 7:8 posCursor:[7:8] posNoWhite:[7:7] Found pattern:[7:7->7:9] @@ -20,19 +25,28 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Value[x] Path x -[{ - "label": "name", - "kind": 5, - "tags": [], +[ + { "detail": "string", - "documentation": {"kind": "markdown", "value": "```rescript\nname: string\n```\n\n```rescript\ntype x = {name: string, age: int}\n```"} - }, { - "label": "age", + "documentation": { + "kind": "markdown", + "value": "```rescript\nname: string\n```\n\n```rescript\ntype x = {name: string, age: int}\n```" + }, "kind": 5, - "tags": [], + "label": "name", + "tags": [] + }, + { "detail": "int", - "documentation": {"kind": "markdown", "value": "```rescript\nage: int\n```\n\n```rescript\ntype x = {name: string, age: int}\n```"} - }] + "documentation": { + "kind": "markdown", + "value": "```rescript\nage: int\n```\n\n```rescript\ntype x = {name: string, age: int}\n```" + }, + "kind": 5, + "label": "age", + "tags": [] + } +] Complete src/Destructuring.res 11:13 posCursor:[11:13] posNoWhite:[11:11] Found expr:[10:8->14:1] @@ -43,13 +57,18 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Value[x] Path x -[{ - "label": "age", - "kind": 5, - "tags": [], +[ + { "detail": "int", - "documentation": {"kind": "markdown", "value": "```rescript\nage: int\n```\n\n```rescript\ntype x = {name: string, age: int}\n```"} - }] + "documentation": { + "kind": "markdown", + "value": "```rescript\nage: int\n```\n\n```rescript\ntype x = {name: string, age: int}\n```" + }, + "kind": 5, + "label": "age", + "tags": [] + } +] Complete src/Destructuring.res 17:10 posCursor:[17:10] posNoWhite:[17:9] Found expr:[16:9->20:1] @@ -60,19 +79,28 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Value[x] Path x -[{ - "label": "name", - "kind": 5, - "tags": [], +[ + { "detail": "string", - "documentation": {"kind": "markdown", "value": "```rescript\nname: string\n```\n\n```rescript\ntype x = {name: string, age: int}\n```"} - }, { - "label": "age", + "documentation": { + "kind": "markdown", + "value": "```rescript\nname: string\n```\n\n```rescript\ntype x = {name: string, age: int}\n```" + }, "kind": 5, - "tags": [], + "label": "name", + "tags": [] + }, + { "detail": "int", - "documentation": {"kind": "markdown", "value": "```rescript\nage: int\n```\n\n```rescript\ntype x = {name: string, age: int}\n```"} - }] + "documentation": { + "kind": "markdown", + "value": "```rescript\nage: int\n```\n\n```rescript\ntype x = {name: string, age: int}\n```" + }, + "kind": 5, + "label": "age", + "tags": [] + } +] Complete src/Destructuring.res 31:8 posCursor:[31:8] posNoWhite:[31:7] Found pattern:[31:7->31:9] @@ -81,17 +109,26 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Value[x] Path x -[{ - "label": "someField", - "kind": 5, - "tags": [], +[ + { "detail": "int", - "documentation": {"kind": "markdown", "value": "```rescript\nsomeField: int\n```\n\n```rescript\ntype recordWithOptField = {someField: int, someOptField: option}\n```"} - }, { - "label": "?someOptField", + "documentation": { + "kind": "markdown", + "value": "```rescript\nsomeField: int\n```\n\n```rescript\ntype recordWithOptField = {someField: int, someOptField: option}\n```" + }, "kind": 5, - "tags": [], + "label": "someField", + "tags": [] + }, + { "detail": "option", - "documentation": {"kind": "markdown", "value": "someOptField is an optional field, and needs to be destructured using '?'.\n\n```rescript\n?someOptField: option\n```\n\n```rescript\ntype recordWithOptField = {someField: int, someOptField: option}\n```"} - }] + "documentation": { + "kind": "markdown", + "value": "someOptField is an optional field, and needs to be destructured using '?'.\n\n```rescript\n?someOptField: option\n```\n\n```rescript\ntype recordWithOptField = {someField: int, someOptField: option}\n```" + }, + "kind": 5, + "label": "?someOptField", + "tags": [] + } +] diff --git a/tests/analysis_tests/tests/src/expected/Div.res.txt b/tests/analysis_tests/tests/src/expected/Div.res.txt index deb951ada87..bad98fff5d0 100644 --- a/tests/analysis_tests/tests/src/expected/Div.res.txt +++ b/tests/analysis_tests/tests/src/expected/Div.res.txt @@ -1,5 +1,5 @@ Hover src/Div.res 0:10 -{"contents": {"kind": "markdown", "value": "```rescript\nstring\n```"}} +{ "contents": { "kind": "markdown", "value": "```rescript\nstring\n```" } } Complete src/Div.res 3:17 posCursor:[3:17] posNoWhite:[3:16] Found expr:[3:3->3:17] @@ -9,11 +9,12 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib Path ReactDOM.domProps Path JsxDOM.domProps -[{ - "label": "dangerouslySetInnerHTML", - "kind": 4, - "tags": [], +[ + { "detail": "{\"__html\": string}", - "documentation": null - }] + "kind": 4, + "label": "dangerouslySetInnerHTML", + "tags": [] + } +] diff --git a/tests/analysis_tests/tests/src/expected/DocComments.res.txt b/tests/analysis_tests/tests/src/expected/DocComments.res.txt index 1f8ab304def..f9adbf2b358 100644 --- a/tests/analysis_tests/tests/src/expected/DocComments.res.txt +++ b/tests/analysis_tests/tests/src/expected/DocComments.res.txt @@ -1,15 +1,40 @@ Hover src/DocComments.res 9:9 -{"contents": {"kind": "markdown", "value": "```rescript\nint\n```\n---\n Doc comment with a triple-backquote example\\n \\n ```res example\\n let a = 10\\n /*\\n * stuff\\n */\\n ```\\n"}} +{ + "contents": { + "kind": "markdown", + "value": "```rescript\nint\n```\n---\n Doc comment with a triple-backquote example\\n \\n ```res example\\n let a = 10\\n /*\\n * stuff\\n */\\n ```\\n" + } +} Hover src/DocComments.res 22:6 -{"contents": {"kind": "markdown", "value": "```rescript\nint\n```\n---\n\n Doc comment with a triple-backquote example\n \n ```res example\n let a = 10\n /*\n * stuff\n */\n ```\n"}} +{ + "contents": { + "kind": "markdown", + "value": "```rescript\nint\n```\n---\n\n Doc comment with a triple-backquote example\n \n ```res example\n let a = 10\n /*\n * stuff\n */\n ```\n" + } +} Hover src/DocComments.res 33:9 -{"contents": {"kind": "markdown", "value": "```rescript\nint\n```\n---\n Doc comment with a triple-backquote example\\n \\n ```res example\\n let a = 10\\n let b = 20\\n ```\\n"}} +{ + "contents": { + "kind": "markdown", + "value": "```rescript\nint\n```\n---\n Doc comment with a triple-backquote example\\n \\n ```res example\\n let a = 10\\n let b = 20\\n ```\\n" + } +} Hover src/DocComments.res 44:6 -{"contents": {"kind": "markdown", "value": "```rescript\nint\n```\n---\n\n Doc comment with a triple-backquote example\n \n ```res example\n let a = 10\n let b = 20\n ```\n"}} +{ + "contents": { + "kind": "markdown", + "value": "```rescript\nint\n```\n---\n\n Doc comment with a triple-backquote example\n \n ```res example\n let a = 10\n let b = 20\n ```\n" + } +} Hover src/DocComments.res 48:5 -{"contents": {"kind": "markdown", "value": "```rescript\nint\n```\n---\nNew doc comment format"}} +{ + "contents": { + "kind": "markdown", + "value": "```rescript\nint\n```\n---\nNew doc comment format" + } +} diff --git a/tests/analysis_tests/tests/src/expected/DocumentSymbol.res.txt b/tests/analysis_tests/tests/src/expected/DocumentSymbol.res.txt index d103cf3956c..48eb87b68fb 100644 --- a/tests/analysis_tests/tests/src/expected/DocumentSymbol.res.txt +++ b/tests/analysis_tests/tests/src/expected/DocumentSymbol.res.txt @@ -1,105 +1,217 @@ DocumentSymbol src/DocumentSymbol.res [ -{ - "name": "MyList", - "kind": 2, - "range": {"start": {"line": 0, "character": 7}, "end": {"line": 0, "character": 25}}, - "selectionRange": {"start": {"line": 0, "character": 7}, "end": {"line": 0, "character": 25}} -}, -{ - "name": "Dep", - "kind": 2, - "range": {"start": {"line": 2, "character": 7}, "end": {"line": 7, "character": 1}}, - "selectionRange": {"start": {"line": 2, "character": 7}, "end": {"line": 7, "character": 1}}, - "children": [ { - "name": "customDouble", - "kind": 12, - "range": {"start": {"line": 6, "character": 2}, "end": {"line": 6, "character": 35}}, - "selectionRange": {"start": {"line": 6, "character": 2}, "end": {"line": 6, "character": 35}} - }] -}, -{ - "name": "Lib", - "kind": 2, - "range": {"start": {"line": 9, "character": 7}, "end": {"line": 12, "character": 1}}, - "selectionRange": {"start": {"line": 9, "character": 7}, "end": {"line": 12, "character": 1}}, - "children": [ - { - "name": "foo", - "kind": 12, - "range": {"start": {"line": 10, "character": 2}, "end": {"line": 10, "character": 54}}, - "selectionRange": {"start": {"line": 10, "character": 2}, "end": {"line": 10, "character": 54}} + "children": [], + "kind": 16, + "name": "zzz", + "range": { + "end": { "character": 12, "line": 31 }, + "start": { "character": 0, "line": 31 } + }, + "selectionRange": { + "end": { "character": 12, "line": 31 }, + "start": { "character": 0, "line": 31 } + } }, { - "name": "next", - "kind": 12, - "range": {"start": {"line": 11, "character": 2}, "end": {"line": 11, "character": 48}}, - "selectionRange": {"start": {"line": 11, "character": 2}, "end": {"line": 11, "character": 48}} - }] -}, -{ - "name": "op", - "kind": 13, - "range": {"start": {"line": 14, "character": 0}, "end": {"line": 14, "character": 16}}, - "selectionRange": {"start": {"line": 14, "character": 0}, "end": {"line": 14, "character": 16}} -}, -{ - "name": "ForAuto", - "kind": 2, - "range": {"start": {"line": 16, "character": 7}, "end": {"line": 20, "character": 1}}, - "selectionRange": {"start": {"line": 16, "character": 7}, "end": {"line": 20, "character": 1}}, - "children": [ + "children": [ + { + "children": [ + { + "children": [], + "kind": 12, + "name": "make", + "range": { + "end": { "character": 97, "line": 27 }, + "start": { "character": 4, "line": 26 } + }, + "selectionRange": { + "end": { "character": 97, "line": 27 }, + "start": { "character": 4, "line": 26 } + } + } + ], + "kind": 2, + "name": "Comp", + "range": { + "end": { "character": 3, "line": 28 }, + "start": { "character": 9, "line": 25 } + }, + "selectionRange": { + "end": { "character": 3, "line": 28 }, + "start": { "character": 9, "line": 25 } + } + } + ], + "kind": 2, + "name": "O", + "range": { + "end": { "character": 1, "line": 29 }, + "start": { "character": 7, "line": 24 } + }, + "selectionRange": { + "end": { "character": 1, "line": 29 }, + "start": { "character": 7, "line": 24 } + } + }, { - "name": "t", - "kind": 26, - "range": {"start": {"line": 17, "character": 2}, "end": {"line": 17, "character": 14}}, - "selectionRange": {"start": {"line": 17, "character": 2}, "end": {"line": 17, "character": 14}} + "children": [], + "kind": 16, + "name": "fa", + "range": { + "end": { "character": 22, "line": 22 }, + "start": { "character": 0, "line": 22 } + }, + "selectionRange": { + "end": { "character": 22, "line": 22 }, + "start": { "character": 0, "line": 22 } + } }, { - "name": "abc", - "kind": 12, - "range": {"start": {"line": 18, "character": 2}, "end": {"line": 18, "character": 32}}, - "selectionRange": {"start": {"line": 18, "character": 2}, "end": {"line": 18, "character": 32}} + "children": [ + { + "children": [], + "kind": 12, + "name": "abd", + "range": { + "end": { "character": 32, "line": 19 }, + "start": { "character": 2, "line": 19 } + }, + "selectionRange": { + "end": { "character": 32, "line": 19 }, + "start": { "character": 2, "line": 19 } + } + }, + { + "children": [], + "kind": 12, + "name": "abc", + "range": { + "end": { "character": 32, "line": 18 }, + "start": { "character": 2, "line": 18 } + }, + "selectionRange": { + "end": { "character": 32, "line": 18 }, + "start": { "character": 2, "line": 18 } + } + }, + { + "children": [], + "kind": 26, + "name": "t", + "range": { + "end": { "character": 14, "line": 17 }, + "start": { "character": 2, "line": 17 } + }, + "selectionRange": { + "end": { "character": 14, "line": 17 }, + "start": { "character": 2, "line": 17 } + } + } + ], + "kind": 2, + "name": "ForAuto", + "range": { + "end": { "character": 1, "line": 20 }, + "start": { "character": 7, "line": 16 } + }, + "selectionRange": { + "end": { "character": 1, "line": 20 }, + "start": { "character": 7, "line": 16 } + } }, { - "name": "abd", - "kind": 12, - "range": {"start": {"line": 19, "character": 2}, "end": {"line": 19, "character": 32}}, - "selectionRange": {"start": {"line": 19, "character": 2}, "end": {"line": 19, "character": 32}} - }] -}, -{ - "name": "fa", - "kind": 16, - "range": {"start": {"line": 22, "character": 0}, "end": {"line": 22, "character": 22}}, - "selectionRange": {"start": {"line": 22, "character": 0}, "end": {"line": 22, "character": 22}} -}, -{ - "name": "O", - "kind": 2, - "range": {"start": {"line": 24, "character": 7}, "end": {"line": 29, "character": 1}}, - "selectionRange": {"start": {"line": 24, "character": 7}, "end": {"line": 29, "character": 1}}, - "children": [ + "children": [], + "kind": 13, + "name": "op", + "range": { + "end": { "character": 16, "line": 14 }, + "start": { "character": 0, "line": 14 } + }, + "selectionRange": { + "end": { "character": 16, "line": 14 }, + "start": { "character": 0, "line": 14 } + } + }, { - "name": "Comp", + "children": [ + { + "children": [], + "kind": 12, + "name": "next", + "range": { + "end": { "character": 48, "line": 11 }, + "start": { "character": 2, "line": 11 } + }, + "selectionRange": { + "end": { "character": 48, "line": 11 }, + "start": { "character": 2, "line": 11 } + } + }, + { + "children": [], + "kind": 12, + "name": "foo", + "range": { + "end": { "character": 54, "line": 10 }, + "start": { "character": 2, "line": 10 } + }, + "selectionRange": { + "end": { "character": 54, "line": 10 }, + "start": { "character": 2, "line": 10 } + } + } + ], "kind": 2, - "range": {"start": {"line": 25, "character": 9}, "end": {"line": 28, "character": 3}}, - "selectionRange": {"start": {"line": 25, "character": 9}, "end": {"line": 28, "character": 3}}, + "name": "Lib", + "range": { + "end": { "character": 1, "line": 12 }, + "start": { "character": 7, "line": 9 } + }, + "selectionRange": { + "end": { "character": 1, "line": 12 }, + "start": { "character": 7, "line": 9 } + } + }, + { "children": [ - { - "name": "make", - "kind": 12, - "range": {"start": {"line": 26, "character": 4}, "end": {"line": 27, "character": 97}}, - "selectionRange": {"start": {"line": 26, "character": 4}, "end": {"line": 27, "character": 97}} - }] - }] -}, -{ - "name": "zzz", - "kind": 16, - "range": {"start": {"line": 31, "character": 0}, "end": {"line": 31, "character": 12}}, - "selectionRange": {"start": {"line": 31, "character": 0}, "end": {"line": 31, "character": 12}} -} + { + "children": [], + "kind": 12, + "name": "customDouble", + "range": { + "end": { "character": 35, "line": 6 }, + "start": { "character": 2, "line": 6 } + }, + "selectionRange": { + "end": { "character": 35, "line": 6 }, + "start": { "character": 2, "line": 6 } + } + } + ], + "kind": 2, + "name": "Dep", + "range": { + "end": { "character": 1, "line": 7 }, + "start": { "character": 7, "line": 2 } + }, + "selectionRange": { + "end": { "character": 1, "line": 7 }, + "start": { "character": 7, "line": 2 } + } + }, + { + "children": [], + "kind": 2, + "name": "MyList", + "range": { + "end": { "character": 25, "line": 0 }, + "start": { "character": 7, "line": 0 } + }, + "selectionRange": { + "end": { "character": 25, "line": 0 }, + "start": { "character": 7, "line": 0 } + } + } ] diff --git a/tests/analysis_tests/tests/src/expected/DotPipeCompleteFromCurrentModule.res.txt b/tests/analysis_tests/tests/src/expected/DotPipeCompleteFromCurrentModule.res.txt index 70f6773fec5..edf1be3fb1a 100644 --- a/tests/analysis_tests/tests/src/expected/DotPipeCompleteFromCurrentModule.res.txt +++ b/tests/analysis_tests/tests/src/expected/DotPipeCompleteFromCurrentModule.res.txt @@ -16,17 +16,23 @@ Path x CPPipe pathFromEnv:X found:true Path X. Path -[{ - "label": "->z", - "kind": 12, - "tags": [], +[ + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 13, "line": 10 }, + "start": { "character": 12, "line": 10 } + } + } + ], "detail": "X.t => string", - "documentation": null, - "sortText": "z", "insertText": "->z", - "additionalTextEdits": [{ - "range": {"start": {"line": 10, "character": 12}, "end": {"line": 10, "character": 13}}, - "newText": "" - }] - }] + "kind": 12, + "label": "->z", + "sortText": "z", + "tags": [] + } +] diff --git a/tests/analysis_tests/tests/src/expected/DotPipeCompletionSpec.res.txt b/tests/analysis_tests/tests/src/expected/DotPipeCompletionSpec.res.txt index c4f755efbc3..6e5b64bb4bf 100644 --- a/tests/analysis_tests/tests/src/expected/DotPipeCompletionSpec.res.txt +++ b/tests/analysis_tests/tests/src/expected/DotPipeCompletionSpec.res.txt @@ -13,37 +13,52 @@ Path n CPPipe pathFromEnv:SomeModule found:true Path SomeModule. Path -[{ - "label": "name", - "kind": 5, - "tags": [], +[ + { "detail": "string", - "documentation": {"kind": "markdown", "value": "```rescript\nname: string\n```\n\n```rescript\ntype t = {name: string}\n```"} - }, { - "label": "->SomeModule.withUnlabelledArgumentNotFirst", - "kind": 12, - "tags": [], + "documentation": { + "kind": "markdown", + "value": "```rescript\nname: string\n```\n\n```rescript\ntype t = {name: string}\n```" + }, + "kind": 5, + "label": "name", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 5, "line": 15 }, + "start": { "character": 4, "line": 15 } + } + } + ], "detail": "(~name: string=?, t) => unit", - "documentation": null, - "sortText": "withUnlabelledArgumentNotFirst", "insertText": "->SomeModule.withUnlabelledArgumentNotFirst", - "additionalTextEdits": [{ - "range": {"start": {"line": 15, "character": 4}, "end": {"line": 15, "character": 5}}, - "newText": "" - }] - }, { - "label": "->SomeModule.getName", "kind": 12, - "tags": [], + "label": "->SomeModule.withUnlabelledArgumentNotFirst", + "sortText": "withUnlabelledArgumentNotFirst", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 5, "line": 15 }, + "start": { "character": 4, "line": 15 } + } + } + ], "detail": "t => string", - "documentation": null, - "sortText": "getName", "insertText": "->SomeModule.getName", - "additionalTextEdits": [{ - "range": {"start": {"line": 15, "character": 4}, "end": {"line": 15, "character": 5}}, - "newText": "" - }] - }] + "kind": 12, + "label": "->SomeModule.getName", + "sortText": "getName", + "tags": [] + } +] Complete src/DotPipeCompletionSpec.res 44:6 posCursor:[44:6] posNoWhite:[44:5] Found expr:[44:3->44:6] @@ -62,85 +77,120 @@ Path SomeOtherModule. Path DotPipeCompletionSpec.CompleteFromThisToo. Path DotPipeCompletionSpec.SomeOtherModule. Path -[{ - "label": "nname", - "kind": 5, - "tags": [], +[ + { "detail": "string", - "documentation": {"kind": "markdown", "value": "```rescript\nnname: string\n```\n\n```rescript\ntype typeOutsideModule = {nname: string}\n```"} - }, { - "label": "->SomeOtherModule.getNName", - "kind": 12, - "tags": [], + "documentation": { + "kind": "markdown", + "value": "```rescript\nnname: string\n```\n\n```rescript\ntype typeOutsideModule = {nname: string}\n```" + }, + "kind": 5, + "label": "nname", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 6, "line": 44 }, + "start": { "character": 5, "line": 44 } + } + } + ], "detail": "t => string", - "documentation": null, - "sortText": "getNName", "insertText": "->SomeOtherModule.getNName", - "additionalTextEdits": [{ - "range": {"start": {"line": 44, "character": 5}, "end": {"line": 44, "character": 6}}, - "newText": "" - }] - }, { - "label": "->SomeOtherModule.getNName2", "kind": 12, - "tags": [], + "label": "->SomeOtherModule.getNName", + "sortText": "getNName", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 6, "line": 44 }, + "start": { "character": 5, "line": 44 } + } + } + ], "detail": "typeOutsideModule => string", - "documentation": null, - "sortText": "getNName2", "insertText": "->SomeOtherModule.getNName2", - "additionalTextEdits": [{ - "range": {"start": {"line": 44, "character": 5}, "end": {"line": 44, "character": 6}}, - "newText": "" - }] - }, { - "label": "->CompleteFromThisToo.a", "kind": 12, - "tags": [], + "label": "->SomeOtherModule.getNName2", + "sortText": "getNName2", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 6, "line": 44 }, + "start": { "character": 5, "line": 44 } + } + } + ], "detail": "typeOutsideModule => string", - "documentation": null, - "sortText": "a", "insertText": "->CompleteFromThisToo.a", - "additionalTextEdits": [{ - "range": {"start": {"line": 44, "character": 5}, "end": {"line": 44, "character": 6}}, - "newText": "" - }] - }, { - "label": "->SomeOtherModule.getNName", "kind": 12, - "tags": [], + "label": "->CompleteFromThisToo.a", + "sortText": "a", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 6, "line": 44 }, + "start": { "character": 5, "line": 44 } + } + } + ], "detail": "t => string", - "documentation": null, - "sortText": "getNName", "insertText": "->SomeOtherModule.getNName", - "additionalTextEdits": [{ - "range": {"start": {"line": 44, "character": 5}, "end": {"line": 44, "character": 6}}, - "newText": "" - }] - }, { - "label": "->SomeOtherModule.getNName2", "kind": 12, - "tags": [], + "label": "->SomeOtherModule.getNName", + "sortText": "getNName", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 6, "line": 44 }, + "start": { "character": 5, "line": 44 } + } + } + ], "detail": "typeOutsideModule => string", - "documentation": null, - "sortText": "getNName2", "insertText": "->SomeOtherModule.getNName2", - "additionalTextEdits": [{ - "range": {"start": {"line": 44, "character": 5}, "end": {"line": 44, "character": 6}}, - "newText": "" - }] - }, { - "label": "->doWithTypeOutsideModule", "kind": 12, - "tags": [], + "label": "->SomeOtherModule.getNName2", + "sortText": "getNName2", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 6, "line": 44 }, + "start": { "character": 5, "line": 44 } + } + } + ], "detail": "typeOutsideModule => string", - "documentation": null, - "sortText": "doWithTypeOutsideModule", "insertText": "->doWithTypeOutsideModule", - "additionalTextEdits": [{ - "range": {"start": {"line": 44, "character": 5}, "end": {"line": 44, "character": 6}}, - "newText": "" - }] - }] + "kind": 12, + "label": "->doWithTypeOutsideModule", + "sortText": "doWithTypeOutsideModule", + "tags": [] + } +] Complete src/DotPipeCompletionSpec.res 62:5 posCursor:[62:5] posNoWhite:[62:4] Found expr:[62:3->62:5] @@ -158,31 +208,42 @@ CPPipe pathFromEnv:A found:true Path A. Path B. Path -[{ - "label": "->A.withA", - "kind": 12, - "tags": [], +[ + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 5, "line": 62 }, + "start": { "character": 4, "line": 62 } + } + } + ], "detail": "a => unit", - "documentation": null, - "sortText": "withA", "insertText": "->A.withA", - "additionalTextEdits": [{ - "range": {"start": {"line": 62, "character": 4}, "end": {"line": 62, "character": 5}}, - "newText": "" - }] - }, { - "label": "->B.b", "kind": 12, - "tags": [], + "label": "->A.withA", + "sortText": "withA", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 5, "line": 62 }, + "start": { "character": 4, "line": 62 } + } + } + ], "detail": "A.a => int", - "documentation": null, - "sortText": "b", "insertText": "->B.b", - "additionalTextEdits": [{ - "range": {"start": {"line": 62, "character": 4}, "end": {"line": 62, "character": 5}}, - "newText": "" - }] - }] + "kind": 12, + "label": "->B.b", + "sortText": "b", + "tags": [] + } +] Complete src/DotPipeCompletionSpec.res 67:6 posCursor:[67:6] posNoWhite:[67:5] Found expr:[67:3->67:6] @@ -199,25 +260,35 @@ Path xx CPPipe pathFromEnv:CompletionFromModule.SomeModule found:false Path CompletionFromModule.SomeModule. Path -[{ - "label": "name", - "kind": 5, - "tags": [], +[ + { "detail": "string", - "documentation": {"kind": "markdown", "value": "```rescript\nname: string\n```\n\n```rescript\ntype t = {name: string}\n```"} - }, { - "label": "->CompletionFromModule.SomeModule.getName", - "kind": 12, - "tags": [], + "documentation": { + "kind": "markdown", + "value": "```rescript\nname: string\n```\n\n```rescript\ntype t = {name: string}\n```" + }, + "kind": 5, + "label": "name", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 6, "line": 67 }, + "start": { "character": 5, "line": 67 } + } + } + ], "detail": "t => string", - "documentation": null, - "sortText": "getName", "insertText": "->CompletionFromModule.SomeModule.getName", - "additionalTextEdits": [{ - "range": {"start": {"line": 67, "character": 5}, "end": {"line": 67, "character": 6}}, - "newText": "" - }] - }] + "kind": 12, + "label": "->CompletionFromModule.SomeModule.getName", + "sortText": "getName", + "tags": [] + } +] Complete src/DotPipeCompletionSpec.res 75:9 posCursor:[75:9] posNoWhite:[75:8] Found expr:[75:3->75:9] @@ -234,55 +305,93 @@ Path ffff Path Stdlib.Array.u Path ArrayUtils.u Path u -[{ - "label": "->Array.unshiftMany", - "kind": 12, - "tags": [], +[ + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 8, "line": 75 }, + "start": { "character": 7, "line": 75 } + } + } + ], "detail": "(array<'a>, array<'a>) => unit", - "documentation": {"kind": "markdown", "value": "\n`unshiftMany(array, itemsArray)` inserts many new items to the start of the array.\n\nBeware this will *mutate* the array.\n\nSee [`Array.push`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/unshift) on MDN.\n\n## Examples\n\n```rescript\nlet someArray = [\"hi\", \"hello\"]\nsomeArray->Array.unshiftMany([\"yay\", \"wehoo\"])\nsomeArray == [\"yay\", \"wehoo\", \"hi\", \"hello\"]\n```\n"}, - "sortText": "unshiftMany", + "documentation": { + "kind": "markdown", + "value": "\n`unshiftMany(array, itemsArray)` inserts many new items to the start of the array.\n\nBeware this will *mutate* the array.\n\nSee [`Array.push`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/unshift) on MDN.\n\n## Examples\n\n```rescript\nlet someArray = [\"hi\", \"hello\"]\nsomeArray->Array.unshiftMany([\"yay\", \"wehoo\"])\nsomeArray == [\"yay\", \"wehoo\", \"hi\", \"hello\"]\n```\n" + }, "insertText": "->Array.unshiftMany", - "additionalTextEdits": [{ - "range": {"start": {"line": 75, "character": 7}, "end": {"line": 75, "character": 8}}, - "newText": "" - }] - }, { - "label": "->Array.unshift", "kind": 12, - "tags": [], + "label": "->Array.unshiftMany", + "sortText": "unshiftMany", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 8, "line": 75 }, + "start": { "character": 7, "line": 75 } + } + } + ], "detail": "(array<'a>, 'a) => unit", - "documentation": {"kind": "markdown", "value": "\n`unshift(array, item)` inserts a new item at the start of the array.\n\nBeware this will *mutate* the array.\n\nSee [`Array.unshift`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/unshift) on MDN.\n\n## Examples\n\n```rescript\nlet someArray = [\"hi\", \"hello\"]\nsomeArray->Array.unshift(\"yay\")\nsomeArray == [\"yay\", \"hi\", \"hello\"]\n```\n"}, - "sortText": "unshift", + "documentation": { + "kind": "markdown", + "value": "\n`unshift(array, item)` inserts a new item at the start of the array.\n\nBeware this will *mutate* the array.\n\nSee [`Array.unshift`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/unshift) on MDN.\n\n## Examples\n\n```rescript\nlet someArray = [\"hi\", \"hello\"]\nsomeArray->Array.unshift(\"yay\")\nsomeArray == [\"yay\", \"hi\", \"hello\"]\n```\n" + }, "insertText": "->Array.unshift", - "additionalTextEdits": [{ - "range": {"start": {"line": 75, "character": 7}, "end": {"line": 75, "character": 8}}, - "newText": "" - }] - }, { - "label": "->Array.unsafe_get", "kind": 12, - "tags": [1], + "label": "->Array.unshift", + "sortText": "unshift", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 8, "line": 75 }, + "start": { "character": 7, "line": 75 } + } + } + ], + "deprecated": true, "detail": "(array<'a>, int) => 'a", - "documentation": {"kind": "markdown", "value": "Deprecated: Use getUnsafe instead. This will be removed in v13\n\n\n`unsafe_get(array, index)` returns the element at `index` of `array`.\n\nThis is _unsafe_, meaning it will return `undefined` value if `index` does not exist in `array`.\n\nUse `Array.unsafe_get` only when you are sure the `index` exists (i.e. when using for-loop).\n\n## Examples\n\n```rescript\nlet array = [1, 2, 3]\nfor index in 0 to array->Array.length - 1 {\n let value = array->Array.unsafe_get(index)\n Console.log(value)\n}\n```\n"}, - "sortText": "unsafe_get", + "documentation": { + "kind": "markdown", + "value": "Deprecated: Use getUnsafe instead. This will be removed in v13\n\n\n`unsafe_get(array, index)` returns the element at `index` of `array`.\n\nThis is _unsafe_, meaning it will return `undefined` value if `index` does not exist in `array`.\n\nUse `Array.unsafe_get` only when you are sure the `index` exists (i.e. when using for-loop).\n\n## Examples\n\n```rescript\nlet array = [1, 2, 3]\nfor index in 0 to array->Array.length - 1 {\n let value = array->Array.unsafe_get(index)\n Console.log(value)\n}\n```\n" + }, "insertText": "->Array.unsafe_get", - "additionalTextEdits": [{ - "range": {"start": {"line": 75, "character": 7}, "end": {"line": 75, "character": 8}}, - "newText": "" - }] - }, { - "label": "->Array.unzip", "kind": 12, - "tags": [], + "label": "->Array.unsafe_get", + "sortText": "unsafe_get", + "tags": [ 1 ] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 8, "line": 75 }, + "start": { "character": 7, "line": 75 } + } + } + ], "detail": "array<('a, 'b)> => (t<'a>, array<'b>)", - "documentation": {"kind": "markdown", "value": "\n`unzip(a)` takes an array of pairs and creates a pair of arrays. The first array\ncontains all the first items of the pairs; the second array contains all the\nsecond items.\n\n## Examples\n\n```rescript\nArray.unzip([(1, 2), (3, 4)]) == ([1, 3], [2, 4])\n\nArray.unzip([(1, 2), (3, 4), (5, 6), (7, 8)]) == ([1, 3, 5, 7], [2, 4, 6, 8])\n```\n"}, - "sortText": "unzip", + "documentation": { + "kind": "markdown", + "value": "\n`unzip(a)` takes an array of pairs and creates a pair of arrays. The first array\ncontains all the first items of the pairs; the second array contains all the\nsecond items.\n\n## Examples\n\n```rescript\nArray.unzip([(1, 2), (3, 4)]) == ([1, 3], [2, 4])\n\nArray.unzip([(1, 2), (3, 4), (5, 6), (7, 8)]) == ([1, 3, 5, 7], [2, 4, 6, 8])\n```\n" + }, "insertText": "->Array.unzip", - "additionalTextEdits": [{ - "range": {"start": {"line": 75, "character": 7}, "end": {"line": 75, "character": 8}}, - "newText": "" - }] - }] + "kind": 12, + "label": "->Array.unzip", + "sortText": "unzip", + "tags": [] + } +] Complete src/DotPipeCompletionSpec.res 80:7 posCursor:[80:7] posNoWhite:[80:6] Found expr:[80:3->80:7] @@ -300,61 +409,86 @@ CPPipe pathFromEnv: found:true Path DotPipeCompletionSpec. Path DotPipeCompletionSpec.SomeOtherModule. Path -[{ - "label": "nname", - "kind": 5, - "tags": [], +[ + { "detail": "string", - "documentation": {"kind": "markdown", "value": "```rescript\nnname: string\n```\n\n```rescript\ntype typeOutsideModule = {nname: string}\n```"} - }, { - "label": "->doWithTypeOutsideModule", - "kind": 12, - "tags": [], + "documentation": { + "kind": "markdown", + "value": "```rescript\nnname: string\n```\n\n```rescript\ntype typeOutsideModule = {nname: string}\n```" + }, + "kind": 5, + "label": "nname", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 7, "line": 80 }, + "start": { "character": 6, "line": 80 } + } + } + ], "detail": "typeOutsideModule => string", - "documentation": null, - "sortText": "doWithTypeOutsideModule", "insertText": "->doWithTypeOutsideModule", - "additionalTextEdits": [{ - "range": {"start": {"line": 80, "character": 6}, "end": {"line": 80, "character": 7}}, - "newText": "" - }] - }, { - "label": "->SomeOtherModule.getNName", "kind": 12, - "tags": [], + "label": "->doWithTypeOutsideModule", + "sortText": "doWithTypeOutsideModule", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 7, "line": 80 }, + "start": { "character": 6, "line": 80 } + } + } + ], "detail": "t => string", - "documentation": null, - "sortText": "getNName", "insertText": "->SomeOtherModule.getNName", - "additionalTextEdits": [{ - "range": {"start": {"line": 80, "character": 6}, "end": {"line": 80, "character": 7}}, - "newText": "" - }] - }, { - "label": "->SomeOtherModule.getNName2", "kind": 12, - "tags": [], + "label": "->SomeOtherModule.getNName", + "sortText": "getNName", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 7, "line": 80 }, + "start": { "character": 6, "line": 80 } + } + } + ], "detail": "typeOutsideModule => string", - "documentation": null, - "sortText": "getNName2", "insertText": "->SomeOtherModule.getNName2", - "additionalTextEdits": [{ - "range": {"start": {"line": 80, "character": 6}, "end": {"line": 80, "character": 7}}, - "newText": "" - }] - }, { - "label": "->doWithTypeOutsideModule", "kind": 12, - "tags": [], + "label": "->SomeOtherModule.getNName2", + "sortText": "getNName2", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 7, "line": 80 }, + "start": { "character": 6, "line": 80 } + } + } + ], "detail": "typeOutsideModule => string", - "documentation": null, - "sortText": "doWithTypeOutsideModule", "insertText": "->doWithTypeOutsideModule", - "additionalTextEdits": [{ - "range": {"start": {"line": 80, "character": 6}, "end": {"line": 80, "character": 7}}, - "newText": "" - }] - }] + "kind": 12, + "label": "->doWithTypeOutsideModule", + "sortText": "doWithTypeOutsideModule", + "tags": [] + } +] Complete src/DotPipeCompletionSpec.res 86:39 posCursor:[86:39] posNoWhite:[86:38] Found expr:[86:3->86:39] @@ -374,55 +508,92 @@ Path Array.filter Path Stdlib.Array.filt Path ArrayUtils.filt Path filt -[{ - "label": "->Array.filterMap", - "kind": 12, - "tags": [], +[ + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 35, "line": 86 }, + "start": { "character": 34, "line": 86 } + } + } + ], "detail": "(array<'a>, 'a => option<'b>) => array<'b>", - "documentation": {"kind": "markdown", "value": "\n`filterMap(array, fn)`\n\nCalls `fn` for each element and returns a new array containing results of the `fn` calls which are not `None`.\n\n## Examples\n\n```rescript\n[\"Hello\", \"Hi\", \"Good bye\"]->Array.filterMap(item =>\n switch item {\n | \"Hello\" => Some(item->String.length)\n | _ => None\n }\n) == [5]\n\n[1, 2, 3, 4, 5, 6]->Array.filterMap(n => mod(n, 2) == 0 ? Some(n * n) : None) == [4, 16, 36]\n\nArray.filterMap([1, 2, 3, 4, 5, 6], _ => None) == []\n\nArray.filterMap([], n => mod(n, 2) == 0 ? Some(n * n) : None) == []\n```\n"}, - "sortText": "filterMap", + "documentation": { + "kind": "markdown", + "value": "\n`filterMap(array, fn)`\n\nCalls `fn` for each element and returns a new array containing results of the `fn` calls which are not `None`.\n\n## Examples\n\n```rescript\n[\"Hello\", \"Hi\", \"Good bye\"]->Array.filterMap(item =>\n switch item {\n | \"Hello\" => Some(item->String.length)\n | _ => None\n }\n) == [5]\n\n[1, 2, 3, 4, 5, 6]->Array.filterMap(n => mod(n, 2) == 0 ? Some(n * n) : None) == [4, 16, 36]\n\nArray.filterMap([1, 2, 3, 4, 5, 6], _ => None) == []\n\nArray.filterMap([], n => mod(n, 2) == 0 ? Some(n * n) : None) == []\n```\n" + }, "insertText": "->Array.filterMap", - "additionalTextEdits": [{ - "range": {"start": {"line": 86, "character": 34}, "end": {"line": 86, "character": 35}}, - "newText": "" - }] - }, { - "label": "->Array.filterMapWithIndex", "kind": 12, - "tags": [], + "label": "->Array.filterMap", + "sortText": "filterMap", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 35, "line": 86 }, + "start": { "character": 34, "line": 86 } + } + } + ], "detail": "(array<'a>, ('a, int) => option<'b>) => array<'b>", - "documentation": {"kind": "markdown", "value": "\n`filterMapWithIndex(array, fn)`\n\nCalls `fn` for each element and returns a new array containing results of the `fn` calls which are not `None`.\n\n## Examples\n\n```rescript\n[\"Hello\", \"Hi\", \"Good bye\"]->Array.filterMapWithIndex((item, index) =>\n switch item {\n | \"Hello\" => Some(index)\n | _ => None\n }\n) == [0]\n```\n"}, - "sortText": "filterMapWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`filterMapWithIndex(array, fn)`\n\nCalls `fn` for each element and returns a new array containing results of the `fn` calls which are not `None`.\n\n## Examples\n\n```rescript\n[\"Hello\", \"Hi\", \"Good bye\"]->Array.filterMapWithIndex((item, index) =>\n switch item {\n | \"Hello\" => Some(index)\n | _ => None\n }\n) == [0]\n```\n" + }, "insertText": "->Array.filterMapWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 86, "character": 34}, "end": {"line": 86, "character": 35}}, - "newText": "" - }] - }, { - "label": "->Array.filter", "kind": 12, - "tags": [], + "label": "->Array.filterMapWithIndex", + "sortText": "filterMapWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 35, "line": 86 }, + "start": { "character": 34, "line": 86 } + } + } + ], "detail": "(array<'a>, 'a => bool) => array<'a>", - "documentation": {"kind": "markdown", "value": "\n`filter(array, checker)` returns a new array containing all elements from `array` for which the provided `checker` function returns true.\n\nSee [`Array.filter`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/filter) on MDN.\n\n## Examples\n\n```rescript\n[1, 2, 3, 4]->Array.filter(num => num > 2) == [3, 4]\n```\n"}, - "sortText": "filter", + "documentation": { + "kind": "markdown", + "value": "\n`filter(array, checker)` returns a new array containing all elements from `array` for which the provided `checker` function returns true.\n\nSee [`Array.filter`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/filter) on MDN.\n\n## Examples\n\n```rescript\n[1, 2, 3, 4]->Array.filter(num => num > 2) == [3, 4]\n```\n" + }, "insertText": "->Array.filter", - "additionalTextEdits": [{ - "range": {"start": {"line": 86, "character": 34}, "end": {"line": 86, "character": 35}}, - "newText": "" - }] - }, { - "label": "->Array.filterWithIndex", "kind": 12, - "tags": [], + "label": "->Array.filter", + "sortText": "filter", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 35, "line": 86 }, + "start": { "character": 34, "line": 86 } + } + } + ], "detail": "(array<'a>, ('a, int) => bool) => array<'a>", - "documentation": {"kind": "markdown", "value": "\n`filterWithIndex(array, checker)` returns a new array containing all elements from `array` for which the provided `checker` function returns true.\n\nSee [`Array.filter`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/filter) on MDN.\n\n## Examples\n\n```rescript\n[1, 2, 3, 4]->Array.filterWithIndex((num, index) => index === 0 || num === 2) == [1, 2]\n```\n"}, - "sortText": "filterWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`filterWithIndex(array, checker)` returns a new array containing all elements from `array` for which the provided `checker` function returns true.\n\nSee [`Array.filter`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/filter) on MDN.\n\n## Examples\n\n```rescript\n[1, 2, 3, 4]->Array.filterWithIndex((num, index) => index === 0 || num === 2) == [1, 2]\n```\n" + }, "insertText": "->Array.filterWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 86, "character": 34}, "end": {"line": 86, "character": 35}}, - "newText": "" - }] - }] + "kind": 12, + "label": "->Array.filterWithIndex", + "sortText": "filterWithIndex", + "tags": [] + } +] Complete src/DotPipeCompletionSpec.res 89:62 posCursor:[89:62] posNoWhite:[89:61] Found expr:[89:3->89:62] @@ -441,31 +612,50 @@ ContextPath Value[Array, joinWith] Path Array.joinWith Path Stdlib.String.includ Path includ -[{ - "label": "->String.includes", - "kind": 12, - "tags": [], +[ + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 56, "line": 89 }, + "start": { "character": 55, "line": 89 } + } + } + ], "detail": "(string, string) => bool", - "documentation": {"kind": "markdown", "value": "\n`includes(str, searchValue)` returns `true` if `searchValue` is found anywhere\nwithin `str`, `false` otherwise.\nSee [`String.includes`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/includes) on MDN.\n\n## Examples\n\n```rescript\nString.includes(\"programmer\", \"gram\") == true\nString.includes(\"programmer\", \"er\") == true\nString.includes(\"programmer\", \"pro\") == true\nString.includes(\"programmer.dat\", \"xyz\") == false\n```\n"}, - "sortText": "includes", + "documentation": { + "kind": "markdown", + "value": "\n`includes(str, searchValue)` returns `true` if `searchValue` is found anywhere\nwithin `str`, `false` otherwise.\nSee [`String.includes`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/includes) on MDN.\n\n## Examples\n\n```rescript\nString.includes(\"programmer\", \"gram\") == true\nString.includes(\"programmer\", \"er\") == true\nString.includes(\"programmer\", \"pro\") == true\nString.includes(\"programmer.dat\", \"xyz\") == false\n```\n" + }, "insertText": "->String.includes", - "additionalTextEdits": [{ - "range": {"start": {"line": 89, "character": 55}, "end": {"line": 89, "character": 56}}, - "newText": "" - }] - }, { - "label": "->String.includesFrom", "kind": 12, - "tags": [], + "label": "->String.includes", + "sortText": "includes", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 56, "line": 89 }, + "start": { "character": 55, "line": 89 } + } + } + ], "detail": "(string, string, int) => bool", - "documentation": {"kind": "markdown", "value": "\n`includesFrom(str, searchValue, start)` returns `true` if `searchValue` is found\nanywhere within `str` starting at character number `start` (where 0 is the\nfirst character), `false` otherwise.\nSee [`String.includes`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/includes) on MDN.\n\n## Examples\n\n```rescript\nString.includesFrom(\"programmer\", \"gram\", 1) == true\nString.includesFrom(\"programmer\", \"gram\", 4) == false\nString.includesFrom(`대한민국`, `한`, 1) == true\n```\n"}, - "sortText": "includesFrom", + "documentation": { + "kind": "markdown", + "value": "\n`includesFrom(str, searchValue, start)` returns `true` if `searchValue` is found\nanywhere within `str` starting at character number `start` (where 0 is the\nfirst character), `false` otherwise.\nSee [`String.includes`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/includes) on MDN.\n\n## Examples\n\n```rescript\nString.includesFrom(\"programmer\", \"gram\", 1) == true\nString.includesFrom(\"programmer\", \"gram\", 4) == false\nString.includesFrom(`대한민국`, `한`, 1) == true\n```\n" + }, "insertText": "->String.includesFrom", - "additionalTextEdits": [{ - "range": {"start": {"line": 89, "character": 55}, "end": {"line": 89, "character": 56}}, - "newText": "" - }] - }] + "kind": 12, + "label": "->String.includesFrom", + "sortText": "includesFrom", + "tags": [] + } +] Complete src/DotPipeCompletionSpec.res 94:36 posCursor:[94:36] posNoWhite:[94:35] Found expr:[94:3->94:36] @@ -483,19 +673,29 @@ ContextPath Value[String, toLowerCase] Path String.toLowerCase Path Stdlib.String.toUpperCa Path toUpperCa -[{ - "label": "->String.toUpperCase", - "kind": 12, - "tags": [], +[ + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 27, "line": 94 }, + "start": { "character": 26, "line": 94 } + } + } + ], "detail": "string => string", - "documentation": {"kind": "markdown", "value": "\n`toUpperCase(str)` converts `str` to upper case using the locale-insensitive\ncase mappings in the Unicode Character Database. Notice that the conversion can\nexpand the number of letters in the result, for example the German ß\ncapitalizes to two Ses in a row.\nSee [`String.toUpperCase`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/toUpperCase) on MDN.\n\n## Examples\n\n```rescript\nString.toUpperCase(\"abc\") == \"ABC\"\nString.toUpperCase(`Straße`) == `STRASSE`\nString.toUpperCase(`πς`) == `ΠΣ`\n```\n"}, - "sortText": "toUpperCase", + "documentation": { + "kind": "markdown", + "value": "\n`toUpperCase(str)` converts `str` to upper case using the locale-insensitive\ncase mappings in the Unicode Character Database. Notice that the conversion can\nexpand the number of letters in the result, for example the German ß\ncapitalizes to two Ses in a row.\nSee [`String.toUpperCase`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/toUpperCase) on MDN.\n\n## Examples\n\n```rescript\nString.toUpperCase(\"abc\") == \"ABC\"\nString.toUpperCase(`Straße`) == `STRASSE`\nString.toUpperCase(`πς`) == `ΠΣ`\n```\n" + }, "insertText": "->String.toUpperCase", - "additionalTextEdits": [{ - "range": {"start": {"line": 94, "character": 26}, "end": {"line": 94, "character": 27}}, - "newText": "" - }] - }] + "kind": 12, + "label": "->String.toUpperCase", + "sortText": "toUpperCase", + "tags": [] + } +] Complete src/DotPipeCompletionSpec.res 97:55 posCursor:[97:55] posNoWhite:[97:54] Found expr:[97:3->97:55] @@ -513,19 +713,29 @@ ContextPath Value[String, toUpperCase] Path String.toUpperCase Path Stdlib.String.toLowerC Path toLowerC -[{ - "label": "->String.toLowerCase", - "kind": 12, - "tags": [], +[ + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 47, "line": 97 }, + "start": { "character": 46, "line": 97 } + } + } + ], "detail": "string => string", - "documentation": {"kind": "markdown", "value": "\n`toLowerCase(str)` converts `str` to lower case using the locale-insensitive\ncase mappings in the Unicode Character Database. Notice that the conversion can\ngive different results depending upon context, for example with the Greek\nletter sigma, which has two different lower case forms, one when it is the last\ncharacter in a string and another when it is not.\nSee [`String.toLowerCase`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/toLowerCase) on MDN.\n\n## Examples\n\n```rescript\nString.toLowerCase(\"ABC\") == \"abc\"\nString.toLowerCase(`ΣΠ`) == `σπ`\nString.toLowerCase(`ΠΣ`) == `πς`\n```\n"}, - "sortText": "toLowerCase", + "documentation": { + "kind": "markdown", + "value": "\n`toLowerCase(str)` converts `str` to lower case using the locale-insensitive\ncase mappings in the Unicode Character Database. Notice that the conversion can\ngive different results depending upon context, for example with the Greek\nletter sigma, which has two different lower case forms, one when it is the last\ncharacter in a string and another when it is not.\nSee [`String.toLowerCase`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/toLowerCase) on MDN.\n\n## Examples\n\n```rescript\nString.toLowerCase(\"ABC\") == \"abc\"\nString.toLowerCase(`ΣΠ`) == `σπ`\nString.toLowerCase(`ΠΣ`) == `πς`\n```\n" + }, "insertText": "->String.toLowerCase", - "additionalTextEdits": [{ - "range": {"start": {"line": 97, "character": 46}, "end": {"line": 97, "character": 47}}, - "newText": "" - }] - }] + "kind": 12, + "label": "->String.toLowerCase", + "sortText": "toLowerCase", + "tags": [] + } +] Complete src/DotPipeCompletionSpec.res 101:7 posCursor:[101:7] posNoWhite:[101:6] Found expr:[100:9->104:1] @@ -544,61 +754,86 @@ CPPipe pathFromEnv: found:true Path DotPipeCompletionSpec. Path DotPipeCompletionSpec.SomeOtherModule. Path -[{ - "label": "nname", - "kind": 5, - "tags": [], +[ + { "detail": "string", - "documentation": {"kind": "markdown", "value": "```rescript\nnname: string\n```\n\n```rescript\ntype typeOutsideModule = {nname: string}\n```"} - }, { - "label": "->doWithTypeOutsideModule", - "kind": 12, - "tags": [], + "documentation": { + "kind": "markdown", + "value": "```rescript\nnname: string\n```\n\n```rescript\ntype typeOutsideModule = {nname: string}\n```" + }, + "kind": 5, + "label": "nname", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 7, "line": 101 }, + "start": { "character": 6, "line": 101 } + } + } + ], "detail": "typeOutsideModule => string", - "documentation": null, - "sortText": "doWithTypeOutsideModule", "insertText": "->doWithTypeOutsideModule", - "additionalTextEdits": [{ - "range": {"start": {"line": 101, "character": 6}, "end": {"line": 101, "character": 7}}, - "newText": "" - }] - }, { - "label": "->SomeOtherModule.getNName", "kind": 12, - "tags": [], + "label": "->doWithTypeOutsideModule", + "sortText": "doWithTypeOutsideModule", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 7, "line": 101 }, + "start": { "character": 6, "line": 101 } + } + } + ], "detail": "t => string", - "documentation": null, - "sortText": "getNName", "insertText": "->SomeOtherModule.getNName", - "additionalTextEdits": [{ - "range": {"start": {"line": 101, "character": 6}, "end": {"line": 101, "character": 7}}, - "newText": "" - }] - }, { - "label": "->SomeOtherModule.getNName2", "kind": 12, - "tags": [], + "label": "->SomeOtherModule.getNName", + "sortText": "getNName", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 7, "line": 101 }, + "start": { "character": 6, "line": 101 } + } + } + ], "detail": "typeOutsideModule => string", - "documentation": null, - "sortText": "getNName2", "insertText": "->SomeOtherModule.getNName2", - "additionalTextEdits": [{ - "range": {"start": {"line": 101, "character": 6}, "end": {"line": 101, "character": 7}}, - "newText": "" - }] - }, { - "label": "->doWithTypeOutsideModule", "kind": 12, - "tags": [], + "label": "->SomeOtherModule.getNName2", + "sortText": "getNName2", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 7, "line": 101 }, + "start": { "character": 6, "line": 101 } + } + } + ], "detail": "typeOutsideModule => string", - "documentation": null, - "sortText": "doWithTypeOutsideModule", "insertText": "->doWithTypeOutsideModule", - "additionalTextEdits": [{ - "range": {"start": {"line": 101, "character": 6}, "end": {"line": 101, "character": 7}}, - "newText": "" - }] - }] + "kind": 12, + "label": "->doWithTypeOutsideModule", + "sortText": "doWithTypeOutsideModule", + "tags": [] + } +] Complete src/DotPipeCompletionSpec.res 108:27 XXX Not found! @@ -607,27 +842,28 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Module[Dot] Path Dot -[{ - "label": "DotPipeCompleteFromCurrentModule", - "kind": 9, - "tags": [], - "detail": "module DotPipeCompleteFromCurrentModule", - "documentation": null, +[ + { "data": { "modulePath": "DotPipeCompleteFromCurrentModule", "filePath": "src/DotPipeCompletionSpec.res" - } - }, { - "label": "DotPipeCompletionSpec", + }, + "detail": "module DotPipeCompleteFromCurrentModule", "kind": 9, - "tags": [], - "detail": "module DotPipeCompletionSpec", - "documentation": null, + "label": "DotPipeCompleteFromCurrentModule", + "tags": [] + }, + { "data": { "modulePath": "DotPipeCompletionSpec", "filePath": "src/DotPipeCompletionSpec.res" - } - }] + }, + "detail": "module DotPipeCompletionSpec", + "kind": 9, + "label": "DotPipeCompletionSpec", + "tags": [] + } +] Complete src/DotPipeCompletionSpec.res 111:39 posCursor:[111:39] posNoWhite:[111:38] Found expr:[111:24->111:40] @@ -638,37 +874,38 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Value[CompletionPipe] Path CompletionPipe -[{ - "label": "CompletionPipeChain", - "kind": 9, - "tags": [], - "detail": "module CompletionPipeChain", - "documentation": null, +[ + { "data": { "modulePath": "CompletionPipeChain", "filePath": "src/DotPipeCompletionSpec.res" - } - }, { - "label": "CompletionPipeProperty", + }, + "detail": "module CompletionPipeChain", "kind": 9, - "tags": [], - "detail": "module CompletionPipeProperty", - "documentation": null, + "label": "CompletionPipeChain", + "tags": [] + }, + { "data": { "modulePath": "CompletionPipeProperty", "filePath": "src/DotPipeCompletionSpec.res" - } - }, { - "label": "CompletionPipeSubmodules", + }, + "detail": "module CompletionPipeProperty", "kind": 9, - "tags": [], - "detail": "module CompletionPipeSubmodules", - "documentation": null, + "label": "CompletionPipeProperty", + "tags": [] + }, + { "data": { "modulePath": "CompletionPipeSubmodules", "filePath": "src/DotPipeCompletionSpec.res" - } - }] + }, + "detail": "module CompletionPipeSubmodules", + "kind": 9, + "label": "CompletionPipeSubmodules", + "tags": [] + } +] Complete src/DotPipeCompletionSpec.res 114:44 posCursor:[114:44] posNoWhite:[114:43] Found expr:[114:24->114:45] @@ -679,27 +916,28 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Value[Dot] Path Dot -[{ - "label": "DotPipeCompleteFromCurrentModule", - "kind": 9, - "tags": [], - "detail": "module DotPipeCompleteFromCurrentModule", - "documentation": null, +[ + { "data": { "modulePath": "DotPipeCompleteFromCurrentModule", "filePath": "src/DotPipeCompletionSpec.res" - } - }, { - "label": "DotPipeCompletionSpec", + }, + "detail": "module DotPipeCompleteFromCurrentModule", "kind": 9, - "tags": [], - "detail": "module DotPipeCompletionSpec", - "documentation": null, + "label": "DotPipeCompleteFromCurrentModule", + "tags": [] + }, + { "data": { "modulePath": "DotPipeCompletionSpec", "filePath": "src/DotPipeCompletionSpec.res" - } - }] + }, + "detail": "module DotPipeCompletionSpec", + "kind": 9, + "label": "DotPipeCompletionSpec", + "tags": [] + } +] Complete src/DotPipeCompletionSpec.res 122:11 posCursor:[122:11] posNoWhite:[122:10] Found expr:[122:3->122:11] @@ -713,29 +951,40 @@ Path someObj ContextPath Value[someObj]-> ContextPath Value[someObj] Path someObj -[{ - "label": "[\"age\"]", - "kind": 4, - "tags": [], +[ + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 11, "line": 122 }, + "start": { "character": 10, "line": 122 } + } + } + ], "detail": "{\"age\": int, \"name\": string}", - "documentation": null, "insertText": "[\"age\"]", - "additionalTextEdits": [{ - "range": {"start": {"line": 122, "character": 10}, "end": {"line": 122, "character": 11}}, - "newText": "" - }] - }, { - "label": "[\"name\"]", "kind": 4, - "tags": [], + "label": "[\"age\"]", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 11, "line": 122 }, + "start": { "character": 10, "line": 122 } + } + } + ], "detail": "{\"age\": int, \"name\": string}", - "documentation": null, "insertText": "[\"name\"]", - "additionalTextEdits": [{ - "range": {"start": {"line": 122, "character": 10}, "end": {"line": 122, "character": 11}}, - "newText": "" - }] - }] + "kind": 4, + "label": "[\"name\"]", + "tags": [] + } +] Complete src/DotPipeCompletionSpec.res 125:13 posCursor:[125:13] posNoWhite:[125:12] Found expr:[125:3->125:13] @@ -749,18 +998,24 @@ Path someObj ContextPath Value[someObj]->na ContextPath Value[someObj] Path someObj -[{ - "label": "[\"name\"]", - "kind": 4, - "tags": [], +[ + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 11, "line": 125 }, + "start": { "character": 10, "line": 125 } + } + } + ], "detail": "{\"age\": int, \"name\": string}", - "documentation": null, "insertText": "[\"name\"]", - "additionalTextEdits": [{ - "range": {"start": {"line": 125, "character": 10}, "end": {"line": 125, "character": 11}}, - "newText": "" - }] - }] + "kind": 4, + "label": "[\"name\"]", + "tags": [] + } +] Complete src/DotPipeCompletionSpec.res 144:10 posCursor:[144:10] posNoWhite:[144:9] Found expr:[144:3->144:10] @@ -778,23 +1033,33 @@ CPPipe pathFromEnv:DOMAPI found:true Path DOMAPI. Path DotPipeCompletionSpec.HTMLButtonElement. Path -[{ - "label": "disabled", - "kind": 5, - "tags": [], +[ + { "detail": "bool", - "documentation": {"kind": "markdown", "value": "```rescript\ndisabled: bool\n```\n\n```rescript\ntype htmlButtonElement = {mutable disabled: bool}\n```"} - }, { - "label": "->HTMLButtonElement.checkValidity", - "kind": 12, - "tags": [], + "documentation": { + "kind": "markdown", + "value": "```rescript\ndisabled: bool\n```\n\n```rescript\ntype htmlButtonElement = {mutable disabled: bool}\n```" + }, + "kind": 5, + "label": "disabled", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 10, "line": 144 }, + "start": { "character": 9, "line": 144 } + } + } + ], "detail": "DOMAPI.htmlButtonElement => bool", - "documentation": null, - "sortText": "checkValidity", "insertText": "->HTMLButtonElement.checkValidity", - "additionalTextEdits": [{ - "range": {"start": {"line": 144, "character": 9}, "end": {"line": 144, "character": 10}}, - "newText": "" - }] - }] + "kind": 12, + "label": "->HTMLButtonElement.checkValidity", + "sortText": "checkValidity", + "tags": [] + } +] diff --git a/tests/analysis_tests/tests/src/expected/EnvCompletion.res.txt b/tests/analysis_tests/tests/src/expected/EnvCompletion.res.txt index 04fcb8d2cff..984700667e5 100644 --- a/tests/analysis_tests/tests/src/expected/EnvCompletion.res.txt +++ b/tests/analysis_tests/tests/src/expected/EnvCompletion.res.txt @@ -5,23 +5,32 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Value[res] Path res -[{ - "label": "Okay(_)", - "kind": 4, - "tags": [], +[ + { "detail": "Okay('a)", - "documentation": {"kind": "markdown", "value": "```rescript\nOkay('a)\n```\n\n```rescript\ntype someResult<'a, 'b> = Okay('a) | Failure('b)\n```"}, + "documentation": { + "kind": "markdown", + "value": "```rescript\nOkay('a)\n```\n\n```rescript\ntype someResult<'a, 'b> = Okay('a) | Failure('b)\n```" + }, "insertText": "Okay(${1:_})", - "insertTextFormat": 2 - }, { - "label": "Failure(_)", + "insertTextFormat": 2, "kind": 4, - "tags": [], + "label": "Okay(_)", + "tags": [] + }, + { "detail": "Failure('b)", - "documentation": {"kind": "markdown", "value": "```rescript\nFailure('b)\n```\n\n```rescript\ntype someResult<'a, 'b> = Okay('a) | Failure('b)\n```"}, + "documentation": { + "kind": "markdown", + "value": "```rescript\nFailure('b)\n```\n\n```rescript\ntype someResult<'a, 'b> = Okay('a) | Failure('b)\n```" + }, "insertText": "Failure(${1:_})", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 4, + "label": "Failure(_)", + "tags": [] + } +] Complete src/EnvCompletion.res 13:23 posCursor:[13:23] posNoWhite:[13:22] Found pattern:[13:18->13:24] @@ -33,23 +42,32 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Value[res] Path res -[{ - "label": "One", - "kind": 4, - "tags": [], +[ + { "detail": "One", - "documentation": {"kind": "markdown", "value": "```rescript\nOne\n```\n\n```rescript\ntype things = One | Two\n```"}, + "documentation": { + "kind": "markdown", + "value": "```rescript\nOne\n```\n\n```rescript\ntype things = One | Two\n```" + }, "insertText": "One", - "insertTextFormat": 2 - }, { - "label": "Two", + "insertTextFormat": 2, "kind": 4, - "tags": [], + "label": "One", + "tags": [] + }, + { "detail": "Two", - "documentation": {"kind": "markdown", "value": "```rescript\nTwo\n```\n\n```rescript\ntype things = One | Two\n```"}, + "documentation": { + "kind": "markdown", + "value": "```rescript\nTwo\n```\n\n```rescript\ntype things = One | Two\n```" + }, "insertText": "Two", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 4, + "label": "Two", + "tags": [] + } +] Complete src/EnvCompletion.res 16:26 posCursor:[16:26] posNoWhite:[16:25] Found pattern:[16:18->16:27] @@ -61,16 +79,17 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Value[res] Path res -[{ - "label": "\"\"", - "kind": 12, - "tags": [], +[ + { "detail": "string", - "documentation": null, - "sortText": "A", "insertText": "\"$0\"", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 12, + "label": "\"\"", + "sortText": "A", + "tags": [] + } +] Complete src/EnvCompletion.res 19:19 XXX Not found! @@ -80,16 +99,21 @@ Resolved opens 1 Stdlib ContextPath Value[use](Nolabel) ContextPath Value[use] Path use -[{ - "label": "{}", - "kind": 22, - "tags": [], +[ + { "detail": "EnvCompletionOtherFile.response", - "documentation": {"kind": "markdown", "value": "```rescript\ntype EnvCompletionOtherFile.response = {stuff: theVariant, res: someResult}\n```"}, - "sortText": "A", + "documentation": { + "kind": "markdown", + "value": "```rescript\ntype EnvCompletionOtherFile.response = {stuff: theVariant, res: someResult}\n```" + }, "insertText": "{$0}", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 22, + "label": "{}", + "sortText": "A", + "tags": [] + } +] Complete src/EnvCompletion.res 22:21 posCursor:[22:21] posNoWhite:[22:20] Found pattern:[22:20->22:22] @@ -99,19 +123,28 @@ Resolved opens 1 Stdlib ContextPath Value[use](Nolabel) ContextPath Value[use] Path use -[{ - "label": "stuff", - "kind": 5, - "tags": [], +[ + { "detail": "theVariant", - "documentation": {"kind": "markdown", "value": "```rescript\nstuff: theVariant\n```\n\n```rescript\ntype EnvCompletionOtherFile.response = {stuff: theVariant, res: someResult}\n```"} - }, { - "label": "res", + "documentation": { + "kind": "markdown", + "value": "```rescript\nstuff: theVariant\n```\n\n```rescript\ntype EnvCompletionOtherFile.response = {stuff: theVariant, res: someResult}\n```" + }, "kind": 5, - "tags": [], + "label": "stuff", + "tags": [] + }, + { "detail": "someResult", - "documentation": {"kind": "markdown", "value": "```rescript\nres: someResult\n```\n\n```rescript\ntype EnvCompletionOtherFile.response = {stuff: theVariant, res: someResult}\n```"} - }] + "documentation": { + "kind": "markdown", + "value": "```rescript\nres: someResult\n```\n\n```rescript\ntype EnvCompletionOtherFile.response = {stuff: theVariant, res: someResult}\n```" + }, + "kind": 5, + "label": "res", + "tags": [] + } +] Complete src/EnvCompletion.res 25:27 posCursor:[25:27] posNoWhite:[25:26] Found pattern:[25:20->25:31] @@ -121,23 +154,32 @@ Resolved opens 1 Stdlib ContextPath Value[use](Nolabel) ContextPath Value[use] Path use -[{ - "label": "First", - "kind": 4, - "tags": [], +[ + { "detail": "First", - "documentation": {"kind": "markdown", "value": "```rescript\nFirst\n```\n\n```rescript\ntype theVariant = First | Second(r1)\n```"}, + "documentation": { + "kind": "markdown", + "value": "```rescript\nFirst\n```\n\n```rescript\ntype theVariant = First | Second(r1)\n```" + }, "insertText": "First", - "insertTextFormat": 2 - }, { - "label": "Second(_)", + "insertTextFormat": 2, "kind": 4, - "tags": [], + "label": "First", + "tags": [] + }, + { "detail": "Second(r1)", - "documentation": {"kind": "markdown", "value": "```rescript\nSecond(r1)\n```\n\n```rescript\ntype theVariant = First | Second(r1)\n```"}, + "documentation": { + "kind": "markdown", + "value": "```rescript\nSecond(r1)\n```\n\n```rescript\ntype theVariant = First | Second(r1)\n```" + }, "insertText": "Second(${1:_})", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 4, + "label": "Second(_)", + "tags": [] + } +] Complete src/EnvCompletion.res 28:35 posCursor:[28:35] posNoWhite:[28:34] Found pattern:[28:20->28:38] @@ -151,16 +193,21 @@ Resolved opens 1 Stdlib ContextPath Value[use](Nolabel) ContextPath Value[use] Path use -[{ - "label": "{}", - "kind": 22, - "tags": [], +[ + { "detail": "r1", - "documentation": {"kind": "markdown", "value": "```rescript\ntype r1 = {age: int}\n```"}, - "sortText": "A", + "documentation": { + "kind": "markdown", + "value": "```rescript\ntype r1 = {age: int}\n```" + }, "insertText": "{$0}", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 22, + "label": "{}", + "sortText": "A", + "tags": [] + } +] Complete src/EnvCompletion.res 31:36 posCursor:[31:36] posNoWhite:[31:35] Found pattern:[31:20->31:40] @@ -173,13 +220,18 @@ Resolved opens 1 Stdlib ContextPath Value[use](Nolabel) ContextPath Value[use] Path use -[{ - "label": "age", - "kind": 5, - "tags": [], +[ + { "detail": "int", - "documentation": {"kind": "markdown", "value": "```rescript\nage: int\n```\n\n```rescript\ntype r1 = {age: int}\n```"} - }] + "documentation": { + "kind": "markdown", + "value": "```rescript\nage: int\n```\n\n```rescript\ntype r1 = {age: int}\n```" + }, + "kind": 5, + "label": "age", + "tags": [] + } +] Complete src/EnvCompletion.res 34:25 posCursor:[34:25] posNoWhite:[34:24] Found pattern:[34:20->34:29] @@ -189,23 +241,32 @@ Resolved opens 1 Stdlib ContextPath Value[use](Nolabel) ContextPath Value[use] Path use -[{ - "label": "Okay(_)", - "kind": 4, - "tags": [], +[ + { "detail": "Okay('a)", - "documentation": {"kind": "markdown", "value": "```rescript\nOkay('a)\n```\n\n```rescript\ntype someResult<'a, 'b> = Okay('a) | Failure('b)\n```"}, + "documentation": { + "kind": "markdown", + "value": "```rescript\nOkay('a)\n```\n\n```rescript\ntype someResult<'a, 'b> = Okay('a) | Failure('b)\n```" + }, "insertText": "Okay(${1:_})", - "insertTextFormat": 2 - }, { - "label": "Failure(_)", + "insertTextFormat": 2, "kind": 4, - "tags": [], + "label": "Okay(_)", + "tags": [] + }, + { "detail": "Failure('b)", - "documentation": {"kind": "markdown", "value": "```rescript\nFailure('b)\n```\n\n```rescript\ntype someResult<'a, 'b> = Okay('a) | Failure('b)\n```"}, + "documentation": { + "kind": "markdown", + "value": "```rescript\nFailure('b)\n```\n\n```rescript\ntype someResult<'a, 'b> = Okay('a) | Failure('b)\n```" + }, "insertText": "Failure(${1:_})", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 4, + "label": "Failure(_)", + "tags": [] + } +] Complete src/EnvCompletion.res 37:31 posCursor:[37:31] posNoWhite:[37:30] Found pattern:[37:20->37:34] @@ -219,23 +280,32 @@ Resolved opens 1 Stdlib ContextPath Value[use](Nolabel) ContextPath Value[use] Path use -[{ - "label": "First", - "kind": 4, - "tags": [], +[ + { "detail": "First", - "documentation": {"kind": "markdown", "value": "```rescript\nFirst\n```\n\n```rescript\ntype theVariant = First | Second(r1)\n```"}, + "documentation": { + "kind": "markdown", + "value": "```rescript\nFirst\n```\n\n```rescript\ntype theVariant = First | Second(r1)\n```" + }, "insertText": "First", - "insertTextFormat": 2 - }, { - "label": "Second(_)", + "insertTextFormat": 2, "kind": 4, - "tags": [], + "label": "First", + "tags": [] + }, + { "detail": "Second(r1)", - "documentation": {"kind": "markdown", "value": "```rescript\nSecond(r1)\n```\n\n```rescript\ntype theVariant = First | Second(r1)\n```"}, + "documentation": { + "kind": "markdown", + "value": "```rescript\nSecond(r1)\n```\n\n```rescript\ntype theVariant = First | Second(r1)\n```" + }, "insertText": "Second(${1:_})", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 4, + "label": "Second(_)", + "tags": [] + } +] Complete src/EnvCompletion.res 40:38 posCursor:[40:38] posNoWhite:[40:37] Found pattern:[40:20->40:42] @@ -251,16 +321,21 @@ Resolved opens 1 Stdlib ContextPath Value[use](Nolabel) ContextPath Value[use] Path use -[{ - "label": "{}", - "kind": 22, - "tags": [], +[ + { "detail": "r1", - "documentation": {"kind": "markdown", "value": "```rescript\ntype r1 = {age: int}\n```"}, - "sortText": "A", + "documentation": { + "kind": "markdown", + "value": "```rescript\ntype r1 = {age: int}\n```" + }, "insertText": "{$0}", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 22, + "label": "{}", + "sortText": "A", + "tags": [] + } +] Complete src/EnvCompletion.res 43:39 posCursor:[43:39] posNoWhite:[43:38] Found pattern:[43:20->43:44] @@ -275,13 +350,18 @@ Resolved opens 1 Stdlib ContextPath Value[use](Nolabel) ContextPath Value[use] Path use -[{ - "label": "age", - "kind": 5, - "tags": [], +[ + { "detail": "int", - "documentation": {"kind": "markdown", "value": "```rescript\nage: int\n```\n\n```rescript\ntype r1 = {age: int}\n```"} - }] + "documentation": { + "kind": "markdown", + "value": "```rescript\nage: int\n```\n\n```rescript\ntype r1 = {age: int}\n```" + }, + "kind": 5, + "label": "age", + "tags": [] + } +] Complete src/EnvCompletion.res 52:18 XXX Not found! @@ -290,16 +370,21 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Value[res2] Path res2 -[{ - "label": "{}", - "kind": 22, - "tags": [], +[ + { "detail": "EnvCompletionOtherFile.someRecord", - "documentation": {"kind": "markdown", "value": "```rescript\ntype EnvCompletionOtherFile.someRecord = {name: string, theThing: 'thing, theVariant: theVariant}\n```"}, - "sortText": "A", + "documentation": { + "kind": "markdown", + "value": "```rescript\ntype EnvCompletionOtherFile.someRecord = {name: string, theThing: 'thing, theVariant: theVariant}\n```" + }, "insertText": "{$0}", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 22, + "label": "{}", + "sortText": "A", + "tags": [] + } +] Complete src/EnvCompletion.res 55:20 posCursor:[55:20] posNoWhite:[55:19] Found pattern:[55:19->55:21] @@ -308,25 +393,38 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Value[res2] Path res2 -[{ - "label": "name", - "kind": 5, - "tags": [], +[ + { "detail": "string", - "documentation": {"kind": "markdown", "value": "```rescript\nname: string\n```\n\n```rescript\ntype EnvCompletionOtherFile.someRecord = {name: string, theThing: 'thing, theVariant: theVariant}\n```"} - }, { - "label": "theThing", + "documentation": { + "kind": "markdown", + "value": "```rescript\nname: string\n```\n\n```rescript\ntype EnvCompletionOtherFile.someRecord = {name: string, theThing: 'thing, theVariant: theVariant}\n```" + }, "kind": 5, - "tags": [], + "label": "name", + "tags": [] + }, + { "detail": "'thing", - "documentation": {"kind": "markdown", "value": "```rescript\ntheThing: 'thing\n```\n\n```rescript\ntype EnvCompletionOtherFile.someRecord = {name: string, theThing: 'thing, theVariant: theVariant}\n```"} - }, { - "label": "theVariant", + "documentation": { + "kind": "markdown", + "value": "```rescript\ntheThing: 'thing\n```\n\n```rescript\ntype EnvCompletionOtherFile.someRecord = {name: string, theThing: 'thing, theVariant: theVariant}\n```" + }, "kind": 5, - "tags": [], + "label": "theThing", + "tags": [] + }, + { "detail": "theVariant", - "documentation": {"kind": "markdown", "value": "```rescript\ntheVariant: theVariant\n```\n\n```rescript\ntype EnvCompletionOtherFile.someRecord = {name: string, theThing: 'thing, theVariant: theVariant}\n```"} - }] + "documentation": { + "kind": "markdown", + "value": "```rescript\ntheVariant: theVariant\n```\n\n```rescript\ntype EnvCompletionOtherFile.someRecord = {name: string, theThing: 'thing, theVariant: theVariant}\n```" + }, + "kind": 5, + "label": "theVariant", + "tags": [] + } +] Complete src/EnvCompletion.res 58:29 posCursor:[58:29] posNoWhite:[58:28] Found pattern:[58:19->58:33] @@ -335,23 +433,32 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Value[res2] Path res2 -[{ - "label": "Four", - "kind": 4, - "tags": [], +[ + { "detail": "Four", - "documentation": {"kind": "markdown", "value": "```rescript\nFour\n```\n\n```rescript\ntype things2 = Four | Five\n```"}, + "documentation": { + "kind": "markdown", + "value": "```rescript\nFour\n```\n\n```rescript\ntype things2 = Four | Five\n```" + }, "insertText": "Four", - "insertTextFormat": 2 - }, { - "label": "Five", + "insertTextFormat": 2, "kind": 4, - "tags": [], + "label": "Four", + "tags": [] + }, + { "detail": "Five", - "documentation": {"kind": "markdown", "value": "```rescript\nFive\n```\n\n```rescript\ntype things2 = Four | Five\n```"}, + "documentation": { + "kind": "markdown", + "value": "```rescript\nFive\n```\n\n```rescript\ntype things2 = Four | Five\n```" + }, "insertText": "Five", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 4, + "label": "Five", + "tags": [] + } +] Complete src/EnvCompletion.res 61:31 posCursor:[61:31] posNoWhite:[61:30] Found pattern:[61:19->61:35] @@ -360,21 +467,30 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Value[res2] Path res2 -[{ - "label": "First", - "kind": 4, - "tags": [], +[ + { "detail": "First", - "documentation": {"kind": "markdown", "value": "```rescript\nFirst\n```\n\n```rescript\ntype theVariant = First | Second(r1)\n```"}, + "documentation": { + "kind": "markdown", + "value": "```rescript\nFirst\n```\n\n```rescript\ntype theVariant = First | Second(r1)\n```" + }, "insertText": "First", - "insertTextFormat": 2 - }, { - "label": "Second(_)", + "insertTextFormat": 2, "kind": 4, - "tags": [], + "label": "First", + "tags": [] + }, + { "detail": "Second(r1)", - "documentation": {"kind": "markdown", "value": "```rescript\nSecond(r1)\n```\n\n```rescript\ntype theVariant = First | Second(r1)\n```"}, + "documentation": { + "kind": "markdown", + "value": "```rescript\nSecond(r1)\n```\n\n```rescript\ntype theVariant = First | Second(r1)\n```" + }, "insertText": "Second(${1:_})", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 4, + "label": "Second(_)", + "tags": [] + } +] diff --git a/tests/analysis_tests/tests/src/expected/ExhaustiveSwitch.res.txt b/tests/analysis_tests/tests/src/expected/ExhaustiveSwitch.res.txt index 2d5586d1f28..ca5e05c5859 100644 --- a/tests/analysis_tests/tests/src/expected/ExhaustiveSwitch.res.txt +++ b/tests/analysis_tests/tests/src/expected/ExhaustiveSwitch.res.txt @@ -5,22 +5,27 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Value[withSomeVarian] Path withSomeVarian -[{ - "label": "withSomeVariant", - "kind": 12, - "tags": [], +[ + { "detail": "someVariant", - "documentation": {"kind": "markdown", "value": "```rescript\ntype someVariant = One | Two | Three(option)\n```"} - }, { - "label": "withSomeVariant (exhaustive switch)", - "kind": 15, - "tags": [], + "documentation": { + "kind": "markdown", + "value": "```rescript\ntype someVariant = One | Two | Three(option)\n```" + }, + "kind": 12, + "label": "withSomeVariant", + "tags": [] + }, + { "detail": "insert exhaustive switch for value", - "documentation": null, "filterText": "withSomeVariant", "insertText": "withSomeVariant {\n | One => ${1:%todo}\n | Two => ${2:%todo}\n | Three(_) => ${3:%todo}\n }", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 15, + "label": "withSomeVariant (exhaustive switch)", + "tags": [] + } +] Complete src/ExhaustiveSwitch.res 11:21 XXX Not found! @@ -29,22 +34,23 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Value[withSomePol] Path withSomePol -[{ - "label": "withSomePoly", - "kind": 12, - "tags": [], +[ + { "detail": "somePolyVariant", - "documentation": null - }, { - "label": "withSomePoly (exhaustive switch)", - "kind": 15, - "tags": [], + "kind": 12, + "label": "withSomePoly", + "tags": [] + }, + { "detail": "insert exhaustive switch for value", - "documentation": null, "filterText": "withSomePoly", "insertText": "withSomePoly {\n | #\"switch\" => ${1:%todo}\n | #one => ${2:%todo}\n | #three(_) => ${3:%todo}\n | #two => ${4:%todo}\n | #\"exotic ident\" => ${5:%todo}\n }", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 15, + "label": "withSomePoly (exhaustive switch)", + "tags": [] + } +] Complete src/ExhaustiveSwitch.res 14:17 XXX Not found! @@ -53,22 +59,18 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Value[someBoo] Path someBoo -[{ - "label": "someBool", - "kind": 12, - "tags": [], - "detail": "bool", - "documentation": null - }, { - "label": "someBool (exhaustive switch)", - "kind": 15, - "tags": [], +[ + { "detail": "bool", "kind": 12, "label": "someBool", "tags": [] }, + { "detail": "insert exhaustive switch for value", - "documentation": null, "filterText": "someBool", "insertText": "someBool {\n | true => ${1:%todo}\n | false => ${2:%todo}\n }", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 15, + "label": "someBool (exhaustive switch)", + "tags": [] + } +] Complete src/ExhaustiveSwitch.res 17:16 XXX Not found! @@ -77,22 +79,18 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Value[someOp] Path someOp -[{ - "label": "someOpt", - "kind": 12, - "tags": [], - "detail": "option", - "documentation": null - }, { - "label": "someOpt (exhaustive switch)", - "kind": 15, - "tags": [], +[ + { "detail": "option", "kind": 12, "label": "someOpt", "tags": [] }, + { "detail": "insert exhaustive switch for value", - "documentation": null, "filterText": "someOpt", "insertText": "someOpt {\n | Some($1) => ${2:%todo}\n | None => ${3:%todo}\n }", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 15, + "label": "someOpt (exhaustive switch)", + "tags": [] + } +] Xform src/ExhaustiveSwitch.res 30:13 posCursor:[30:13] posNoWhite:[30:12] Found expr:[30:3->30:17] @@ -123,7 +121,10 @@ Resolved opens 1 Stdlib Hit: Exhaustive switch TextDocumentEdit: ExhaustiveSwitch.res -{"start": {"line": 33, "character": 3}, "end": {"line": 33, "character": 10}} +{ + "end": { "character": 10, "line": 33 }, + "start": { "character": 3, "line": 33 } +} newText: <--here switch x->getV { @@ -144,7 +145,10 @@ Resolved opens 1 Stdlib Hit: Exhaustive switch TextDocumentEdit: ExhaustiveSwitch.res -{"start": {"line": 36, "character": 3}, "end": {"line": 36, "character": 6}} +{ + "end": { "character": 6, "line": 36 }, + "start": { "character": 3, "line": 36 } +} newText: <--here switch vvv { @@ -163,21 +167,26 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Value[withSomeVarian] Path withSomeVarian -[{ - "label": "withSomeVariant", - "kind": 12, - "tags": [], +[ + { "detail": "someVariant", - "documentation": {"kind": "markdown", "value": "```rescript\ntype someVariant = One | Two | Three(option)\n```"} - }, { - "label": "withSomeVariant (exhaustive switch)", - "kind": 15, - "tags": [], + "documentation": { + "kind": "markdown", + "value": "```rescript\ntype someVariant = One | Two | Three(option)\n```" + }, + "kind": 12, + "label": "withSomeVariant", + "tags": [] + }, + { "detail": "insert exhaustive switch for value", - "documentation": null, "filterText": "withSomeVariant", "insertText": "withSomeVariant {\n | One => ${1:%todo}\n | Two => ${2:%todo}\n | Three(_) => ${3:%todo}\n }", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 15, + "label": "withSomeVariant (exhaustive switch)", + "tags": [] + } +] diff --git a/tests/analysis_tests/tests/src/expected/Firebase.res.txt b/tests/analysis_tests/tests/src/expected/Firebase.res.txt index 17105d12f49..65b15690df0 100644 --- a/tests/analysis_tests/tests/src/expected/Firebase.res.txt +++ b/tests/analysis_tests/tests/src/expected/Firebase.res.txt @@ -14,29 +14,43 @@ Path ref CPPipe pathFromEnv:Firebase.Firestore found:true Path Firebase.Firestore. Path -[{ - "label": "id", - "kind": 5, - "tags": [], +[ + { "detail": "string", - "documentation": {"kind": "markdown", "value": "```rescript\nid: string\n```\n\n```rescript\ntype documentReference<'documentdata> = {\n id: string,\n path: string,\n}\n```"} - }, { - "label": "path", + "documentation": { + "kind": "markdown", + "value": "```rescript\nid: string\n```\n\n```rescript\ntype documentReference<'documentdata> = {\n id: string,\n path: string,\n}\n```" + }, "kind": 5, - "tags": [], + "label": "id", + "tags": [] + }, + { "detail": "string", - "documentation": {"kind": "markdown", "value": "```rescript\npath: string\n```\n\n```rescript\ntype documentReference<'documentdata> = {\n id: string,\n path: string,\n}\n```"} - }, { - "label": "->Firestore.getDoc", - "kind": 12, - "tags": [], + "documentation": { + "kind": "markdown", + "value": "```rescript\npath: string\n```\n\n```rescript\ntype documentReference<'documentdata> = {\n id: string,\n path: string,\n}\n```" + }, + "kind": 5, + "label": "path", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 9, "line": 30 }, + "start": { "character": 8, "line": 30 } + } + } + ], "detail": "documentReference<\n 'documentdata,\n> => Promise.t>", - "documentation": null, - "sortText": "getDoc", "insertText": "->Firestore.getDoc", - "additionalTextEdits": [{ - "range": {"start": {"line": 30, "character": 8}, "end": {"line": 30, "character": 9}}, - "newText": "" - }] - }] + "kind": 12, + "label": "->Firestore.getDoc", + "sortText": "getDoc", + "tags": [] + } +] diff --git a/tests/analysis_tests/tests/src/expected/FirstClassModules.res.txt b/tests/analysis_tests/tests/src/expected/FirstClassModules.res.txt index cc0bfcaf1db..34efeb08337 100644 --- a/tests/analysis_tests/tests/src/expected/FirstClassModules.res.txt +++ b/tests/analysis_tests/tests/src/expected/FirstClassModules.res.txt @@ -1,5 +1,10 @@ Hover src/FirstClassModules.res 11:16 -{"contents": {"kind": "markdown", "value": "```rescript\nmodule type SomeModule = {\n module Inner\n type t = {x: int}\n let foo: t => int\n let doStuff: string => unit\n let doOtherStuff: string => unit\n}\n```"}} +{ + "contents": { + "kind": "markdown", + "value": "```rescript\nmodule type SomeModule = {\n module Inner\n type t = {x: int}\n let foo: t => int\n let doStuff: string => unit\n let doOtherStuff: string => unit\n}\n```" + } +} Complete src/FirstClassModules.res 13:15 posCursor:[13:15] posNoWhite:[13:14] Found expr:[10:13->26:1] @@ -12,40 +17,35 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Value[SomeModule, ""] Path SomeModule. -[{ - "label": "Inner", - "kind": 9, - "tags": [], - "detail": "module Inner", - "documentation": null - }, { - "label": "t", - "kind": 22, - "tags": [], +[ + { "detail": "module Inner", "kind": 9, "label": "Inner", "tags": [] }, + { "detail": "type t", - "documentation": {"kind": "markdown", "value": "```rescript\ntype t = {x: int}\n```"} - }, { - "label": "foo", - "kind": 12, - "tags": [], - "detail": "t => int", - "documentation": null - }, { - "label": "doStuff", - "kind": 12, - "tags": [], + "documentation": { + "kind": "markdown", + "value": "```rescript\ntype t = {x: int}\n```" + }, + "kind": 22, + "label": "t", + "tags": [] + }, + { "detail": "t => int", "kind": 12, "label": "foo", "tags": [] }, + { "detail": "string => unit", "kind": 12, "label": "doStuff", "tags": [] }, + { "detail": "string => unit", - "documentation": null - }, { - "label": "doOtherStuff", "kind": 12, - "tags": [], - "detail": "string => unit", - "documentation": null - }] + "label": "doOtherStuff", + "tags": [] + } +] Hover src/FirstClassModules.res 16:8 -{"contents": {"kind": "markdown", "value": "```rescript\nstring => unit\n```"}} +{ + "contents": { + "kind": "markdown", + "value": "```rescript\nstring => unit\n```" + } +} Complete src/FirstClassModules.res 20:7 posCursor:[20:7] posNoWhite:[20:6] Found expr:[10:13->26:1] @@ -60,25 +60,25 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Value[M, ""] Path M. -[{ - "label": "t", - "kind": 22, - "tags": [], +[ + { "detail": "type t", - "documentation": {"kind": "markdown", "value": "```rescript\ntype t = {name: string}\n```"} - }, { - "label": "getName", + "documentation": { + "kind": "markdown", + "value": "```rescript\ntype t = {name: string}\n```" + }, + "kind": 22, + "label": "t", + "tags": [] + }, + { "detail": "t => string", "kind": 12, "label": "getName", "tags": [] }, + { + "detail": "unit => string", "kind": 12, - "tags": [], - "detail": "t => string", - "documentation": null - }, { "label": "thisShouldNotBeCompletedFor", - "kind": 12, - "tags": [], - "detail": "unit => string", - "documentation": null - }] + "tags": [] + } +] Complete src/FirstClassModules.res 23:8 posCursor:[23:8] posNoWhite:[23:7] Found expr:[10:13->26:1] @@ -93,13 +93,7 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Value[M, g] Path M.g -[{ - "label": "getName", - "kind": 12, - "tags": [], - "detail": "t => string", - "documentation": null - }] +[ { "detail": "t => string", "kind": 12, "label": "getName", "tags": [] } ] Complete src/FirstClassModules.res 32:8 posCursor:[32:8] posNoWhite:[32:7] Found expr:[30:22->35:1] @@ -112,37 +106,27 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Value[S2, ""] Path S2. -[{ - "label": "Inner", - "kind": 9, - "tags": [], - "detail": "module Inner", - "documentation": null - }, { - "label": "t", - "kind": 22, - "tags": [], +[ + { "detail": "module Inner", "kind": 9, "label": "Inner", "tags": [] }, + { "detail": "type t", - "documentation": {"kind": "markdown", "value": "```rescript\ntype t = {x: int}\n```"} - }, { - "label": "foo", - "kind": 12, - "tags": [], - "detail": "t => int", - "documentation": null - }, { - "label": "doStuff", - "kind": 12, - "tags": [], + "documentation": { + "kind": "markdown", + "value": "```rescript\ntype t = {x: int}\n```" + }, + "kind": 22, + "label": "t", + "tags": [] + }, + { "detail": "t => int", "kind": 12, "label": "foo", "tags": [] }, + { "detail": "string => unit", "kind": 12, "label": "doStuff", "tags": [] }, + { "detail": "string => unit", - "documentation": null - }, { - "label": "doOtherStuff", "kind": 12, - "tags": [], - "detail": "string => unit", - "documentation": null - }] + "label": "doOtherStuff", + "tags": [] + } +] Complete src/FirstClassModules.res 38:7 posCursor:[38:7] posNoWhite:[38:6] Found expr:[38:5->38:7] @@ -152,40 +136,35 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Value[X, ""] Path X. -[{ - "label": "Inner", - "kind": 9, - "tags": [], - "detail": "module Inner", - "documentation": null - }, { - "label": "t", - "kind": 22, - "tags": [], +[ + { "detail": "module Inner", "kind": 9, "label": "Inner", "tags": [] }, + { "detail": "type t", - "documentation": {"kind": "markdown", "value": "```rescript\ntype t = {x: int}\n```"} - }, { - "label": "foo", - "kind": 12, - "tags": [], - "detail": "t => int", - "documentation": null - }, { - "label": "doStuff", - "kind": 12, - "tags": [], + "documentation": { + "kind": "markdown", + "value": "```rescript\ntype t = {x: int}\n```" + }, + "kind": 22, + "label": "t", + "tags": [] + }, + { "detail": "t => int", "kind": 12, "label": "foo", "tags": [] }, + { "detail": "string => unit", "kind": 12, "label": "doStuff", "tags": [] }, + { "detail": "string => unit", - "documentation": null - }, { - "label": "doOtherStuff", "kind": 12, - "tags": [], - "detail": "string => unit", - "documentation": null - }] + "label": "doOtherStuff", + "tags": [] + } +] Hover src/FirstClassModules.res 44:7 -{"contents": {"kind": "markdown", "value": "```rescript\nmodule type SomeModule = {\n module Inner\n type t = {x: int}\n let foo: t => int\n let doStuff: string => unit\n let doOtherStuff: string => unit\n}\n```"}} +{ + "contents": { + "kind": "markdown", + "value": "```rescript\nmodule type SomeModule = {\n module Inner\n type t = {x: int}\n let foo: t => int\n let doStuff: string => unit\n let doOtherStuff: string => unit\n}\n```" + } +} Complete src/FirstClassModules.res 52:17 posCursor:[52:17] posNoWhite:[52:16] Found expr:[50:15->55:3] @@ -198,37 +177,27 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Value[SomeModule, ""] Path SomeModule. -[{ - "label": "Inner", - "kind": 9, - "tags": [], - "detail": "module Inner", - "documentation": null - }, { - "label": "t", - "kind": 22, - "tags": [], +[ + { "detail": "module Inner", "kind": 9, "label": "Inner", "tags": [] }, + { "detail": "type t", - "documentation": {"kind": "markdown", "value": "```rescript\ntype t = {x: int}\n```"} - }, { - "label": "foo", - "kind": 12, - "tags": [], - "detail": "t => int", - "documentation": null - }, { - "label": "doStuff", - "kind": 12, - "tags": [], + "documentation": { + "kind": "markdown", + "value": "```rescript\ntype t = {x: int}\n```" + }, + "kind": 22, + "label": "t", + "tags": [] + }, + { "detail": "t => int", "kind": 12, "label": "foo", "tags": [] }, + { "detail": "string => unit", "kind": 12, "label": "doStuff", "tags": [] }, + { "detail": "string => unit", - "documentation": null - }, { - "label": "doOtherStuff", "kind": 12, - "tags": [], - "detail": "string => unit", - "documentation": null - }] + "label": "doOtherStuff", + "tags": [] + } +] Complete src/FirstClassModules.res 65:17 posCursor:[65:17] posNoWhite:[65:16] Found expr:[58:16->69:1] @@ -243,35 +212,25 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Value[SomeModule, ""] Path SomeModule. -[{ - "label": "Inner", - "kind": 9, - "tags": [], - "detail": "module Inner", - "documentation": null - }, { - "label": "t", - "kind": 22, - "tags": [], +[ + { "detail": "module Inner", "kind": 9, "label": "Inner", "tags": [] }, + { "detail": "type t", - "documentation": {"kind": "markdown", "value": "```rescript\ntype t = {x: int}\n```"} - }, { - "label": "foo", - "kind": 12, - "tags": [], - "detail": "t => int", - "documentation": null - }, { - "label": "doStuff", - "kind": 12, - "tags": [], + "documentation": { + "kind": "markdown", + "value": "```rescript\ntype t = {x: int}\n```" + }, + "kind": 22, + "label": "t", + "tags": [] + }, + { "detail": "t => int", "kind": 12, "label": "foo", "tags": [] }, + { "detail": "string => unit", "kind": 12, "label": "doStuff", "tags": [] }, + { "detail": "string => unit", - "documentation": null - }, { - "label": "doOtherStuff", "kind": 12, - "tags": [], - "detail": "string => unit", - "documentation": null - }] + "label": "doOtherStuff", + "tags": [] + } +] diff --git a/tests/analysis_tests/tests/src/expected/Fragment.res.txt b/tests/analysis_tests/tests/src/expected/Fragment.res.txt index c2601ef1216..09ba7d34d15 100644 --- a/tests/analysis_tests/tests/src/expected/Fragment.res.txt +++ b/tests/analysis_tests/tests/src/expected/Fragment.res.txt @@ -1,6 +1,16 @@ Hover src/Fragment.res 6:19 -{"contents": {"kind": "markdown", "value": "```rescript\nReact.component>\n```\n\n---\n\n```\n \n```\n```rescript\ntype React.component<'props> = Jsx.component<'props>\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22React.res%22%2C13%2C0%5D)\n\n\n---\n\n```\n \n```\n```rescript\ntype SectionHeader.props<'children> = {children: 'children}\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22Fragment.res%22%2C1%2C2%5D)\n\n\n---\n\n```\n \n```\n```rescript\ntype React.element = Jsx.element\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22React.res%22%2C0%2C0%5D)\n"}} +{ + "contents": { + "kind": "markdown", + "value": "```rescript\nReact.component>\n```\n\n---\n\n```\n \n```\n```rescript\ntype React.component<'props> = Jsx.component<'props>\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22React.res%22%2C13%2C0%5D)\n\n\n---\n\n```\n \n```\n```rescript\ntype SectionHeader.props<'children> = {children: 'children}\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22Fragment.res%22%2C1%2C2%5D)\n\n\n---\n\n```\n \n```\n```rescript\ntype React.element = Jsx.element\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22React.res%22%2C0%2C0%5D)\n" + } +} Hover src/Fragment.res 9:56 -{"contents": {"kind": "markdown", "value": "```rescript\nReact.component\n```\n\n---\n\n```\n \n```\n```rescript\ntype React.component<'props> = Jsx.component<'props>\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22React.res%22%2C13%2C0%5D)\n\n\n---\n\n```\n \n```\n```rescript\ntype React.fragmentProps = {children?: element}\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22React.res%22%2C42%2C0%5D)\n"}} +{ + "contents": { + "kind": "markdown", + "value": "```rescript\nReact.component\n```\n\n---\n\n```\n \n```\n```rescript\ntype React.component<'props> = Jsx.component<'props>\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22React.res%22%2C13%2C0%5D)\n\n\n---\n\n```\n \n```\n```rescript\ntype React.fragmentProps = {children?: element}\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22React.res%22%2C42%2C0%5D)\n" + } +} diff --git a/tests/analysis_tests/tests/src/expected/Hover.res.txt b/tests/analysis_tests/tests/src/expected/Hover.res.txt index f9f1746e150..34120153e1c 100644 --- a/tests/analysis_tests/tests/src/expected/Hover.res.txt +++ b/tests/analysis_tests/tests/src/expected/Hover.res.txt @@ -1,52 +1,108 @@ Hover src/Hover.res 0:4 -{"contents": {"kind": "markdown", "value": "```rescript\nint\n```"}} +{ "contents": { "kind": "markdown", "value": "```rescript\nint\n```" } } Hover src/Hover.res 3:5 -{"contents": {"kind": "markdown", "value": "```rescript\ntype t = (int, float)\n```"}} +{ + "contents": { + "kind": "markdown", + "value": "```rescript\ntype t = (int, float)\n```" + } +} Hover src/Hover.res 6:7 -{"contents": {"kind": "markdown", "value": "```rescript\nmodule Id: {\n type x = int\n}\n```"}} +{ + "contents": { + "kind": "markdown", + "value": "```rescript\nmodule Id: {\n type x = int\n}\n```" + } +} Hover src/Hover.res 19:11 -{"contents": {"kind": "markdown", "value": "\nThis module is commented\n---\n\n```\n \n```\n```rescript\nmodule Dep: {\n let customDouble: int => int\n}\n```"}} +{ + "contents": { + "kind": "markdown", + "value": "\nThis module is commented\n---\n\n```\n \n```\n```rescript\nmodule Dep: {\n let customDouble: int => int\n}\n```" + } +} Hover src/Hover.res 22:11 -{"contents": {"kind": "markdown", "value": "```rescript\nint => int\n```\n---\nSome doc comment"}} +{ + "contents": { + "kind": "markdown", + "value": "```rescript\nint => int\n```\n---\nSome doc comment" + } +} Hover src/Hover.res 26:6 getLocItem #8: heuristic for JSX with at most one child heuristic for: [makeProps, make, createElement], give the loc of `make` -{"contents": {"kind": "markdown", "value": "```rescript\nint\n```"}} +{ "contents": { "kind": "markdown", "value": "```rescript\nint\n```" } } Hover src/Hover.res 33:4 -{"contents": {"kind": "markdown", "value": "```rescript\nunit => int\n```\n---\nDoc comment for functionWithTypeAnnotation"}} +{ + "contents": { + "kind": "markdown", + "value": "```rescript\nunit => int\n```\n---\nDoc comment for functionWithTypeAnnotation" + } +} Hover src/Hover.res 37:13 -{"contents": {"kind": "markdown", "value": "```rescript\nstring\n```"}} +{ "contents": { "kind": "markdown", "value": "```rescript\nstring\n```" } } Hover src/Hover.res 42:15 -{"contents": {"kind": "markdown", "value": "```rescript\nstring\n```"}} +{ "contents": { "kind": "markdown", "value": "```rescript\nstring\n```" } } Hover src/Hover.res 46:10 -{"contents": {"kind": "markdown", "value": "```rescript\nint\n```"}} +{ "contents": { "kind": "markdown", "value": "```rescript\nint\n```" } } Hover src/Hover.res 49:13 -{"contents": {"kind": "markdown", "value": "```rescript\nmodule type Logger = {\n let log: string => unit\n}\n```"}} +{ + "contents": { + "kind": "markdown", + "value": "```rescript\nmodule type Logger = {\n let log: string => unit\n}\n```" + } +} Hover src/Hover.res 54:7 -{"contents": {"kind": "markdown", "value": "```rescript\nmodule type Logger = {\n let log: string => unit\n}\n```"}} +{ + "contents": { + "kind": "markdown", + "value": "```rescript\nmodule type Logger = {\n let log: string => unit\n}\n```" + } +} Definition src/Hover.res 60:14 -{"uri": "Hover.res", "range": {"start": {"line": 49, "character": 12}, "end": {"line": 49, "character": 18}}} +{ + "range": { + "end": { "character": 18, "line": 49 }, + "start": { "character": 12, "line": 49 } + }, + "uri": "file:///Hover.res" +} Hover src/Hover.res 63:9 -{"contents": {"kind": "markdown", "value": "```rescript\nmodule IdDefinedTwice: {\n let y: int\n let _x: int\n}\n```"}} +{ + "contents": { + "kind": "markdown", + "value": "```rescript\nmodule IdDefinedTwice: {\n let y: int\n let _x: int\n}\n```" + } +} Hover src/Hover.res 74:7 -{"contents": {"kind": "markdown", "value": "```rescript\nmodule A: {\n let x: int\n}\n```"}} +{ + "contents": { + "kind": "markdown", + "value": "```rescript\nmodule A: {\n let x: int\n}\n```" + } +} Hover src/Hover.res 77:7 -{"contents": {"kind": "markdown", "value": "```rescript\nmodule A: {\n let x: int\n}\n```"}} +{ + "contents": { + "kind": "markdown", + "value": "```rescript\nmodule A: {\n let x: int\n}\n```" + } +} Hover src/Hover.res 91:10 Nothing at that position. Now trying to use completion. @@ -61,16 +117,26 @@ JSX 95:8] > _children:96:4 null Hover src/Hover.res 103:25 -{"contents": {"kind": "markdown", "value": "```rescript\nfloat\n```"}} +{ "contents": { "kind": "markdown", "value": "```rescript\nfloat\n```" } } Hover src/Hover.res 106:21 -{"contents": {"kind": "markdown", "value": "```rescript\nint\n```"}} +{ "contents": { "kind": "markdown", "value": "```rescript\nint\n```" } } Hover src/Hover.res 116:16 -{"contents": {"kind": "markdown", "value": "```rescript\nAA.cond<([< #str(string)] as 'a)> => AA.cond<'a>\n```\n\n---\n\n```\n \n```\n```rescript\ntype AA.cond<'a> = 'a\n constraint 'a = [< #str(string)]\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22Hover.res%22%2C110%2C2%5D)\n"}} +{ + "contents": { + "kind": "markdown", + "value": "```rescript\nAA.cond<([< #str(string)] as 'a)> => AA.cond<'a>\n```\n\n---\n\n```\n \n```\n```rescript\ntype AA.cond<'a> = 'a\n constraint 'a = [< #str(string)]\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22Hover.res%22%2C110%2C2%5D)\n" + } +} Hover src/Hover.res 119:25 -{"contents": {"kind": "markdown", "value": "```rescript\nAA.cond<([< #str(string)] as 'a)> => AA.cond<'a>\n```\n\n---\n\n```\n \n```\n```rescript\ntype AA.cond<'a> = 'a\n constraint 'a = [< #str(string)]\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22Hover.res%22%2C110%2C2%5D)\n"}} +{ + "contents": { + "kind": "markdown", + "value": "```rescript\nAA.cond<([< #str(string)] as 'a)> => AA.cond<'a>\n```\n\n---\n\n```\n \n```\n```rescript\ntype AA.cond<'a> = 'a\n constraint 'a = [< #str(string)]\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22Hover.res%22%2C110%2C2%5D)\n" + } +} Hover src/Hover.res 122:3 Nothing at that position. Now trying to use completion. @@ -78,31 +144,76 @@ Attribute id:live:[122:0->122:5] label:live Completable: Cdecorator(live) Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib -{"contents": {"kind": "markdown", "value": "The `@live` decorator is for reanalyze, a static analysis tool for ReScript that can do dead code analysis.\n\n`@live` tells the dead code analysis that the value should be considered live, even though it might appear to be dead. This is typically used in case of FFI where there are indirect ways to access values. It can be added to everything that could otherwise be considered unused by the dead code analysis - values, functions, arguments, records, individual record fields, and so on.\n\n[Read more and see examples in the documentation](https://rescript-lang.org/syntax-lookup#live-decorator).\n\nHint: Did you know you can run an interactive code analysis in your project by running the command `> ReScript: Start Code Analyzer`? Try it!"}} +{ + "contents": { + "kind": "markdown", + "value": "The `@live` decorator is for reanalyze, a static analysis tool for ReScript that can do dead code analysis.\n\n`@live` tells the dead code analysis that the value should be considered live, even though it might appear to be dead. This is typically used in case of FFI where there are indirect ways to access values. It can be added to everything that could otherwise be considered unused by the dead code analysis - values, functions, arguments, records, individual record fields, and so on.\n\n[Read more and see examples in the documentation](https://rescript-lang.org/syntax-lookup#live-decorator).\n\nHint: Did you know you can run an interactive code analysis in your project by running the command `> ReScript: Start Code Analyzer`? Try it!" + } +} Hover src/Hover.res 125:4 -{"contents": {"kind": "markdown", "value": "```rescript\nunit => unit => int\n```"}} +{ + "contents": { + "kind": "markdown", + "value": "```rescript\nunit => unit => int\n```" + } +} Hover src/Hover.res 131:4 -{"contents": {"kind": "markdown", "value": "```rescript\n(unit, unit) => int\n```"}} +{ + "contents": { + "kind": "markdown", + "value": "```rescript\n(unit, unit) => int\n```" + } +} Hover src/Hover.res 134:4 -{"contents": {"kind": "markdown", "value": "```rescript\n(unit, unit) => int\n```"}} +{ + "contents": { + "kind": "markdown", + "value": "```rescript\n(unit, unit) => int\n```" + } +} Hover src/Hover.res 137:5 -{"contents": {"kind": "markdown", "value": "```rescript\nunit => unit => int\n```"}} +{ + "contents": { + "kind": "markdown", + "value": "```rescript\nunit => unit => int\n```" + } +} Hover src/Hover.res 144:9 -{"contents": {"kind": "markdown", "value": "```rescript\nint\n```\n---\ndoc comment 1"}} +{ + "contents": { + "kind": "markdown", + "value": "```rescript\nint\n```\n---\ndoc comment 1" + } +} Hover src/Hover.res 148:6 -{"contents": {"kind": "markdown", "value": "```rescript\nint\n```\n---\n doc comment 2 "}} +{ + "contents": { + "kind": "markdown", + "value": "```rescript\nint\n```\n---\n doc comment 2 " + } +} Hover src/Hover.res 165:23 -{"contents": {"kind": "markdown", "value": "```rescript\nfoo\n```\n\n---\n\n```\n \n```\n```rescript\ntype foo<'a> = {content: 'a, zzz: string}\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22Hover.res%22%2C161%2C2%5D)\n\n\n---\n\n```\n \n```\n```rescript\ntype bar = {age: int}\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22Hover.res%22%2C162%2C2%5D)\n"}} +{ + "contents": { + "kind": "markdown", + "value": "```rescript\nfoo\n```\n\n---\n\n```\n \n```\n```rescript\ntype foo<'a> = {content: 'a, zzz: string}\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22Hover.res%22%2C161%2C2%5D)\n\n\n---\n\n```\n \n```\n```rescript\ntype bar = {age: int}\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22Hover.res%22%2C162%2C2%5D)\n" + } +} Hover src/Hover.res 167:22 -{"contents": {"kind": "markdown", "value": "```rescript\nfoobar\n```\n\n---\n\n```\n \n```\n```rescript\ntype foobar = foo\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22Hover.res%22%2C163%2C2%5D)\n"}} +{ + "contents": { + "kind": "markdown", + "value": "```rescript\nfoobar\n```\n\n---\n\n```\n \n```\n```rescript\ntype foobar = foo\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22Hover.res%22%2C163%2C2%5D)\n" + } +} Complete src/Hover.res 170:16 posCursor:[170:16] posNoWhite:[170:15] Found expr:[170:5->170:16] @@ -133,13 +244,18 @@ Path content CPPipe pathFromEnv: found:true Path Hover. Path -[{ - "label": "age", - "kind": 5, - "tags": [], +[ + { "detail": "int", - "documentation": {"kind": "markdown", "value": "```rescript\nage: int\n```\n\n```rescript\ntype bar = {age: int}\n```"} - }] + "documentation": { + "kind": "markdown", + "value": "```rescript\nage: int\n```\n\n```rescript\ntype bar = {age: int}\n```" + }, + "kind": 5, + "label": "age", + "tags": [] + } +] Complete src/Hover.res 173:16 posCursor:[173:16] posNoWhite:[173:15] Found expr:[173:5->173:16] @@ -170,13 +286,18 @@ Path content CPPipe pathFromEnv: found:true Path Hover. Path -[{ - "label": "age", - "kind": 5, - "tags": [], +[ + { "detail": "int", - "documentation": {"kind": "markdown", "value": "```rescript\nage: int\n```\n\n```rescript\ntype bar = {age: int}\n```"} - }] + "documentation": { + "kind": "markdown", + "value": "```rescript\nage: int\n```\n\n```rescript\ntype bar = {age: int}\n```" + }, + "kind": 5, + "label": "age", + "tags": [] + } +] Complete src/Hover.res 182:16 posCursor:[182:16] posNoWhite:[182:15] Found expr:[182:5->182:16] @@ -207,13 +328,18 @@ Path content CPPipe pathFromEnv: found:true Path Hover. Path -[{ - "label": "age", - "kind": 5, - "tags": [], +[ + { "detail": "int", - "documentation": {"kind": "markdown", "value": "```rescript\nage: int\n```\n\n```rescript\ntype bar = {age: int}\n```"} - }] + "documentation": { + "kind": "markdown", + "value": "```rescript\nage: int\n```\n\n```rescript\ntype bar = {age: int}\n```" + }, + "kind": 5, + "label": "age", + "tags": [] + } +] Complete src/Hover.res 185:16 posCursor:[185:16] posNoWhite:[185:15] Found expr:[185:5->185:16] @@ -244,19 +370,34 @@ Path content CPPipe pathFromEnv: found:true Path Hover. Path -[{ - "label": "age", - "kind": 5, - "tags": [], +[ + { "detail": "int", - "documentation": {"kind": "markdown", "value": "```rescript\nage: int\n```\n\n```rescript\ntype bar = {age: int}\n```"} - }] + "documentation": { + "kind": "markdown", + "value": "```rescript\nage: int\n```\n\n```rescript\ntype bar = {age: int}\n```" + }, + "kind": 5, + "label": "age", + "tags": [] + } +] Hover src/Hover.res 197:4 -{"contents": {"kind": "markdown", "value": "```rescript\nCompV4.props => React.element\n```\n\n---\n\n```\n \n```\n```rescript\ntype CompV4.props<'n, 's> = {n?: 'n, s: 's}\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22Hover.res%22%2C190%2C2%5D)\n\n\n---\n\n```\n \n```\n```rescript\ntype React.element = Jsx.element\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22React.res%22%2C0%2C0%5D)\n"}} +{ + "contents": { + "kind": "markdown", + "value": "```rescript\nCompV4.props => React.element\n```\n\n---\n\n```\n \n```\n```rescript\ntype CompV4.props<'n, 's> = {n?: 'n, s: 's}\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22Hover.res%22%2C190%2C2%5D)\n\n\n---\n\n```\n \n```\n```rescript\ntype React.element = Jsx.element\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22React.res%22%2C0%2C0%5D)\n" + } +} Hover src/Hover.res 202:16 -{"contents": {"kind": "markdown", "value": "```rescript\nuseR\n```\n\n---\n\n```\n \n```\n```rescript\ntype useR = {x: int, y: list>>}\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22Hover.res%22%2C200%2C0%5D)\n\n\n---\n\n```\n \n```\n```rescript\ntype r<'a> = {i: 'a, f: float}\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22Hover.res%22%2C101%2C0%5D)\n"}} +{ + "contents": { + "kind": "markdown", + "value": "```rescript\nuseR\n```\n\n---\n\n```\n \n```\n```rescript\ntype useR = {x: int, y: list>>}\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22Hover.res%22%2C200%2C0%5D)\n\n\n---\n\n```\n \n```\n```rescript\ntype r<'a> = {i: 'a, f: float}\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22Hover.res%22%2C101%2C0%5D)\n" + } +} Hover src/Hover.res 210:13 Nothing at that position. Now trying to use completion. @@ -269,13 +410,28 @@ ContextPath Value[usr] Path usr Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib -{"contents": {"kind": "markdown", "value": "```rescript\nuseR\n```\n\n---\n\n```\n \n```\n```rescript\ntype useR = {x: int, y: list>>}\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22Hover.res%22%2C200%2C0%5D)\n\n\n---\n\n```\n \n```\n```rescript\ntype r<'a> = {i: 'a, f: float}\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22Hover.res%22%2C101%2C0%5D)\n"}} +{ + "contents": { + "kind": "markdown", + "value": "```rescript\nuseR\n```\n\n---\n\n```\n \n```\n```rescript\ntype useR = {x: int, y: list>>}\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22Hover.res%22%2C200%2C0%5D)\n\n\n---\n\n```\n \n```\n```rescript\ntype r<'a> = {i: 'a, f: float}\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22Hover.res%22%2C101%2C0%5D)\n" + } +} Hover src/Hover.res 230:20 -{"contents": {"kind": "markdown", "value": "```rescript\nint\n```\n---\n More Stuff "}} +{ + "contents": { + "kind": "markdown", + "value": "```rescript\nint\n```\n---\n More Stuff " + } +} Hover src/Hover.res 233:17 -{"contents": {"kind": "markdown", "value": "```rescript\nint\n```\n---\n More Stuff "}} +{ + "contents": { + "kind": "markdown", + "value": "```rescript\nint\n```\n---\n More Stuff " + } +} Hover src/Hover.res 245:6 Nothing at that position. Now trying to use completion. @@ -295,22 +451,52 @@ Path Hover.someField Path someField Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib -{"contents": {"kind": "markdown", "value": "```rescript\nbool\n```\n---\n Mighty fine field here. "}} +{ + "contents": { + "kind": "markdown", + "value": "```rescript\nbool\n```\n---\n Mighty fine field here. " + } +} Hover src/Hover.res 248:19 -{"contents": {"kind": "markdown", "value": "```rescript\nbool\n```\n---\n Mighty fine field here. "}} +{ + "contents": { + "kind": "markdown", + "value": "```rescript\nbool\n```\n---\n Mighty fine field here. " + } +} Hover src/Hover.res 253:20 -{"contents": {"kind": "markdown", "value": "```rescript\nvariant\nCoolVariant\n```\n---\n Cool variant! \n\n---\n\n```\n \n```\n```rescript\ntype variant = CoolVariant | OtherCoolVariant\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22Hover.res%22%2C251%2C0%5D)\n"}} +{ + "contents": { + "kind": "markdown", + "value": "```rescript\nvariant\nCoolVariant\n```\n---\n Cool variant! \n\n---\n\n```\n \n```\n```rescript\ntype variant = CoolVariant | OtherCoolVariant\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22Hover.res%22%2C251%2C0%5D)\n" + } +} Hover src/Hover.res 258:22 -{"contents": {"kind": "markdown", "value": "```rescript\npayloadVariants\nInlineRecord({field1: int, field2: bool})\n```\n\n---\n\n```\n \n```\n```rescript\ntype payloadVariants =\n | InlineRecord({field1: int, field2: bool})\n | Args(int, bool)\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22Hover.res%22%2C256%2C0%5D)\n"}} +{ + "contents": { + "kind": "markdown", + "value": "```rescript\npayloadVariants\nInlineRecord({field1: int, field2: bool})\n```\n\n---\n\n```\n \n```\n```rescript\ntype payloadVariants =\n | InlineRecord({field1: int, field2: bool})\n | Args(int, bool)\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22Hover.res%22%2C256%2C0%5D)\n" + } +} Hover src/Hover.res 261:23 -{"contents": {"kind": "markdown", "value": "```rescript\npayloadVariants\nArgs(int, bool)\n```\n\n---\n\n```\n \n```\n```rescript\ntype payloadVariants =\n | InlineRecord({field1: int, field2: bool})\n | Args(int, bool)\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22Hover.res%22%2C256%2C0%5D)\n"}} +{ + "contents": { + "kind": "markdown", + "value": "```rescript\npayloadVariants\nArgs(int, bool)\n```\n\n---\n\n```\n \n```\n```rescript\ntype payloadVariants =\n | InlineRecord({field1: int, field2: bool})\n | Args(int, bool)\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22Hover.res%22%2C256%2C0%5D)\n" + } +} Hover src/Hover.res 268:42 -{"contents": {"kind": "markdown", "value": "```rescript\nRecursiveVariants.t\nAction1(int)\n```\n\n---\n\n```\n \n```\n```rescript\ntype RecursiveVariants.t =\n | Action1(int)\n | Action2(float)\n | Batch(array)\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22Hover.res%22%2C265%2C2%5D)\n"}} +{ + "contents": { + "kind": "markdown", + "value": "```rescript\nRecursiveVariants.t\nAction1(int)\n```\n\n---\n\n```\n \n```\n```rescript\ntype RecursiveVariants.t =\n | Action1(int)\n | Action2(float)\n | Batch(array)\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22Hover.res%22%2C265%2C2%5D)\n" + } +} Hover src/Hover.res 272:23 Nothing at that position. Now trying to use completion. @@ -324,7 +510,7 @@ Path fff Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath string -{"contents": {"kind": "markdown", "value": "```rescript\nstring\n```"}} +{ "contents": { "kind": "markdown", "value": "```rescript\nstring\n```" } } Hover src/Hover.res 275:33 Nothing at that position. Now trying to use completion. @@ -340,11 +526,21 @@ Resolved opens 1 Stdlib ContextPath CPatternPath(Value[x])->recordField(someField) ContextPath Value[x] Path x -{"contents": {"kind": "markdown", "value": "```rescript\nbool\n```"}} +{ "contents": { "kind": "markdown", "value": "```rescript\nbool\n```" } } Hover src/Hover.res 278:8 -{"contents": {"kind": "markdown", "value": "\n [`Belt.Array`]()\n\n **mutable array**: Utilities functions\n\n---\n\n```\n \n```\n```rescript\nmodule Array: {\n module Id\n module Array\n module SortArray\n module MutableQueue\n module MutableStack\n module List\n module Range\n module Set\n module Map\n module MutableSet\n module MutableMap\n module HashSet\n module HashMap\n module Option\n module Result\n module Int\n module Float\n}\n```"}} +{ + "contents": { + "kind": "markdown", + "value": "\n [`Belt.Array`]()\n\n **mutable array**: Utilities functions\n\n---\n\n```\n \n```\n```rescript\nmodule Array: {\n module Id\n module Array\n module SortArray\n module MutableQueue\n module MutableStack\n module List\n module Range\n module Set\n module Map\n module MutableSet\n module MutableMap\n module HashSet\n module HashMap\n module Option\n module Result\n module Int\n module Float\n}\n```" + } +} Hover src/Hover.res 281:6 -{"contents": {"kind": "markdown", "value": "```rescript\ntype aliased = variant\n```\n\n---\n\n```\n \n```\n```rescript\ntype variant = CoolVariant | OtherCoolVariant\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22Hover.res%22%2C251%2C0%5D)\n"}} +{ + "contents": { + "kind": "markdown", + "value": "```rescript\ntype aliased = variant\n```\n\n---\n\n```\n \n```\n```rescript\ntype variant = CoolVariant | OtherCoolVariant\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22Hover.res%22%2C251%2C0%5D)\n" + } +} diff --git a/tests/analysis_tests/tests/src/expected/IncludeModuleCompletion.res.txt b/tests/analysis_tests/tests/src/expected/IncludeModuleCompletion.res.txt index 57535091fe8..231cb223563 100644 --- a/tests/analysis_tests/tests/src/expected/IncludeModuleCompletion.res.txt +++ b/tests/analysis_tests/tests/src/expected/IncludeModuleCompletion.res.txt @@ -15,55 +15,76 @@ Path k CPPipe pathFromEnv:Types found:true Path Types. Path -[{ - "label": "->blah", - "kind": 12, - "tags": [], +[ + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 11, "line": 47 }, + "start": { "character": 10, "line": 47 } + } + } + ], "detail": "Types.context => string", - "documentation": null, - "sortText": "blah", "insertText": "->blah", - "additionalTextEdits": [{ - "range": {"start": {"line": 47, "character": 10}, "end": {"line": 47, "character": 11}}, - "newText": "" - }] - }, { - "label": "->add", "kind": 12, - "tags": [], + "label": "->blah", + "sortText": "blah", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 11, "line": 47 }, + "start": { "character": 10, "line": 47 } + } + } + ], "detail": "(Types.context, array) => 't", - "documentation": null, - "sortText": "add", "insertText": "->add", - "additionalTextEdits": [{ - "range": {"start": {"line": 47, "character": 10}, "end": {"line": 47, "character": 11}}, - "newText": "" - }] - }, { - "label": "->addPosFromVec2", "kind": 12, - "tags": [], + "label": "->add", + "sortText": "add", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 11, "line": 47 }, + "start": { "character": 10, "line": 47 } + } + } + ], "detail": "(Types.context, Types.vec2) => Types.comp", - "documentation": null, - "sortText": "addPosFromVec2", "insertText": "->addPosFromVec2", - "additionalTextEdits": [{ - "range": {"start": {"line": 47, "character": 10}, "end": {"line": 47, "character": 11}}, - "newText": "" - }] - }, { - "label": "->addPos", "kind": 12, - "tags": [], + "label": "->addPosFromVec2", + "sortText": "addPosFromVec2", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 11, "line": 47 }, + "start": { "character": 10, "line": 47 } + } + } + ], "detail": "(Types.context, float, float) => Types.comp", - "documentation": null, - "sortText": "addPos", "insertText": "->addPos", - "additionalTextEdits": [{ - "range": {"start": {"line": 47, "character": 10}, "end": {"line": 47, "character": 11}}, - "newText": "" - }] - }] + "kind": 12, + "label": "->addPos", + "sortText": "addPos", + "tags": [] + } +] Complete src/IncludeModuleCompletion.res 49:12 posCursor:[49:12] posNoWhite:[49:11] Found expr:[45:13->52:3] @@ -75,25 +96,26 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Value[add] Path add -[{ - "label": "add", - "kind": 12, - "tags": [], +[ + { "detail": "(Types.context, array) => 't", - "documentation": null - }, { - "label": "addPosFromVec2", "kind": 12, - "tags": [], + "label": "add", + "tags": [] + }, + { "detail": "(Types.context, Types.vec2) => Types.comp", - "documentation": null - }, { - "label": "addPos", "kind": 12, - "tags": [], + "label": "addPosFromVec2", + "tags": [] + }, + { "detail": "(Types.context, float, float) => Types.comp", - "documentation": null - }] + "kind": 12, + "label": "addPos", + "tags": [] + } +] Complete src/IncludeModuleCompletion.res 58:13 posCursor:[58:13] posNoWhite:[58:12] Found expr:[54:17->61:3] @@ -104,19 +126,20 @@ Resolved opens 1 Stdlib ContextPath CArgument Value[add]($1) ContextPath Value[add] Path add -[{ - "label": "addPosFromVec2", - "kind": 12, - "tags": [], +[ + { "detail": "(Types.context, Types.vec2) => Types.comp", - "documentation": null - }, { - "label": "addPos", "kind": 12, - "tags": [], + "label": "addPosFromVec2", + "tags": [] + }, + { "detail": "(Types.context, float, float) => Types.comp", - "documentation": null - }] + "kind": 12, + "label": "addPos", + "tags": [] + } +] Complete src/IncludeModuleCompletion.res 70:13 posCursor:[70:13] posNoWhite:[70:12] Found expr:[68:15->73:5] @@ -135,67 +158,93 @@ Path k CPPipe pathFromEnv:Types found:true Path Types. Path -[{ - "label": "->blah", - "kind": 12, - "tags": [], +[ + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 13, "line": 70 }, + "start": { "character": 12, "line": 70 } + } + } + ], "detail": "Types.context => string", - "documentation": null, - "sortText": "blah", "insertText": "->blah", - "additionalTextEdits": [{ - "range": {"start": {"line": 70, "character": 12}, "end": {"line": 70, "character": 13}}, - "newText": "" - }] - }, { - "label": "->add", "kind": 12, - "tags": [], + "label": "->blah", + "sortText": "blah", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 13, "line": 70 }, + "start": { "character": 12, "line": 70 } + } + } + ], "detail": "(Types.context, array) => 't", - "documentation": null, - "sortText": "add", "insertText": "->add", - "additionalTextEdits": [{ - "range": {"start": {"line": 70, "character": 12}, "end": {"line": 70, "character": 13}}, - "newText": "" - }] - }, { - "label": "->addSprite", "kind": 12, - "tags": [], + "label": "->add", + "sortText": "add", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 13, "line": 70 }, + "start": { "character": 12, "line": 70 } + } + } + ], "detail": "(Types.context, string) => Types.comp", - "documentation": null, - "sortText": "addSprite", "insertText": "->addSprite", - "additionalTextEdits": [{ - "range": {"start": {"line": 70, "character": 12}, "end": {"line": 70, "character": 13}}, - "newText": "" - }] - }, { - "label": "->addPosFromVec2", "kind": 12, - "tags": [], + "label": "->addSprite", + "sortText": "addSprite", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 13, "line": 70 }, + "start": { "character": 12, "line": 70 } + } + } + ], "detail": "(Types.context, Types.vec2) => Types.comp", - "documentation": null, - "sortText": "addPosFromVec2", "insertText": "->addPosFromVec2", - "additionalTextEdits": [{ - "range": {"start": {"line": 70, "character": 12}, "end": {"line": 70, "character": 13}}, - "newText": "" - }] - }, { - "label": "->addPos", "kind": 12, - "tags": [], + "label": "->addPosFromVec2", + "sortText": "addPosFromVec2", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 13, "line": 70 }, + "start": { "character": 12, "line": 70 } + } + } + ], "detail": "(Types.context, float, float) => Types.comp", - "documentation": null, - "sortText": "addPos", "insertText": "->addPos", - "additionalTextEdits": [{ - "range": {"start": {"line": 70, "character": 12}, "end": {"line": 70, "character": 13}}, - "newText": "" - }] - }] + "kind": 12, + "label": "->addPos", + "sortText": "addPos", + "tags": [] + } +] Complete src/IncludeModuleCompletion.res 85:16 posCursor:[85:16] posNoWhite:[85:15] Found expr:[85:13->85:16] @@ -211,19 +260,25 @@ ContextPath Value[a] Path a Path Stdlib.Int.l Path l -[{ - "label": "->lex", - "kind": 12, - "tags": [], +[ + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 85 }, + "start": { "character": 14, "line": 85 } + } + } + ], "detail": "int => string", - "documentation": null, - "sortText": "lex", "insertText": "->lex", - "additionalTextEdits": [{ - "range": {"start": {"line": 85, "character": 14}, "end": {"line": 85, "character": 15}}, - "newText": "" - }] - }] + "kind": 12, + "label": "->lex", + "sortText": "lex", + "tags": [] + } +] Complete src/IncludeModuleCompletion.res 88:14 posCursor:[88:14] posNoWhite:[88:13] Found expr:[88:13->88:14] @@ -233,11 +288,5 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Value[l] Path l -[{ - "label": "lex", - "kind": 12, - "tags": [], - "detail": "int => string", - "documentation": null - }] +[ { "detail": "int => string", "kind": 12, "label": "lex", "tags": [] } ] diff --git a/tests/analysis_tests/tests/src/expected/InlayHint.res.txt b/tests/analysis_tests/tests/src/expected/InlayHint.res.txt index aad649db3b9..62c21eb99a5 100644 --- a/tests/analysis_tests/tests/src/expected/InlayHint.res.txt +++ b/tests/analysis_tests/tests/src/expected/InlayHint.res.txt @@ -1,81 +1,95 @@ Inlay Hint src/InlayHint.res 1:34 -[{ - "position": {"line": 33, "character": 14}, - "label": ": int", +[ + { "kind": 1, + "label": ": int", "paddingLeft": true, - "paddingRight": false -}, { - "position": {"line": 33, "character": 9}, - "label": ": string", + "paddingRight": false, + "position": { "character": 14, "line": 33 } + }, + { "kind": 1, + "label": ": string", "paddingLeft": true, - "paddingRight": false -}, { - "position": {"line": 28, "character": 9}, - "label": ": foo", + "paddingRight": false, + "position": { "character": 9, "line": 33 } + }, + { "kind": 1, + "label": ": foo", "paddingLeft": true, - "paddingRight": false -}, { - "position": {"line": 26, "character": 23}, - "label": ": (string, string)", + "paddingRight": false, + "position": { "character": 9, "line": 28 } + }, + { "kind": 1, + "label": ": (string, string)", "paddingLeft": true, - "paddingRight": false -}, { - "position": {"line": 18, "character": 9}, - "label": ": string", + "paddingRight": false, + "position": { "character": 23, "line": 26 } + }, + { "kind": 1, + "label": ": string", "paddingLeft": true, - "paddingRight": false -}, { - "position": {"line": 16, "character": 9}, - "label": ": (string, string)", + "paddingRight": false, + "position": { "character": 9, "line": 18 } + }, + { "kind": 1, + "label": ": (string, string)", "paddingLeft": true, - "paddingRight": false -}, { - "position": {"line": 10, "character": 10}, - "label": ": (~xx: int) => int", + "paddingRight": false, + "position": { "character": 9, "line": 16 } + }, + { "kind": 1, + "label": ": (~xx: int) => int", "paddingLeft": true, - "paddingRight": false -}, { - "position": {"line": 8, "character": 10}, - "label": ": int", + "paddingRight": false, + "position": { "character": 10, "line": 10 } + }, + { "kind": 1, + "label": ": int", "paddingLeft": true, - "paddingRight": false -}, { - "position": {"line": 6, "character": 7}, - "label": ": (int, int) => int", + "paddingRight": false, + "position": { "character": 10, "line": 8 } + }, + { "kind": 1, + "label": ": (int, int) => int", "paddingLeft": true, - "paddingRight": false -}, { - "position": {"line": 4, "character": 8}, - "label": ": char", + "paddingRight": false, + "position": { "character": 7, "line": 6 } + }, + { "kind": 1, + "label": ": char", "paddingLeft": true, - "paddingRight": false -}, { - "position": {"line": 3, "character": 9}, - "label": ": float", + "paddingRight": false, + "position": { "character": 8, "line": 4 } + }, + { "kind": 1, + "label": ": float", "paddingLeft": true, - "paddingRight": false -}, { - "position": {"line": 2, "character": 10}, - "label": ": int", + "paddingRight": false, + "position": { "character": 9, "line": 3 } + }, + { "kind": 1, + "label": ": int", "paddingLeft": true, - "paddingRight": false -}, { - "position": {"line": 1, "character": 10}, - "label": ": string", + "paddingRight": false, + "position": { "character": 10, "line": 2 } + }, + { "kind": 1, + "label": ": string", "paddingLeft": true, - "paddingRight": false -}] + "paddingRight": false, + "position": { "character": 10, "line": 1 } + } +] diff --git a/tests/analysis_tests/tests/src/expected/Jsx2.res.txt b/tests/analysis_tests/tests/src/expected/Jsx2.res.txt index 66920cb6331..de0ac1c3bb8 100644 --- a/tests/analysis_tests/tests/src/expected/Jsx2.res.txt +++ b/tests/analysis_tests/tests/src/expected/Jsx2.res.txt @@ -1,5 +1,11 @@ Definition src/Jsx2.res 5:9 -{"uri": "Jsx2.res", "range": {"start": {"line": 2, "character": 6}, "end": {"line": 2, "character": 10}}} +{ + "range": { + "end": { "character": 10, "line": 2 }, + "start": { "character": 6, "line": 2 } + }, + "uri": "file:///Jsx2.res" +} Complete src/Jsx2.res 8:15 posCursor:[8:15] posNoWhite:[8:14] Found expr:[8:3->8:15] @@ -18,19 +24,10 @@ Completable: Cjsx([M], f, [second, f]) Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib Path M.make -[{ - "label": "first", - "kind": 4, - "tags": [], - "detail": "string", - "documentation": null - }, { - "label": "fun", - "kind": 4, - "tags": [], - "detail": "option", - "documentation": null - }] +[ + { "detail": "string", "kind": 4, "label": "first", "tags": [] }, + { "detail": "option", "kind": 4, "label": "fun", "tags": [] } +] Complete src/Jsx2.res 14:13 posCursor:[14:13] posNoWhite:[14:12] Found expr:[14:11->14:13] @@ -40,35 +37,18 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Module[M] Path M -[{ - "label": "M", - "kind": 9, - "tags": [], - "detail": "module M", - "documentation": null - }, { - "label": "Math", - "kind": 9, - "tags": [], - "detail": "module Math", - "documentation": null - }, { - "label": "Map", +[ + { "detail": "module M", "kind": 9, "label": "M", "tags": [] }, + { "detail": "module Math", "kind": 9, "label": "Math", "tags": [] }, + { "detail": "module Map", "kind": 9, "label": "Map", "tags": [] }, + { + "data": { "modulePath": "ModuleStuff", "filePath": "src/Jsx2.res" }, + "detail": "module ModuleStuff", "kind": 9, - "tags": [], - "detail": "module Map", - "documentation": null - }, { "label": "ModuleStuff", - "kind": 9, - "tags": [], - "detail": "module ModuleStuff", - "documentation": null, - "data": { - "modulePath": "ModuleStuff", - "filePath": "src/Jsx2.res" - } - }] + "tags": [] + } +] Complete src/Jsx2.res 22:19 posCursor:[22:19] posNoWhite:[22:18] Found expr:[22:3->22:19] @@ -77,13 +57,7 @@ Completable: Cjsx([M], k, [prop, k]) Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib Path M.make -[{ - "label": "key", - "kind": 4, - "tags": [], - "detail": "string", - "documentation": null - }] +[ { "detail": "string", "kind": 4, "label": "key", "tags": [] } ] Complete src/Jsx2.res 25:17 posCursor:[25:17] posNoWhite:[25:16] Found expr:[25:3->25:17] @@ -92,13 +66,7 @@ Completable: Cjsx([M], k, [prop, k]) Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib Path M.make -[{ - "label": "key", - "kind": 4, - "tags": [], - "detail": "string", - "documentation": null - }] +[ { "detail": "string", "kind": 4, "label": "key", "tags": [] } ] Complete src/Jsx2.res 28:21 posCursor:[28:21] posNoWhite:[28:20] Found expr:[28:3->28:21] @@ -107,13 +75,7 @@ Completable: Cjsx([M], k, [prop, k]) Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib Path M.make -[{ - "label": "key", - "kind": 4, - "tags": [], - "detail": "string", - "documentation": null - }] +[ { "detail": "string", "kind": 4, "label": "key", "tags": [] } ] Complete src/Jsx2.res 31:24 posCursor:[31:24] posNoWhite:[31:23] Found expr:[31:3->31:24] @@ -122,13 +84,7 @@ Completable: Cjsx([M], k, [prop, k]) Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib Path M.make -[{ - "label": "key", - "kind": 4, - "tags": [], - "detail": "string", - "documentation": null - }] +[ { "detail": "string", "kind": 4, "label": "key", "tags": [] } ] Complete src/Jsx2.res 34:18 posCursor:[34:18] posNoWhite:[34:17] Found expr:[34:3->34:18] @@ -137,13 +93,7 @@ Completable: Cjsx([M], k, [prop, k]) Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib Path M.make -[{ - "label": "key", - "kind": 4, - "tags": [], - "detail": "string", - "documentation": null - }] +[ { "detail": "string", "kind": 4, "label": "key", "tags": [] } ] Complete src/Jsx2.res 37:16 posCursor:[37:16] posNoWhite:[37:15] Found expr:[37:3->37:16] @@ -152,13 +102,7 @@ Completable: Cjsx([M], k, [prop, k]) Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib Path M.make -[{ - "label": "key", - "kind": 4, - "tags": [], - "detail": "string", - "documentation": null - }] +[ { "detail": "string", "kind": 4, "label": "key", "tags": [] } ] Complete src/Jsx2.res 40:17 posCursor:[40:17] posNoWhite:[40:16] Found expr:[40:3->40:17] @@ -167,13 +111,7 @@ Completable: Cjsx([M], k, [prop, k]) Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib Path M.make -[{ - "label": "key", - "kind": 4, - "tags": [], - "detail": "string", - "documentation": null - }] +[ { "detail": "string", "kind": 4, "label": "key", "tags": [] } ] Complete src/Jsx2.res 43:18 posCursor:[43:18] posNoWhite:[43:17] Found expr:[43:3->43:18] @@ -182,13 +120,7 @@ Completable: Cjsx([M], k, [prop, k]) Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib Path M.make -[{ - "label": "key", - "kind": 4, - "tags": [], - "detail": "string", - "documentation": null - }] +[ { "detail": "string", "kind": 4, "label": "key", "tags": [] } ] Complete src/Jsx2.res 46:16 posCursor:[46:16] posNoWhite:[46:15] Found expr:[46:3->46:16] @@ -197,13 +129,7 @@ Completable: Cjsx([M], k, [prop, k]) Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib Path M.make -[{ - "label": "key", - "kind": 4, - "tags": [], - "detail": "string", - "documentation": null - }] +[ { "detail": "string", "kind": 4, "label": "key", "tags": [] } ] Complete src/Jsx2.res 49:27 posCursor:[49:27] posNoWhite:[49:26] Found expr:[49:3->49:27] @@ -212,13 +138,7 @@ Completable: Cjsx([M], k, [prop, k]) Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib Path M.make -[{ - "label": "key", - "kind": 4, - "tags": [], - "detail": "string", - "documentation": null - }] +[ { "detail": "string", "kind": 4, "label": "key", "tags": [] } ] Complete src/Jsx2.res 52:38 posCursor:[52:38] posNoWhite:[52:37] Found expr:[52:3->52:38] @@ -227,13 +147,7 @@ Completable: Cjsx([M], k, [prop, k]) Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib Path M.make -[{ - "label": "key", - "kind": 4, - "tags": [], - "detail": "string", - "documentation": null - }] +[ { "detail": "string", "kind": 4, "label": "key", "tags": [] } ] Complete src/Jsx2.res 55:25 posCursor:[55:25] posNoWhite:[55:24] Found expr:[55:3->55:25] @@ -242,16 +156,16 @@ Completable: Cjsx([M], k, [prop, k]) Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib Path M.make -[{ - "label": "key", - "kind": 4, - "tags": [], - "detail": "string", - "documentation": null - }] +[ { "detail": "string", "kind": 4, "label": "key", "tags": [] } ] Definition src/Jsx2.res 58:11 -{"uri": "Component.res", "range": {"start": {"line": 1, "character": 4}, "end": {"line": 1, "character": 8}}} +{ + "range": { + "end": { "character": 8, "line": 1 }, + "start": { "character": 4, "line": 1 } + }, + "uri": "file:///Component.resi" +} Complete src/Jsx2.res 68:10 posCursor:[68:10] posNoWhite:[68:9] Found expr:[68:3->68:10] @@ -260,13 +174,7 @@ Completable: Cjsx([Ext], al, [al]) Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib Path Ext.make -[{ - "label": "align", - "kind": 4, - "tags": [], - "detail": "option", - "documentation": null - }] +[ { "detail": "option", "kind": 4, "label": "align", "tags": [] } ] Complete src/Jsx2.res 71:11 posCursor:[71:11] posNoWhite:[71:10] Found expr:[71:3->71:11] @@ -284,13 +192,7 @@ Completable: Cjsx([M], k, [first, k]) Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib Path M.make -[{ - "label": "key", - "kind": 4, - "tags": [], - "detail": "string", - "documentation": null - }] +[ { "detail": "string", "kind": 4, "label": "key", "tags": [] } ] Complete src/Jsx2.res 77:23 posCursor:[77:23] posNoWhite:[77:22] Found expr:[77:3->77:23] @@ -299,13 +201,7 @@ Completable: Cjsx([M], k, [first, k]) Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib Path M.make -[{ - "label": "key", - "kind": 4, - "tags": [], - "detail": "string", - "documentation": null - }] +[ { "detail": "string", "kind": 4, "label": "key", "tags": [] } ] Complete src/Jsx2.res 80:6 posCursor:[80:6] posNoWhite:[80:5] Found expr:[80:3->85:69] @@ -324,13 +220,14 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Module[WithChildren] Path WithChildren -[{ - "label": "WithChildren", - "kind": 9, - "tags": [], +[ + { "detail": "module WithChildren", - "documentation": null - }] + "kind": 9, + "label": "WithChildren", + "tags": [] + } +] Complete src/Jsx2.res 91:18 posCursor:[91:18] posNoWhite:[91:17] Found expr:[91:3->91:18] @@ -339,13 +236,7 @@ Completable: Cjsx([WithChildren], n, [n]) Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib Path WithChildren.make -[{ - "label": "name", - "kind": 4, - "tags": [], - "detail": "string", - "documentation": null - }] +[ { "detail": "string", "kind": 4, "label": "name", "tags": [] } ] Complete src/Jsx2.res 94:18 posCursor:[94:18] posNoWhite:[94:17] Found pattern:[94:7->94:18] @@ -356,13 +247,18 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Type[React, e] Path React.e -[{ - "label": "element", - "kind": 22, - "tags": [], +[ + { "detail": "type element", - "documentation": {"kind": "markdown", "value": "```rescript\ntype element = Jsx.element\n```"} - }] + "documentation": { + "kind": "markdown", + "value": "```rescript\ntype element = Jsx.element\n```" + }, + "kind": 22, + "label": "element", + "tags": [] + } +] Complete src/Jsx2.res 96:20 posCursor:[96:20] posNoWhite:[96:19] Found pattern:[96:7->99:6] @@ -396,13 +292,7 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Value[DefineSomeFields, ""] Path DefineSomeFields. -[{ - "label": "thisValue", - "kind": 12, - "tags": [], - "detail": "int", - "documentation": null - }] +[ { "detail": "int", "kind": 12, "label": "thisValue", "tags": [] } ] Complete src/Jsx2.res 108:36 posCursor:[108:36] posNoWhite:[108:35] Found expr:[108:11->108:36] @@ -414,19 +304,28 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Module[DefineSomeFields].th Path DefineSomeFields.th -[{ - "label": "thisField", - "kind": 5, - "tags": [], +[ + { "detail": "int", - "documentation": {"kind": "markdown", "value": "```rescript\nthisField: int\n```\n\n```rescript\ntype r = {thisField: int, thatField: string}\n```"} - }, { - "label": "thatField", + "documentation": { + "kind": "markdown", + "value": "```rescript\nthisField: int\n```\n\n```rescript\ntype r = {thisField: int, thatField: string}\n```" + }, "kind": 5, - "tags": [], + "label": "thisField", + "tags": [] + }, + { "detail": "string", - "documentation": {"kind": "markdown", "value": "```rescript\nthatField: string\n```\n\n```rescript\ntype r = {thisField: int, thatField: string}\n```"} - }] + "documentation": { + "kind": "markdown", + "value": "```rescript\nthatField: string\n```\n\n```rescript\ntype r = {thisField: int, thatField: string}\n```" + }, + "kind": 5, + "label": "thatField", + "tags": [] + } +] Complete src/Jsx2.res 122:20 posCursor:[122:20] posNoWhite:[122:19] Found expr:[121:2->125:4] @@ -438,13 +337,7 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Value[Outer, Inner, h] Path Outer.Inner.h -[{ - "label": "hello", - "kind": 12, - "tags": [], - "detail": "int", - "documentation": null - }] +[ { "detail": "int", "kind": 12, "label": "hello", "tags": [] } ] Complete src/Jsx2.res 129:19 posCursor:[129:19] posNoWhite:[129:18] Found expr:[128:2->131:9] @@ -456,13 +349,7 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Value[Outer, Inner, ""] Path Outer.Inner. -[{ - "label": "hello", - "kind": 12, - "tags": [], - "detail": "int", - "documentation": null - }] +[ { "detail": "int", "kind": 12, "label": "hello", "tags": [] } ] Complete src/Jsx2.res 136:7 posCursor:[136:7] posNoWhite:[136:6] Found expr:[135:2->138:9] @@ -473,16 +360,17 @@ Resolved opens 1 Stdlib ContextPath CJsxPropValue [div] x Path ReactDOM.domProps Path JsxDOM.domProps -[{ - "label": "\"\"", - "kind": 12, - "tags": [], +[ + { "detail": "string", - "documentation": null, - "sortText": "A", "insertText": "{\"$0\"}", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 12, + "label": "\"\"", + "sortText": "A", + "tags": [] + } +] Complete src/Jsx2.res 150:21 posCursor:[150:21] posNoWhite:[150:20] Found expr:[150:11->150:32] @@ -492,13 +380,7 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Module[Nested, Co] Path Nested.Co -[{ - "label": "Comp", - "kind": 9, - "tags": [], - "detail": "module Comp", - "documentation": null - }] +[ { "detail": "module Comp", "kind": 9, "label": "Comp", "tags": [] } ] Complete src/Jsx2.res 153:19 posCursor:[153:19] posNoWhite:[153:18] Found expr:[153:11->153:25] @@ -508,17 +390,21 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Module[Nested, ""] Path Nested. -[{ - "label": "Comp", - "kind": 9, - "tags": [], - "detail": "module Comp", - "documentation": null - }] +[ { "detail": "module Comp", "kind": 9, "label": "Comp", "tags": [] } ] Hover src/Jsx2.res 162:12 -{"contents": {"kind": "markdown", "value": "```rescript\nComp.props\n```\n\n---\n\n```\n \n```\n```rescript\ntype Comp.props<'age> = {age: 'age}\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22Jsx2.res%22%2C157%2C2%5D)\n"}} +{ + "contents": { + "kind": "markdown", + "value": "```rescript\nComp.props\n```\n\n---\n\n```\n \n```\n```rescript\ntype Comp.props<'age> = {age: 'age}\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22Jsx2.res%22%2C157%2C2%5D)\n" + } +} Hover src/Jsx2.res 167:16 -{"contents": {"kind": "markdown", "value": "```rescript\nComp.props\n```\n\n---\n\n```\n \n```\n```rescript\ntype Comp.props<'age> = {age: 'age}\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22Jsx2.res%22%2C157%2C2%5D)\n"}} +{ + "contents": { + "kind": "markdown", + "value": "```rescript\nComp.props\n```\n\n---\n\n```\n \n```\n```rescript\ntype Comp.props<'age> = {age: 'age}\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22Jsx2.res%22%2C157%2C2%5D)\n" + } +} diff --git a/tests/analysis_tests/tests/src/expected/Jsx2.resi.txt b/tests/analysis_tests/tests/src/expected/Jsx2.resi.txt index c34ab6fca53..027b2ab45ad 100644 --- a/tests/analysis_tests/tests/src/expected/Jsx2.resi.txt +++ b/tests/analysis_tests/tests/src/expected/Jsx2.resi.txt @@ -1,8 +1,13 @@ Hover src/Jsx2.resi 1:4 -{"contents": {"kind": "markdown", "value": "```rescript\nprops\n```\n\n---\n\n```\n \n```\n```rescript\ntype props<'first> = {first: 'first}\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22Jsx2.resi%22%2C0%2C0%5D)\n"}} +{ + "contents": { + "kind": "markdown", + "value": "```rescript\nprops\n```\n\n---\n\n```\n \n```\n```rescript\ntype props<'first> = {first: 'first}\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22Jsx2.resi%22%2C0%2C0%5D)\n" + } +} Hover src/Jsx2.resi 4:4 -{"contents": {"kind": "markdown", "value": "```rescript\nint\n```"}} +{ "contents": { "kind": "markdown", "value": "```rescript\nint\n```" } } Complete src/Jsx2.resi 7:19 posCursor:[7:19] posNoWhite:[7:18] Found type:[7:12->7:19] @@ -12,13 +17,18 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Type[React, e] Path React.e -[{ - "label": "element", - "kind": 22, - "tags": [], +[ + { "detail": "type element", - "documentation": {"kind": "markdown", "value": "```rescript\ntype element = Jsx.element\n```"} - }] + "documentation": { + "kind": "markdown", + "value": "```rescript\ntype element = Jsx.element\n```" + }, + "kind": 22, + "label": "element", + "tags": [] + } +] Complete src/Jsx2.resi 10:18 posCursor:[10:18] posNoWhite:[10:17] Found type:[10:11->10:18] @@ -28,11 +38,16 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Type[React, e] Path React.e -[{ - "label": "element", - "kind": 22, - "tags": [], +[ + { "detail": "type element", - "documentation": {"kind": "markdown", "value": "```rescript\ntype element = Jsx.element\n```"} - }] + "documentation": { + "kind": "markdown", + "value": "```rescript\ntype element = Jsx.element\n```" + }, + "kind": 22, + "label": "element", + "tags": [] + } +] diff --git a/tests/analysis_tests/tests/src/expected/JsxV4.res.txt b/tests/analysis_tests/tests/src/expected/JsxV4.res.txt index 5c8085c298a..fc75beafb13 100644 --- a/tests/analysis_tests/tests/src/expected/JsxV4.res.txt +++ b/tests/analysis_tests/tests/src/expected/JsxV4.res.txt @@ -1,5 +1,11 @@ Definition src/JsxV4.res 8:9 -{"uri": "JsxV4.res", "range": {"start": {"line": 5, "character": 6}, "end": {"line": 5, "character": 10}}} +{ + "range": { + "end": { "character": 10, "line": 5 }, + "start": { "character": 6, "line": 5 } + }, + "uri": "file:///JsxV4.res" +} Complete src/JsxV4.res 11:20 posCursor:[11:20] posNoWhite:[11:19] Found expr:[11:3->11:20] @@ -8,16 +14,15 @@ Completable: Cjsx([M4], f, [first, f]) Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib Path M4.make -[{ - "label": "fun", - "kind": 4, - "tags": [], - "detail": "option", - "documentation": null - }] +[ { "detail": "option", "kind": 4, "label": "fun", "tags": [] } ] Hover src/JsxV4.res 14:9 -{"contents": {"kind": "markdown", "value": "```rescript\nReact.component>\n```\n---\n Doc Comment For M4 \n\n---\n\n```\n \n```\n```rescript\ntype React.component<'props> = Jsx.component<'props>\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22React.res%22%2C13%2C0%5D)\n\n\n---\n\n```\n \n```\n```rescript\ntype M4.props<'first, 'fun, 'second> = {\n first: 'first,\n fun?: 'fun,\n second?: 'second,\n}\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22JsxV4.res%22%2C3%2C2%5D)\n"}} +{ + "contents": { + "kind": "markdown", + "value": "```rescript\nReact.component>\n```\n---\n Doc Comment For M4 \n\n---\n\n```\n \n```\n```rescript\ntype React.component<'props> = Jsx.component<'props>\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22React.res%22%2C13%2C0%5D)\n\n\n---\n\n```\n \n```\n```rescript\ntype M4.props<'first, 'fun, 'second> = {\n first: 'first,\n fun?: 'fun,\n second?: 'second,\n}\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22JsxV4.res%22%2C3%2C2%5D)\n" + } +} Create Interface src/JsxV4.res module M4: { diff --git a/tests/analysis_tests/tests/src/expected/LongIdentTest.res.txt b/tests/analysis_tests/tests/src/expected/LongIdentTest.res.txt index 1c12fccf8e1..71897e76d4b 100644 --- a/tests/analysis_tests/tests/src/expected/LongIdentTest.res.txt +++ b/tests/analysis_tests/tests/src/expected/LongIdentTest.res.txt @@ -1,3 +1,3 @@ Hover src/LongIdentTest.res 2:13 -{"contents": {"kind": "markdown", "value": "```rescript\nint\n```"}} +{ "contents": { "kind": "markdown", "value": "```rescript\nint\n```" } } diff --git a/tests/analysis_tests/tests/src/expected/NestedRecords.res.txt b/tests/analysis_tests/tests/src/expected/NestedRecords.res.txt index c417c159323..0b948732960 100644 --- a/tests/analysis_tests/tests/src/expected/NestedRecords.res.txt +++ b/tests/analysis_tests/tests/src/expected/NestedRecords.res.txt @@ -9,7 +9,12 @@ ContextPath Value[options] Path options Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib -{"contents": {"kind": "markdown", "value": "```rescript\noptions\n```\n\n---\n\n```\n \n```\n```rescript\ntype options = {\n extra: {name: string, superExtra: {age: int}},\n}\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22NestedRecords.res%22%2C1%2C0%5D)\n\n\n---\n\n```\n \n```\n```rescript\ntype options.extra = {name: string, superExtra: {age: int}}\n```\n"}} +{ + "contents": { + "kind": "markdown", + "value": "```rescript\noptions\n```\n\n---\n\n```\n \n```\n```rescript\ntype options = {\n extra: {name: string, superExtra: {age: int}},\n}\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22NestedRecords.res%22%2C1%2C0%5D)\n\n\n---\n\n```\n \n```\n```rescript\ntype options.extra = {name: string, superExtra: {age: int}}\n```\n" + } +} Hover src/NestedRecords.res 20:13 Nothing at that position. Now trying to use completion. @@ -29,7 +34,12 @@ Path NestedRecords.extra Path extra Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib -{"contents": {"kind": "markdown", "value": "```rescript\ntype options.extra = {name: string, superExtra: {age: int}}\n```"}} +{ + "contents": { + "kind": "markdown", + "value": "```rescript\ntype options.extra = {name: string, superExtra: {age: int}}\n```" + } +} Hover src/NestedRecords.res 23:26 Nothing at that position. Now trying to use completion. @@ -63,7 +73,12 @@ Path NestedRecords.superExtra Path superExtra Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib -{"contents": {"kind": "markdown", "value": "```rescript\ntype options.extra.superExtra = {age: int}\n```"}} +{ + "contents": { + "kind": "markdown", + "value": "```rescript\ntype options.extra.superExtra = {age: int}\n```" + } +} Hover src/NestedRecords.res 26:29 Nothing at that position. Now trying to use completion. @@ -125,5 +140,5 @@ Path NestedRecords.age Path age Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib -{"contents": {"kind": "markdown", "value": "```rescript\nint\n```"}} +{ "contents": { "kind": "markdown", "value": "```rescript\nint\n```" } } diff --git a/tests/analysis_tests/tests/src/expected/NestedRecordsHover.res.txt b/tests/analysis_tests/tests/src/expected/NestedRecordsHover.res.txt index d0a0dc63b89..04b0c039ae7 100644 --- a/tests/analysis_tests/tests/src/expected/NestedRecordsHover.res.txt +++ b/tests/analysis_tests/tests/src/expected/NestedRecordsHover.res.txt @@ -1,15 +1,40 @@ Hover src/NestedRecordsHover.res 8:7 -{"contents": {"kind": "markdown", "value": "```rescript\noptions\n```\n\n---\n\n```\n \n```\n```rescript\ntype options = {\n extra?: {\n name: string,\n superExtra?: {age: int},\n otherExtra: option<\n {\n test: bool,\n anotherInlined: {record: bool},\n },\n >,\n },\n}\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22NestedRecordsHover.res%22%2C0%2C0%5D)\n\n\n---\n\n```\n \n```\n```rescript\ntype options.extra = {\n name: string,\n superExtra?: {age: int},\n otherExtra: option<\n {\n test: bool,\n anotherInlined: {record: bool},\n },\n >,\n}\n```\n"}} +{ + "contents": { + "kind": "markdown", + "value": "```rescript\noptions\n```\n\n---\n\n```\n \n```\n```rescript\ntype options = {\n extra?: {\n name: string,\n superExtra?: {age: int},\n otherExtra: option<\n {\n test: bool,\n anotherInlined: {record: bool},\n },\n >,\n },\n}\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22NestedRecordsHover.res%22%2C0%2C0%5D)\n\n\n---\n\n```\n \n```\n```rescript\ntype options.extra = {\n name: string,\n superExtra?: {age: int},\n otherExtra: option<\n {\n test: bool,\n anotherInlined: {record: bool},\n },\n >,\n}\n```\n" + } +} Hover src/NestedRecordsHover.res 11:6 -{"contents": {"kind": "markdown", "value": "```rescript\ntype options.extra = {\n name: string,\n superExtra?: {age: int},\n otherExtra: option<\n {\n test: bool,\n anotherInlined: {record: bool},\n },\n >,\n}\n```"}} +{ + "contents": { + "kind": "markdown", + "value": "```rescript\ntype options.extra = {\n name: string,\n superExtra?: {age: int},\n otherExtra: option<\n {\n test: bool,\n anotherInlined: {record: bool},\n },\n >,\n}\n```" + } +} Hover src/NestedRecordsHover.res 14:8 -{"contents": {"kind": "markdown", "value": "```rescript\ntype options.extra.superExtra = {age: int}\n```"}} +{ + "contents": { + "kind": "markdown", + "value": "```rescript\ntype options.extra.superExtra = {age: int}\n```" + } +} Hover src/NestedRecordsHover.res 18:9 -{"contents": {"kind": "markdown", "value": "```rescript\ntype options.extra.otherExtra = {\n test: bool,\n anotherInlined: {record: bool},\n}\n```"}} +{ + "contents": { + "kind": "markdown", + "value": "```rescript\ntype options.extra.otherExtra = {\n test: bool,\n anotherInlined: {record: bool},\n}\n```" + } +} Hover src/NestedRecordsHover.res 21:11 -{"contents": {"kind": "markdown", "value": "```rescript\ntype options.extra.otherExtra.anotherInlined = {\n record: bool,\n}\n```"}} +{ + "contents": { + "kind": "markdown", + "value": "```rescript\ntype options.extra.otherExtra.anotherInlined = {\n record: bool,\n}\n```" + } +} diff --git a/tests/analysis_tests/tests/src/expected/Patterns.res.txt b/tests/analysis_tests/tests/src/expected/Patterns.res.txt index 43cb4b1fc26..6a3d6c3ef75 100644 --- a/tests/analysis_tests/tests/src/expected/Patterns.res.txt +++ b/tests/analysis_tests/tests/src/expected/Patterns.res.txt @@ -1,12 +1,36 @@ Definition src/Patterns.res 19:10 -{"uri": "Patterns.res", "range": {"start": {"line": 3, "character": 7}, "end": {"line": 3, "character": 10}}} +{ + "range": { + "end": { "character": 10, "line": 3 }, + "start": { "character": 7, "line": 3 } + }, + "uri": "file:///Patterns.res" +} Definition src/Patterns.res 24:11 -{"uri": "Patterns.res", "range": {"start": {"line": 9, "character": 7}, "end": {"line": 9, "character": 11}}} +{ + "range": { + "end": { "character": 11, "line": 9 }, + "start": { "character": 7, "line": 9 } + }, + "uri": "file:///Patterns.res" +} Definition src/Patterns.res 27:11 -{"uri": "Patterns.res", "range": {"start": {"line": 11, "character": 7}, "end": {"line": 11, "character": 8}}} +{ + "range": { + "end": { "character": 8, "line": 11 }, + "start": { "character": 7, "line": 11 } + }, + "uri": "file:///Patterns.res" +} Definition src/Patterns.res 30:11 -{"uri": "Patterns.res", "range": {"start": {"line": 15, "character": 9}, "end": {"line": 15, "character": 11}}} +{ + "range": { + "end": { "character": 11, "line": 15 }, + "start": { "character": 9, "line": 15 } + }, + "uri": "file:///Patterns.res" +} diff --git a/tests/analysis_tests/tests/src/expected/PolyRec.res.txt b/tests/analysis_tests/tests/src/expected/PolyRec.res.txt index 64c790174bd..db379b2ce48 100644 --- a/tests/analysis_tests/tests/src/expected/PolyRec.res.txt +++ b/tests/analysis_tests/tests/src/expected/PolyRec.res.txt @@ -1,3 +1,8 @@ Hover src/PolyRec.res 12:10 -{"contents": {"kind": "markdown", "value": "```rescript\n([#Leaf | #Node(int, 'a, 'a)] as 'a)\n```"}} +{ + "contents": { + "kind": "markdown", + "value": "```rescript\n([#Leaf | #Node(int, 'a, 'a)] as 'a)\n```" + } +} diff --git a/tests/analysis_tests/tests/src/expected/PrepareRename.res.txt b/tests/analysis_tests/tests/src/expected/PrepareRename.res.txt index bb418cc27a9..bba85be51cc 100644 --- a/tests/analysis_tests/tests/src/expected/PrepareRename.res.txt +++ b/tests/analysis_tests/tests/src/expected/PrepareRename.res.txt @@ -1,12 +1,18 @@ PrepareRename src/PrepareRename.res 0:4 { - "range": {"start": {"line": 0, "character": 4}, "end": {"line": 0, "character": 5}}, - "placeholder": "x" - } + "range": { + "end": { "character": 5, "line": 0 }, + "start": { "character": 4, "line": 0 } + }, + "placeholder": "x" +} PrepareRename src/PrepareRename.res 3:19 { - "range": {"start": {"line": 3, "character": 19}, "end": {"line": 3, "character": 21}}, - "placeholder": "xx" - } + "range": { + "end": { "character": 21, "line": 3 }, + "start": { "character": 19, "line": 3 } + }, + "placeholder": "xx" +} diff --git a/tests/analysis_tests/tests/src/expected/RecModules.res.txt b/tests/analysis_tests/tests/src/expected/RecModules.res.txt index 62e3e825ce5..393cb490023 100644 --- a/tests/analysis_tests/tests/src/expected/RecModules.res.txt +++ b/tests/analysis_tests/tests/src/expected/RecModules.res.txt @@ -1,6 +1,16 @@ Hover src/RecModules.res 18:12 -{"contents": {"kind": "markdown", "value": "```rescript\nmodule C: {\n type t\n let createA: t => A.t\n}\n```"}} +{ + "contents": { + "kind": "markdown", + "value": "```rescript\nmodule C: {\n type t\n let createA: t => A.t\n}\n```" + } +} Hover src/RecModules.res 20:12 -{"contents": {"kind": "markdown", "value": "```rescript\nmodule A: {\n type t\n let child: t => B.t\n}\n```"}} +{ + "contents": { + "kind": "markdown", + "value": "```rescript\nmodule A: {\n type t\n let child: t => B.t\n}\n```" + } +} diff --git a/tests/analysis_tests/tests/src/expected/RecordCompletion.res.txt b/tests/analysis_tests/tests/src/expected/RecordCompletion.res.txt index b4587be81af..1e255e44057 100644 --- a/tests/analysis_tests/tests/src/expected/RecordCompletion.res.txt +++ b/tests/analysis_tests/tests/src/expected/RecordCompletion.res.txt @@ -16,19 +16,28 @@ Path n Path Stdlib.Array.m Path ArrayUtils.m Path m -[{ - "label": "Array.map", - "kind": 12, - "tags": [], +[ + { "detail": "(array<'a>, 'a => 'b) => array<'b>", - "documentation": {"kind": "markdown", "value": "\n`map(array, fn)` returns a new array with all elements from `array`, each element transformed using the provided `fn`.\n\nSee [`Array.map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map) on MDN.\n\n## Examples\n\n```rescript\nlet array = [\"Hello\", \"Hi\", \"Good bye\"]\nlet mappedArray = array->Array.map(greeting => greeting ++ \" to you\")\n\nmappedArray == [\"Hello to you\", \"Hi to you\", \"Good bye to you\"]\n```\n"} - }, { - "label": "Array.mapWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`map(array, fn)` returns a new array with all elements from `array`, each element transformed using the provided `fn`.\n\nSee [`Array.map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map) on MDN.\n\n## Examples\n\n```rescript\nlet array = [\"Hello\", \"Hi\", \"Good bye\"]\nlet mappedArray = array->Array.map(greeting => greeting ++ \" to you\")\n\nmappedArray == [\"Hello to you\", \"Hi to you\", \"Good bye to you\"]\n```\n" + }, "kind": 12, - "tags": [], + "label": "Array.map", + "tags": [] + }, + { "detail": "(array<'a>, ('a, int) => 'b) => array<'b>", - "documentation": {"kind": "markdown", "value": "\n`mapWithIndex(array, fn)` returns a new array with all elements from `array`, each element transformed using the provided `fn`.\n\nSee [`Array.map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map) on MDN.\n\n## Examples\n\n```rescript\nlet array = [\"Hello\", \"Hi\", \"Good bye\"]\nlet mappedArray =\n array->Array.mapWithIndex((greeting, index) => greeting ++ \" at position \" ++ Int.toString(index))\n\nmappedArray == [\"Hello at position 0\", \"Hi at position 1\", \"Good bye at position 2\"]\n```\n"} - }] + "documentation": { + "kind": "markdown", + "value": "\n`mapWithIndex(array, fn)` returns a new array with all elements from `array`, each element transformed using the provided `fn`.\n\nSee [`Array.map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map) on MDN.\n\n## Examples\n\n```rescript\nlet array = [\"Hello\", \"Hi\", \"Good bye\"]\nlet mappedArray =\n array->Array.mapWithIndex((greeting, index) => greeting ++ \" at position \" ++ Int.toString(index))\n\nmappedArray == [\"Hello at position 0\", \"Hi at position 1\", \"Good bye at position 2\"]\n```\n" + }, + "kind": 12, + "label": "Array.mapWithIndex", + "tags": [] + } +] Complete src/RecordCompletion.res 11:13 posCursor:[11:13] posNoWhite:[11:12] Found expr:[11:3->11:13] @@ -62,19 +71,28 @@ Path n Path Stdlib.Array.m Path ArrayUtils.m Path m -[{ - "label": "Array.map", - "kind": 12, - "tags": [], +[ + { "detail": "(array<'a>, 'a => 'b) => array<'b>", - "documentation": {"kind": "markdown", "value": "\n`map(array, fn)` returns a new array with all elements from `array`, each element transformed using the provided `fn`.\n\nSee [`Array.map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map) on MDN.\n\n## Examples\n\n```rescript\nlet array = [\"Hello\", \"Hi\", \"Good bye\"]\nlet mappedArray = array->Array.map(greeting => greeting ++ \" to you\")\n\nmappedArray == [\"Hello to you\", \"Hi to you\", \"Good bye to you\"]\n```\n"} - }, { - "label": "Array.mapWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`map(array, fn)` returns a new array with all elements from `array`, each element transformed using the provided `fn`.\n\nSee [`Array.map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map) on MDN.\n\n## Examples\n\n```rescript\nlet array = [\"Hello\", \"Hi\", \"Good bye\"]\nlet mappedArray = array->Array.map(greeting => greeting ++ \" to you\")\n\nmappedArray == [\"Hello to you\", \"Hi to you\", \"Good bye to you\"]\n```\n" + }, "kind": 12, - "tags": [], + "label": "Array.map", + "tags": [] + }, + { "detail": "(array<'a>, ('a, int) => 'b) => array<'b>", - "documentation": {"kind": "markdown", "value": "\n`mapWithIndex(array, fn)` returns a new array with all elements from `array`, each element transformed using the provided `fn`.\n\nSee [`Array.map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map) on MDN.\n\n## Examples\n\n```rescript\nlet array = [\"Hello\", \"Hi\", \"Good bye\"]\nlet mappedArray =\n array->Array.mapWithIndex((greeting, index) => greeting ++ \" at position \" ++ Int.toString(index))\n\nmappedArray == [\"Hello at position 0\", \"Hi at position 1\", \"Good bye at position 2\"]\n```\n"} - }] + "documentation": { + "kind": "markdown", + "value": "\n`mapWithIndex(array, fn)` returns a new array with all elements from `array`, each element transformed using the provided `fn`.\n\nSee [`Array.map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map) on MDN.\n\n## Examples\n\n```rescript\nlet array = [\"Hello\", \"Hi\", \"Good bye\"]\nlet mappedArray =\n array->Array.mapWithIndex((greeting, index) => greeting ++ \" at position \" ++ Int.toString(index))\n\nmappedArray == [\"Hello at position 0\", \"Hi at position 1\", \"Good bye at position 2\"]\n```\n" + }, + "kind": 12, + "label": "Array.mapWithIndex", + "tags": [] + } +] Complete src/RecordCompletion.res 19:7 posCursor:[19:7] posNoWhite:[19:6] Found expr:[19:3->19:7] @@ -84,13 +102,18 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Module[R]."" Path R. -[{ - "label": "name", - "kind": 5, - "tags": [], +[ + { "detail": "string", - "documentation": {"kind": "markdown", "value": "```rescript\nname: string\n```\n\n```rescript\ntype t = {name: string}\n```"} - }] + "documentation": { + "kind": "markdown", + "value": "```rescript\nname: string\n```\n\n```rescript\ntype t = {name: string}\n```" + }, + "kind": 5, + "label": "name", + "tags": [] + } +] Complete src/RecordCompletion.res 22:7 posCursor:[22:7] posNoWhite:[22:6] Found expr:[22:3->22:10] @@ -100,11 +123,16 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Module[R]."" Path R. -[{ - "label": "name", - "kind": 5, - "tags": [], +[ + { "detail": "string", - "documentation": {"kind": "markdown", "value": "```rescript\nname: string\n```\n\n```rescript\ntype t = {name: string}\n```"} - }] + "documentation": { + "kind": "markdown", + "value": "```rescript\nname: string\n```\n\n```rescript\ntype t = {name: string}\n```" + }, + "kind": 5, + "label": "name", + "tags": [] + } +] diff --git a/tests/analysis_tests/tests/src/expected/RecoveryOnProp.res.txt b/tests/analysis_tests/tests/src/expected/RecoveryOnProp.res.txt index 704c9ccc964..66c291a3e41 100644 --- a/tests/analysis_tests/tests/src/expected/RecoveryOnProp.res.txt +++ b/tests/analysis_tests/tests/src/expected/RecoveryOnProp.res.txt @@ -15,61 +15,57 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Type[Res] Path Res -[{ - "label": "Result", - "kind": 9, - "tags": [], - "detail": "module Result", - "documentation": null - }, { - "label": "RescriptReactErrorBoundary", - "kind": 9, - "tags": [], - "detail": "module RescriptReactErrorBoundary", - "documentation": null, +[ + { "detail": "module Result", "kind": 9, "label": "Result", "tags": [] }, + { "data": { "modulePath": "RescriptReactErrorBoundary", "filePath": "src/RecoveryOnProp.res" - } - }, { - "label": "RescriptReactRouter", + }, + "detail": "module RescriptReactErrorBoundary", "kind": 9, - "tags": [], - "detail": "module RescriptReactRouter", - "documentation": null, + "label": "RescriptReactErrorBoundary", + "tags": [] + }, + { "data": { "modulePath": "RescriptReactRouter", "filePath": "src/RecoveryOnProp.res" - } - }, { - "label": "RescriptTools", + }, + "detail": "module RescriptReactRouter", "kind": 9, - "tags": [], - "detail": "module RescriptTools", - "documentation": null, + "label": "RescriptReactRouter", + "tags": [] + }, + { "data": { "modulePath": "RescriptTools", "filePath": "src/RecoveryOnProp.res" - } - }, { - "label": "RescriptTools_Docgen", + }, + "detail": "module RescriptTools", "kind": 9, - "tags": [], - "detail": "module RescriptTools_Docgen", - "documentation": null, + "label": "RescriptTools", + "tags": [] + }, + { "data": { "modulePath": "RescriptTools_Docgen", "filePath": "src/RecoveryOnProp.res" - } - }, { - "label": "RescriptTools_ExtractCodeBlocks", + }, + "detail": "module RescriptTools_Docgen", "kind": 9, - "tags": [], - "detail": "module RescriptTools_ExtractCodeBlocks", - "documentation": null, + "label": "RescriptTools_Docgen", + "tags": [] + }, + { "data": { "modulePath": "RescriptTools_ExtractCodeBlocks", "filePath": "src/RecoveryOnProp.res" - } - }] + }, + "detail": "module RescriptTools_ExtractCodeBlocks", + "kind": 9, + "label": "RescriptTools_ExtractCodeBlocks", + "tags": [] + } +] diff --git a/tests/analysis_tests/tests/src/expected/References.res.txt b/tests/analysis_tests/tests/src/expected/References.res.txt index 842250d4521..f106eb290c2 100644 --- a/tests/analysis_tests/tests/src/expected/References.res.txt +++ b/tests/analysis_tests/tests/src/expected/References.res.txt @@ -1,31 +1,121 @@ References src/References.res 0:4 [ -{"uri": "Cross.res", "range": {"start": {"line": 0, "character": 26}, "end": {"line": 0, "character": 27}}}, -{"uri": "Cross.res", "range": {"start": {"line": 3, "character": 27}, "end": {"line": 3, "character": 28}}}, -{"uri": "Cross.res", "range": {"start": {"line": 7, "character": 27}, "end": {"line": 7, "character": 28}}}, -{"uri": "References.res", "range": {"start": {"line": 0, "character": 4}, "end": {"line": 0, "character": 5}}}, -{"uri": "References.res", "range": {"start": {"line": 3, "character": 8}, "end": {"line": 3, "character": 9}}}, -{"uri": "References.res", "range": {"start": {"line": 7, "character": 8}, "end": {"line": 7, "character": 9}}} + { + "range": { + "end": { "character": 27, "line": 0 }, + "start": { "character": 26, "line": 0 } + }, + "uri": "file:///Cross.res" + }, + { + "range": { + "end": { "character": 28, "line": 3 }, + "start": { "character": 27, "line": 3 } + }, + "uri": "file:///Cross.res" + }, + { + "range": { + "end": { "character": 28, "line": 7 }, + "start": { "character": 27, "line": 7 } + }, + "uri": "file:///Cross.res" + }, + { + "range": { + "end": { "character": 5, "line": 0 }, + "start": { "character": 4, "line": 0 } + }, + "uri": "file:///References.res" + }, + { + "range": { + "end": { "character": 9, "line": 3 }, + "start": { "character": 8, "line": 3 } + }, + "uri": "file:///References.res" + }, + { + "range": { + "end": { "character": 9, "line": 7 }, + "start": { "character": 8, "line": 7 } + }, + "uri": "file:///References.res" + } ] References src/References.res 9:19 [ -{"uri": "References.res", "range": {"start": {"line": 9, "character": 11}, "end": {"line": 9, "character": 14}}}, -{"uri": "References.res", "range": {"start": {"line": 9, "character": 19}, "end": {"line": 9, "character": 21}}} + { + "range": { + "end": { "character": 14, "line": 9 }, + "start": { "character": 11, "line": 9 } + }, + "uri": "file:///References.res" + }, + { + "range": { + "end": { "character": 21, "line": 9 }, + "start": { "character": 19, "line": 9 } + }, + "uri": "file:///References.res" + } ] References src/References.res 20:12 [ -{"uri": "References.res", "range": {"start": {"line": 13, "character": 2}, "end": {"line": 13, "character": 13}}}, -{"uri": "References.res", "range": {"start": {"line": 18, "character": 11}, "end": {"line": 18, "character": 13}}}, -{"uri": "References.res", "range": {"start": {"line": 20, "character": 11}, "end": {"line": 20, "character": 13}}} + { + "range": { + "end": { "character": 13, "line": 13 }, + "start": { "character": 2, "line": 13 } + }, + "uri": "file:///References.res" + }, + { + "range": { + "end": { "character": 13, "line": 18 }, + "start": { "character": 11, "line": 18 } + }, + "uri": "file:///References.res" + }, + { + "range": { + "end": { "character": 13, "line": 20 }, + "start": { "character": 11, "line": 20 } + }, + "uri": "file:///References.res" + } ] References src/References.res 23:15 [ -{"uri": "ReferencesInner.res", "range": {"start": {"line": 1, "character": 28}, "end": {"line": 1, "character": 32}}}, -{"uri": "References.res", "range": {"start": {"line": 23, "character": 19}, "end": {"line": 23, "character": 23}}}, -{"uri": "ComponentInner.res", "range": {"start": {"line": 1, "character": 4}, "end": {"line": 1, "character": 8}}}, -{"uri": "ComponentInner.resi", "range": {"start": {"line": 1, "character": 4}, "end": {"line": 1, "character": 8}}} + { + "range": { + "end": { "character": 32, "line": 1 }, + "start": { "character": 28, "line": 1 } + }, + "uri": "file:///ReferencesInner.res" + }, + { + "range": { + "end": { "character": 23, "line": 23 }, + "start": { "character": 19, "line": 23 } + }, + "uri": "file:///References.res" + }, + { + "range": { + "end": { "character": 8, "line": 1 }, + "start": { "character": 4, "line": 1 } + }, + "uri": "file:///ComponentInner.resi" + }, + { + "range": { + "end": { "character": 8, "line": 1 }, + "start": { "character": 4, "line": 1 } + }, + "uri": "file:///ComponentInner.resi" + } ] diff --git a/tests/analysis_tests/tests/src/expected/ReferencesWithInterface.res.txt b/tests/analysis_tests/tests/src/expected/ReferencesWithInterface.res.txt index 33f2d105d6b..f782c36af0f 100644 --- a/tests/analysis_tests/tests/src/expected/ReferencesWithInterface.res.txt +++ b/tests/analysis_tests/tests/src/expected/ReferencesWithInterface.res.txt @@ -1,9 +1,39 @@ References src/ReferencesWithInterface.res 0:4 [ -{"uri": "Cross.res", "range": {"start": {"line": 9, "character": 52}, "end": {"line": 9, "character": 53}}}, -{"uri": "Cross.res", "range": {"start": {"line": 12, "character": 53}, "end": {"line": 12, "character": 54}}}, -{"uri": "Cross.res", "range": {"start": {"line": 16, "character": 53}, "end": {"line": 16, "character": 54}}}, -{"uri": "ReferencesWithInterface.resi", "range": {"start": {"line": 0, "character": 4}, "end": {"line": 0, "character": 5}}}, -{"uri": "ReferencesWithInterface.res", "range": {"start": {"line": 0, "character": 4}, "end": {"line": 0, "character": 5}}} + { + "range": { + "end": { "character": 53, "line": 9 }, + "start": { "character": 52, "line": 9 } + }, + "uri": "file:///Cross.res" + }, + { + "range": { + "end": { "character": 54, "line": 12 }, + "start": { "character": 53, "line": 12 } + }, + "uri": "file:///Cross.res" + }, + { + "range": { + "end": { "character": 54, "line": 16 }, + "start": { "character": 53, "line": 16 } + }, + "uri": "file:///Cross.res" + }, + { + "range": { + "end": { "character": 5, "line": 0 }, + "start": { "character": 4, "line": 0 } + }, + "uri": "file:///ReferencesWithInterface.resi" + }, + { + "range": { + "end": { "character": 5, "line": 0 }, + "start": { "character": 4, "line": 0 } + }, + "uri": "file:///ReferencesWithInterface.res" + } ] diff --git a/tests/analysis_tests/tests/src/expected/ReferencesWithInterface.resi.txt b/tests/analysis_tests/tests/src/expected/ReferencesWithInterface.resi.txt index 3e96fbc75c2..29dbae2b2bd 100644 --- a/tests/analysis_tests/tests/src/expected/ReferencesWithInterface.resi.txt +++ b/tests/analysis_tests/tests/src/expected/ReferencesWithInterface.resi.txt @@ -1,9 +1,39 @@ References src/ReferencesWithInterface.resi 0:4 [ -{"uri": "Cross.res", "range": {"start": {"line": 9, "character": 52}, "end": {"line": 9, "character": 53}}}, -{"uri": "Cross.res", "range": {"start": {"line": 12, "character": 53}, "end": {"line": 12, "character": 54}}}, -{"uri": "Cross.res", "range": {"start": {"line": 16, "character": 53}, "end": {"line": 16, "character": 54}}}, -{"uri": "ReferencesWithInterface.res", "range": {"start": {"line": 0, "character": 4}, "end": {"line": 0, "character": 5}}}, -{"uri": "ReferencesWithInterface.resi", "range": {"start": {"line": 0, "character": 4}, "end": {"line": 0, "character": 5}}} + { + "range": { + "end": { "character": 53, "line": 9 }, + "start": { "character": 52, "line": 9 } + }, + "uri": "file:///Cross.res" + }, + { + "range": { + "end": { "character": 54, "line": 12 }, + "start": { "character": 53, "line": 12 } + }, + "uri": "file:///Cross.res" + }, + { + "range": { + "end": { "character": 54, "line": 16 }, + "start": { "character": 53, "line": 16 } + }, + "uri": "file:///Cross.res" + }, + { + "range": { + "end": { "character": 5, "line": 0 }, + "start": { "character": 4, "line": 0 } + }, + "uri": "file:///ReferencesWithInterface.resi" + }, + { + "range": { + "end": { "character": 5, "line": 0 }, + "start": { "character": 4, "line": 0 } + }, + "uri": "file:///ReferencesWithInterface.resi" + } ] diff --git a/tests/analysis_tests/tests/src/expected/Rename.res.txt b/tests/analysis_tests/tests/src/expected/Rename.res.txt index 92c381452c9..b6b193f8d18 100644 --- a/tests/analysis_tests/tests/src/expected/Rename.res.txt +++ b/tests/analysis_tests/tests/src/expected/Rename.res.txt @@ -1,37 +1,53 @@ Rename src/Rename.res 0:4 y [ -{ - "textDocument": { - "version": null, - "uri": "Rename.res" - }, - "edits": [{ - "range": {"start": {"line": 0, "character": 4}, "end": {"line": 0, "character": 5}}, - "newText": "y" - }, { - "range": {"start": {"line": 3, "character": 8}, "end": {"line": 3, "character": 9}}, - "newText": "y" - }, { - "range": {"start": {"line": 7, "character": 8}, "end": {"line": 7, "character": 9}}, - "newText": "y" - }] + { + "edits": [ + { + "newText": "y", + "range": { + "end": { "character": 5, "line": 0 }, + "start": { "character": 4, "line": 0 } + } + }, + { + "newText": "y", + "range": { + "end": { "character": 9, "line": 3 }, + "start": { "character": 8, "line": 3 } + } + }, + { + "newText": "y", + "range": { + "end": { "character": 9, "line": 7 }, + "start": { "character": 8, "line": 7 } + } + } + ], + "textDocument": { "uri": "file:///Rename.res", "version": 0 } } ] Rename src/Rename.res 9:19 yy [ -{ - "textDocument": { - "version": null, - "uri": "Rename.res" - }, - "edits": [{ - "range": {"start": {"line": 9, "character": 11}, "end": {"line": 9, "character": 14}}, - "newText": "yy" - }, { - "range": {"start": {"line": 9, "character": 19}, "end": {"line": 9, "character": 21}}, - "newText": "yy" - }] + { + "edits": [ + { + "newText": "yy", + "range": { + "end": { "character": 14, "line": 9 }, + "start": { "character": 11, "line": 9 } + } + }, + { + "newText": "yy", + "range": { + "end": { "character": 21, "line": 9 }, + "start": { "character": 19, "line": 9 } + } + } + ], + "textDocument": { "uri": "file:///Rename.res", "version": 0 } } ] diff --git a/tests/analysis_tests/tests/src/expected/RenameWithInterface.res.txt b/tests/analysis_tests/tests/src/expected/RenameWithInterface.res.txt index 48ecdabc568..d824b0501dd 100644 --- a/tests/analysis_tests/tests/src/expected/RenameWithInterface.res.txt +++ b/tests/analysis_tests/tests/src/expected/RenameWithInterface.res.txt @@ -1,37 +1,53 @@ Rename src/RenameWithInterface.res 0:4 y [ -{ - "textDocument": { - "version": null, - "uri": "RenameWithInterface.resi" + { + "edits": [ + { + "newText": "y", + "range": { + "end": { "character": 5, "line": 0 }, + "start": { "character": 4, "line": 0 } + } + } + ], + "textDocument": { + "uri": "file:///RenameWithInterface.resi", + "version": 0 + } }, - "edits": [{ - "range": {"start": {"line": 0, "character": 4}, "end": {"line": 0, "character": 5}}, - "newText": "y" - }] + { + "edits": [ + { + "newText": "y", + "range": { + "end": { "character": 5, "line": 0 }, + "start": { "character": 4, "line": 0 } + } + } + ], + "textDocument": { + "uri": "file:///RenameWithInterface.res", + "version": 0 + } }, -{ - "textDocument": { - "version": null, - "uri": "RenameWithInterface.res" - }, - "edits": [{ - "range": {"start": {"line": 0, "character": 4}, "end": {"line": 0, "character": 5}}, - "newText": "y" - }] - }, -{ - "textDocument": { - "version": null, - "uri": "Cross.res" - }, - "edits": [{ - "range": {"start": {"line": 18, "character": 28}, "end": {"line": 18, "character": 29}}, - "newText": "y" - }, { - "range": {"start": {"line": 21, "character": 28}, "end": {"line": 21, "character": 29}}, - "newText": "y" - }] + { + "edits": [ + { + "newText": "y", + "range": { + "end": { "character": 29, "line": 18 }, + "start": { "character": 28, "line": 18 } + } + }, + { + "newText": "y", + "range": { + "end": { "character": 29, "line": 21 }, + "start": { "character": 28, "line": 21 } + } + } + ], + "textDocument": { "uri": "file:///Cross.res", "version": 0 } } ] diff --git a/tests/analysis_tests/tests/src/expected/RenameWithInterface.resi.txt b/tests/analysis_tests/tests/src/expected/RenameWithInterface.resi.txt index 3c5d529093e..dc259e411ae 100644 --- a/tests/analysis_tests/tests/src/expected/RenameWithInterface.resi.txt +++ b/tests/analysis_tests/tests/src/expected/RenameWithInterface.resi.txt @@ -1,37 +1,45 @@ Rename src/RenameWithInterface.resi 0:4 y [ -{ - "textDocument": { - "version": null, - "uri": "RenameWithInterface.resi" + { + "edits": [ + { + "newText": "y", + "range": { + "end": { "character": 5, "line": 0 }, + "start": { "character": 4, "line": 0 } + } + }, + { + "newText": "y", + "range": { + "end": { "character": 5, "line": 0 }, + "start": { "character": 4, "line": 0 } + } + } + ], + "textDocument": { + "uri": "file:///RenameWithInterface.resi", + "version": 0 + } }, - "edits": [{ - "range": {"start": {"line": 0, "character": 4}, "end": {"line": 0, "character": 5}}, - "newText": "y" - }] - }, -{ - "textDocument": { - "version": null, - "uri": "RenameWithInterface.res" - }, - "edits": [{ - "range": {"start": {"line": 0, "character": 4}, "end": {"line": 0, "character": 5}}, - "newText": "y" - }] - }, -{ - "textDocument": { - "version": null, - "uri": "Cross.res" - }, - "edits": [{ - "range": {"start": {"line": 18, "character": 28}, "end": {"line": 18, "character": 29}}, - "newText": "y" - }, { - "range": {"start": {"line": 21, "character": 28}, "end": {"line": 21, "character": 29}}, - "newText": "y" - }] + { + "edits": [ + { + "newText": "y", + "range": { + "end": { "character": 29, "line": 18 }, + "start": { "character": 28, "line": 18 } + } + }, + { + "newText": "y", + "range": { + "end": { "character": 29, "line": 21 }, + "start": { "character": 28, "line": 21 } + } + } + ], + "textDocument": { "uri": "file:///Cross.res", "version": 0 } } ] diff --git a/tests/analysis_tests/tests/src/expected/Reprod.res.txt b/tests/analysis_tests/tests/src/expected/Reprod.res.txt index 08783543a54..a3fc27f052d 100644 --- a/tests/analysis_tests/tests/src/expected/Reprod.res.txt +++ b/tests/analysis_tests/tests/src/expected/Reprod.res.txt @@ -7,16 +7,21 @@ Resolved opens 1 Stdlib ContextPath CArgument Value[Query, use](~variables) ContextPath Value[Query, use] Path Query.use -[{ - "label": "{}", - "kind": 12, - "tags": [], +[ + { "detail": "input_ByAddress", - "documentation": {"kind": "markdown", "value": "```rescript\ntype input_ByAddress = {city: string}\n```"}, - "sortText": "A", + "documentation": { + "kind": "markdown", + "value": "```rescript\ntype input_ByAddress = {city: string}\n```" + }, "insertText": "{$0}", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 12, + "label": "{}", + "sortText": "A", + "tags": [] + } +] Complete src/Reprod.res 33:28 posCursor:[33:28] posNoWhite:[33:27] Found pattern:[33:21->33:31] @@ -25,31 +30,44 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Value[record] Path record -[{ - "label": "One", - "kind": 4, - "tags": [], +[ + { "detail": "One", - "documentation": {"kind": "markdown", "value": "```rescript\nOne\n```\n\n```rescript\ntype someVariant = One | Two(bool) | Three(someRecord, bool)\n```"}, + "documentation": { + "kind": "markdown", + "value": "```rescript\nOne\n```\n\n```rescript\ntype someVariant = One | Two(bool) | Three(someRecord, bool)\n```" + }, "insertText": "One", - "insertTextFormat": 2 - }, { - "label": "Two(_)", + "insertTextFormat": 2, "kind": 4, - "tags": [], + "label": "One", + "tags": [] + }, + { "detail": "Two(bool)", - "documentation": {"kind": "markdown", "value": "```rescript\nTwo(bool)\n```\n\n```rescript\ntype someVariant = One | Two(bool) | Three(someRecord, bool)\n```"}, + "documentation": { + "kind": "markdown", + "value": "```rescript\nTwo(bool)\n```\n\n```rescript\ntype someVariant = One | Two(bool) | Three(someRecord, bool)\n```" + }, "insertText": "Two(${1:_})", - "insertTextFormat": 2 - }, { - "label": "Three(_, _)", + "insertTextFormat": 2, "kind": 4, - "tags": [], + "label": "Two(_)", + "tags": [] + }, + { "detail": "Three(someRecord, bool)", - "documentation": {"kind": "markdown", "value": "```rescript\nThree(someRecord, bool)\n```\n\n```rescript\ntype someVariant = One | Two(bool) | Three(someRecord, bool)\n```"}, + "documentation": { + "kind": "markdown", + "value": "```rescript\nThree(someRecord, bool)\n```\n\n```rescript\ntype someVariant = One | Two(bool) | Three(someRecord, bool)\n```" + }, "insertText": "Three(${1:_}, ${2:_})", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 4, + "label": "Three(_, _)", + "tags": [] + } +] Complete src/Reprod.res 36:29 posCursor:[36:29] posNoWhite:[36:28] Found pattern:[36:21->36:32] @@ -58,16 +76,21 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Value[record] Path record -[{ - "label": "{}", - "kind": 22, - "tags": [], +[ + { "detail": "SchemaAssets.input_ByAddress", - "documentation": {"kind": "markdown", "value": "```rescript\ntype SchemaAssets.input_ByAddress = {city: string}\n```"}, - "sortText": "A", + "documentation": { + "kind": "markdown", + "value": "```rescript\ntype SchemaAssets.input_ByAddress = {city: string}\n```" + }, "insertText": "{$0}", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 22, + "label": "{}", + "sortText": "A", + "tags": [] + } +] Complete src/Reprod.res 43:21 posCursor:[43:21] posNoWhite:[43:20] Found pattern:[43:18->43:22] @@ -79,31 +102,44 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Value[res] Path res -[{ - "label": "One", - "kind": 4, - "tags": [], +[ + { "detail": "One", - "documentation": {"kind": "markdown", "value": "```rescript\nOne\n```\n\n```rescript\ntype someVariant = One | Two(bool) | Three(someRecord, bool)\n```"}, + "documentation": { + "kind": "markdown", + "value": "```rescript\nOne\n```\n\n```rescript\ntype someVariant = One | Two(bool) | Three(someRecord, bool)\n```" + }, "insertText": "One", - "insertTextFormat": 2 - }, { - "label": "Two(_)", + "insertTextFormat": 2, "kind": 4, - "tags": [], + "label": "One", + "tags": [] + }, + { "detail": "Two(bool)", - "documentation": {"kind": "markdown", "value": "```rescript\nTwo(bool)\n```\n\n```rescript\ntype someVariant = One | Two(bool) | Three(someRecord, bool)\n```"}, + "documentation": { + "kind": "markdown", + "value": "```rescript\nTwo(bool)\n```\n\n```rescript\ntype someVariant = One | Two(bool) | Three(someRecord, bool)\n```" + }, "insertText": "Two(${1:_})", - "insertTextFormat": 2 - }, { - "label": "Three(_, _)", + "insertTextFormat": 2, "kind": 4, - "tags": [], + "label": "Two(_)", + "tags": [] + }, + { "detail": "Three(someRecord, bool)", - "documentation": {"kind": "markdown", "value": "```rescript\nThree(someRecord, bool)\n```\n\n```rescript\ntype someVariant = One | Two(bool) | Three(someRecord, bool)\n```"}, + "documentation": { + "kind": "markdown", + "value": "```rescript\nThree(someRecord, bool)\n```\n\n```rescript\ntype someVariant = One | Two(bool) | Three(someRecord, bool)\n```" + }, "insertText": "Three(${1:_}, ${2:_})", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 4, + "label": "Three(_, _)", + "tags": [] + } +] Complete src/Reprod.res 46:24 posCursor:[46:24] posNoWhite:[46:23] Found pattern:[46:18->46:25] @@ -115,31 +151,44 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Value[res] Path res -[{ - "label": "#one", - "kind": 4, - "tags": [], +[ + { "detail": "#one", - "documentation": {"kind": "markdown", "value": "```rescript\n#one\n```\n\n```rescript\n[#one | #three(someRecord, bool) | #two(bool)]\n```"}, + "documentation": { + "kind": "markdown", + "value": "```rescript\n#one\n```\n\n```rescript\n[#one | #three(someRecord, bool) | #two(bool)]\n```" + }, "insertText": "#one", - "insertTextFormat": 2 - }, { - "label": "#three(_, _)", + "insertTextFormat": 2, "kind": 4, - "tags": [], + "label": "#one", + "tags": [] + }, + { "detail": "#three(someRecord, bool)", - "documentation": {"kind": "markdown", "value": "```rescript\n#three(someRecord, bool)\n```\n\n```rescript\n[#one | #three(someRecord, bool) | #two(bool)]\n```"}, + "documentation": { + "kind": "markdown", + "value": "```rescript\n#three(someRecord, bool)\n```\n\n```rescript\n[#one | #three(someRecord, bool) | #two(bool)]\n```" + }, "insertText": "#three(${1:_}, ${2:_})", - "insertTextFormat": 2 - }, { - "label": "#two(_)", + "insertTextFormat": 2, "kind": 4, - "tags": [], + "label": "#three(_, _)", + "tags": [] + }, + { "detail": "#two(bool)", - "documentation": {"kind": "markdown", "value": "```rescript\n#two(bool)\n```\n\n```rescript\n[#one | #three(someRecord, bool) | #two(bool)]\n```"}, + "documentation": { + "kind": "markdown", + "value": "```rescript\n#two(bool)\n```\n\n```rescript\n[#one | #three(someRecord, bool) | #two(bool)]\n```" + }, "insertText": "#two(${1:_})", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 4, + "label": "#two(_)", + "tags": [] + } +] Complete src/Reprod.res 51:24 posCursor:[51:24] posNoWhite:[51:23] Found pattern:[51:21->51:25] @@ -151,45 +200,66 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Value[resOpt] Path resOpt -[{ - "label": "None", - "kind": 12, - "tags": [], +[ + { "detail": "someVariant", - "documentation": {"kind": "markdown", "value": "```rescript\ntype someVariant = One | Two(bool) | Three(someRecord, bool)\n```"} - }, { - "label": "Some(_)", + "documentation": { + "kind": "markdown", + "value": "```rescript\ntype someVariant = One | Two(bool) | Three(someRecord, bool)\n```" + }, "kind": 12, - "tags": [], + "label": "None", + "tags": [] + }, + { "detail": "someVariant", - "documentation": {"kind": "markdown", "value": "```rescript\ntype someVariant = One | Two(bool) | Three(someRecord, bool)\n```"}, + "documentation": { + "kind": "markdown", + "value": "```rescript\ntype someVariant = One | Two(bool) | Three(someRecord, bool)\n```" + }, "insertText": "Some(${1:_})", - "insertTextFormat": 2 - }, { - "label": "Some(One)", - "kind": 4, - "tags": [], + "insertTextFormat": 2, + "kind": 12, + "label": "Some(_)", + "tags": [] + }, + { "detail": "One", - "documentation": {"kind": "markdown", "value": "```rescript\nOne\n```\n\n```rescript\ntype someVariant = One | Two(bool) | Three(someRecord, bool)\n```"}, + "documentation": { + "kind": "markdown", + "value": "```rescript\nOne\n```\n\n```rescript\ntype someVariant = One | Two(bool) | Three(someRecord, bool)\n```" + }, "insertText": "Some(One)", - "insertTextFormat": 2 - }, { - "label": "Some(Two(_))", + "insertTextFormat": 2, "kind": 4, - "tags": [], + "label": "Some(One)", + "tags": [] + }, + { "detail": "Two(bool)", - "documentation": {"kind": "markdown", "value": "```rescript\nTwo(bool)\n```\n\n```rescript\ntype someVariant = One | Two(bool) | Three(someRecord, bool)\n```"}, + "documentation": { + "kind": "markdown", + "value": "```rescript\nTwo(bool)\n```\n\n```rescript\ntype someVariant = One | Two(bool) | Three(someRecord, bool)\n```" + }, "insertText": "Some(Two(${1:_}))", - "insertTextFormat": 2 - }, { - "label": "Some(Three(_, _))", + "insertTextFormat": 2, "kind": 4, - "tags": [], + "label": "Some(Two(_))", + "tags": [] + }, + { "detail": "Three(someRecord, bool)", - "documentation": {"kind": "markdown", "value": "```rescript\nThree(someRecord, bool)\n```\n\n```rescript\ntype someVariant = One | Two(bool) | Three(someRecord, bool)\n```"}, + "documentation": { + "kind": "markdown", + "value": "```rescript\nThree(someRecord, bool)\n```\n\n```rescript\ntype someVariant = One | Two(bool) | Three(someRecord, bool)\n```" + }, "insertText": "Some(Three(${1:_}, ${2:_}))", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 4, + "label": "Some(Three(_, _))", + "tags": [] + } +] Complete src/Reprod.res 54:29 posCursor:[54:29] posNoWhite:[54:28] Found pattern:[54:21->54:31] @@ -203,29 +273,42 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Value[resOpt] Path resOpt -[{ - "label": "One", - "kind": 4, - "tags": [], +[ + { "detail": "One", - "documentation": {"kind": "markdown", "value": "```rescript\nOne\n```\n\n```rescript\ntype someVariant = One | Two(bool) | Three(someRecord, bool)\n```"}, + "documentation": { + "kind": "markdown", + "value": "```rescript\nOne\n```\n\n```rescript\ntype someVariant = One | Two(bool) | Three(someRecord, bool)\n```" + }, "insertText": "One", - "insertTextFormat": 2 - }, { - "label": "Two(_)", + "insertTextFormat": 2, "kind": 4, - "tags": [], + "label": "One", + "tags": [] + }, + { "detail": "Two(bool)", - "documentation": {"kind": "markdown", "value": "```rescript\nTwo(bool)\n```\n\n```rescript\ntype someVariant = One | Two(bool) | Three(someRecord, bool)\n```"}, + "documentation": { + "kind": "markdown", + "value": "```rescript\nTwo(bool)\n```\n\n```rescript\ntype someVariant = One | Two(bool) | Three(someRecord, bool)\n```" + }, "insertText": "Two(${1:_})", - "insertTextFormat": 2 - }, { - "label": "Three(_, _)", + "insertTextFormat": 2, "kind": 4, - "tags": [], + "label": "Two(_)", + "tags": [] + }, + { "detail": "Three(someRecord, bool)", - "documentation": {"kind": "markdown", "value": "```rescript\nThree(someRecord, bool)\n```\n\n```rescript\ntype someVariant = One | Two(bool) | Three(someRecord, bool)\n```"}, + "documentation": { + "kind": "markdown", + "value": "```rescript\nThree(someRecord, bool)\n```\n\n```rescript\ntype someVariant = One | Two(bool) | Three(someRecord, bool)\n```" + }, "insertText": "Three(${1:_}, ${2:_})", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 4, + "label": "Three(_, _)", + "tags": [] + } +] diff --git a/tests/analysis_tests/tests/src/expected/RxjsCompletion.res.txt b/tests/analysis_tests/tests/src/expected/RxjsCompletion.res.txt index 9ab09fb9993..2b0365f8465 100644 --- a/tests/analysis_tests/tests/src/expected/RxjsCompletion.res.txt +++ b/tests/analysis_tests/tests/src/expected/RxjsCompletion.res.txt @@ -22,67 +22,93 @@ CPPipe pathFromEnv:Observable found:true Path Rxjs.Observable. Path Rxjs. Path -[{ - "label": "->Observable.subscribe", - "kind": 12, - "tags": [], +[ + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 29, "line": 26 }, + "start": { "character": 28, "line": 26 } + } + } + ], "detail": "(t<'t>, 't => unit) => subscription", - "documentation": null, - "sortText": "subscribe", "insertText": "->Observable.subscribe", - "additionalTextEdits": [{ - "range": {"start": {"line": 26, "character": 28}, "end": {"line": 26, "character": 29}}, - "newText": "" - }] - }, { - "label": "->pipe", "kind": 12, - "tags": [], + "label": "->Observable.subscribe", + "sortText": "subscribe", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 29, "line": 26 }, + "start": { "character": 28, "line": 26 } + } + } + ], "detail": "(Observable.t<'t>, operation<'t, 'u>) => Observable.t<'u>", - "documentation": null, - "sortText": "pipe", "insertText": "->pipe", - "additionalTextEdits": [{ - "range": {"start": {"line": 26, "character": 28}, "end": {"line": 26, "character": 29}}, - "newText": "" - }] - }, { - "label": "->combineLatest", "kind": 12, - "tags": [], + "label": "->pipe", + "sortText": "pipe", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 29, "line": 26 }, + "start": { "character": 28, "line": 26 } + } + } + ], "detail": "(\n Observable.t<'a>,\n Observable.t<'b>,\n) => Observable.t<('a, 'b)>", - "documentation": null, - "sortText": "combineLatest", "insertText": "->combineLatest", - "additionalTextEdits": [{ - "range": {"start": {"line": 26, "character": 28}, "end": {"line": 26, "character": 29}}, - "newText": "" - }] - }, { - "label": "->merge", "kind": 12, - "tags": [], + "label": "->combineLatest", + "sortText": "combineLatest", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 29, "line": 26 }, + "start": { "character": 28, "line": 26 } + } + } + ], "detail": "(Observable.t<'t>, Observable.t<'t>) => Observable.t<'t>", - "documentation": null, - "sortText": "merge", "insertText": "->merge", - "additionalTextEdits": [{ - "range": {"start": {"line": 26, "character": 28}, "end": {"line": 26, "character": 29}}, - "newText": "" - }] - }, { - "label": "->pipe2", "kind": 12, - "tags": [], + "label": "->merge", + "sortText": "merge", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 29, "line": 26 }, + "start": { "character": 28, "line": 26 } + } + } + ], "detail": "(\n Observable.t<'t>,\n operation<'t, 'u>,\n operation<'u, 'i>,\n) => Observable.t<'i>", - "documentation": null, - "sortText": "pipe2", "insertText": "->pipe2", - "additionalTextEdits": [{ - "range": {"start": {"line": 26, "character": 28}, "end": {"line": 26, "character": 29}}, - "newText": "" - }] - }] + "kind": 12, + "label": "->pipe2", + "sortText": "pipe2", + "tags": [] + } +] Complete src/RxjsCompletion.res 34:30 posCursor:[34:30] posNoWhite:[34:29] Found expr:[10:17->38:1] @@ -105,65 +131,91 @@ CPPipe pathFromEnv:Observable found:true Path Rxjs.Observable. Path Rxjs. Path -[{ - "label": "->Rxjs.Observable.subscribe", - "kind": 12, - "tags": [], +[ + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 30, "line": 34 }, + "start": { "character": 29, "line": 34 } + } + } + ], "detail": "(t<'t>, 't => unit) => subscription", - "documentation": null, - "sortText": "subscribe", "insertText": "->Rxjs.Observable.subscribe", - "additionalTextEdits": [{ - "range": {"start": {"line": 34, "character": 29}, "end": {"line": 34, "character": 30}}, - "newText": "" - }] - }, { - "label": "->Rxjs.pipe", "kind": 12, - "tags": [], + "label": "->Rxjs.Observable.subscribe", + "sortText": "subscribe", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 30, "line": 34 }, + "start": { "character": 29, "line": 34 } + } + } + ], "detail": "(Observable.t<'t>, operation<'t, 'u>) => Observable.t<'u>", - "documentation": null, - "sortText": "pipe", "insertText": "->Rxjs.pipe", - "additionalTextEdits": [{ - "range": {"start": {"line": 34, "character": 29}, "end": {"line": 34, "character": 30}}, - "newText": "" - }] - }, { - "label": "->Rxjs.combineLatest", "kind": 12, - "tags": [], + "label": "->Rxjs.pipe", + "sortText": "pipe", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 30, "line": 34 }, + "start": { "character": 29, "line": 34 } + } + } + ], "detail": "(\n Observable.t<'a>,\n Observable.t<'b>,\n) => Observable.t<('a, 'b)>", - "documentation": null, - "sortText": "combineLatest", "insertText": "->Rxjs.combineLatest", - "additionalTextEdits": [{ - "range": {"start": {"line": 34, "character": 29}, "end": {"line": 34, "character": 30}}, - "newText": "" - }] - }, { - "label": "->Rxjs.merge", "kind": 12, - "tags": [], + "label": "->Rxjs.combineLatest", + "sortText": "combineLatest", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 30, "line": 34 }, + "start": { "character": 29, "line": 34 } + } + } + ], "detail": "(Observable.t<'t>, Observable.t<'t>) => Observable.t<'t>", - "documentation": null, - "sortText": "merge", "insertText": "->Rxjs.merge", - "additionalTextEdits": [{ - "range": {"start": {"line": 34, "character": 29}, "end": {"line": 34, "character": 30}}, - "newText": "" - }] - }, { - "label": "->Rxjs.pipe2", "kind": 12, - "tags": [], + "label": "->Rxjs.merge", + "sortText": "merge", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 30, "line": 34 }, + "start": { "character": 29, "line": 34 } + } + } + ], "detail": "(\n Observable.t<'t>,\n operation<'t, 'u>,\n operation<'u, 'i>,\n) => Observable.t<'i>", - "documentation": null, - "sortText": "pipe2", "insertText": "->Rxjs.pipe2", - "additionalTextEdits": [{ - "range": {"start": {"line": 34, "character": 29}, "end": {"line": 34, "character": 30}}, - "newText": "" - }] - }] + "kind": 12, + "label": "->Rxjs.pipe2", + "sortText": "pipe2", + "tags": [] + } +] diff --git a/tests/analysis_tests/tests/src/expected/SignatureHelp.res.txt b/tests/analysis_tests/tests/src/expected/SignatureHelp.res.txt index cdb8f9a2047..b30ae0c7e3b 100644 --- a/tests/analysis_tests/tests/src/expected/SignatureHelp.res.txt +++ b/tests/analysis_tests/tests/src/expected/SignatureHelp.res.txt @@ -13,13 +13,40 @@ extracted params: [( int, ~two: string=?, ~three: unit => unit, ~four: someVariant, unit] { - "signatures": [{ - "label": "(\n int,\n ~two: string=?,\n ~three: unit => unit,\n ~four: someVariant,\n unit,\n) => unit", - "parameters": [{"label": [0, 7], "documentation": {"kind": "markdown", "value": ""}}, {"label": [11, 25], "documentation": {"kind": "markdown", "value": ""}}, {"label": [29, 49], "documentation": {"kind": "markdown", "value": ""}}, {"label": [53, 71], "documentation": {"kind": "markdown", "value": "```rescript\ntype someVariant = One | Two | Three\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22SignatureHelp.res%22%2C0%2C0%5D)"}}, {"label": [75, 79], "documentation": {"kind": "markdown", "value": ""}}], - "documentation": {"kind": "markdown", "value": " Does stuff. "} - }], + "activeParameter": 0, "activeSignature": 0, - "activeParameter": 0 + "signatures": [ + { + "activeParameter": 0, + "documentation": { "kind": "markdown", "value": " Does stuff. " }, + "label": "(\n int,\n ~two: string=?,\n ~three: unit => unit,\n ~four: someVariant,\n unit,\n) => unit", + "parameters": [ + { + "documentation": { "kind": "markdown", "value": "" }, + "label": [ 0, 7 ] + }, + { + "documentation": { "kind": "markdown", "value": "" }, + "label": [ 11, 25 ] + }, + { + "documentation": { "kind": "markdown", "value": "" }, + "label": [ 29, 49 ] + }, + { + "documentation": { + "kind": "markdown", + "value": "```rescript\ntype someVariant = One | Two | Three\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22SignatureHelp.res%22%2C0%2C0%5D)" + }, + "label": [ 53, 71 ] + }, + { + "documentation": { "kind": "markdown", "value": "" }, + "label": [ 75, 79 ] + } + ] + } + ] } Signature help src/SignatureHelp.res 19:21 @@ -37,13 +64,40 @@ extracted params: [( int, ~two: string=?, ~three: unit => unit, ~four: someVariant, unit] { - "signatures": [{ - "label": "(\n int,\n ~two: string=?,\n ~three: unit => unit,\n ~four: someVariant,\n unit,\n) => unit", - "parameters": [{"label": [0, 7], "documentation": {"kind": "markdown", "value": ""}}, {"label": [11, 25], "documentation": {"kind": "markdown", "value": ""}}, {"label": [29, 49], "documentation": {"kind": "markdown", "value": ""}}, {"label": [53, 71], "documentation": {"kind": "markdown", "value": "```rescript\ntype someVariant = One | Two | Three\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22SignatureHelp.res%22%2C0%2C0%5D)"}}, {"label": [75, 79], "documentation": {"kind": "markdown", "value": ""}}], - "documentation": {"kind": "markdown", "value": " Does stuff. "} - }], + "activeParameter": 0, "activeSignature": 0, - "activeParameter": 0 + "signatures": [ + { + "activeParameter": 0, + "documentation": { "kind": "markdown", "value": " Does stuff. " }, + "label": "(\n int,\n ~two: string=?,\n ~three: unit => unit,\n ~four: someVariant,\n unit,\n) => unit", + "parameters": [ + { + "documentation": { "kind": "markdown", "value": "" }, + "label": [ 0, 7 ] + }, + { + "documentation": { "kind": "markdown", "value": "" }, + "label": [ 11, 25 ] + }, + { + "documentation": { "kind": "markdown", "value": "" }, + "label": [ 29, 49 ] + }, + { + "documentation": { + "kind": "markdown", + "value": "```rescript\ntype someVariant = One | Two | Three\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22SignatureHelp.res%22%2C0%2C0%5D)" + }, + "label": [ 53, 71 ] + }, + { + "documentation": { "kind": "markdown", "value": "" }, + "label": [ 75, 79 ] + } + ] + } + ] } Signature help src/SignatureHelp.res 22:29 @@ -61,13 +115,40 @@ extracted params: [( int, ~two: string=?, ~three: unit => unit, ~four: someVariant, unit] { - "signatures": [{ - "label": "(\n int,\n ~two: string=?,\n ~three: unit => unit,\n ~four: someVariant,\n unit,\n) => unit", - "parameters": [{"label": [0, 7], "documentation": {"kind": "markdown", "value": ""}}, {"label": [11, 25], "documentation": {"kind": "markdown", "value": ""}}, {"label": [29, 49], "documentation": {"kind": "markdown", "value": ""}}, {"label": [53, 71], "documentation": {"kind": "markdown", "value": "```rescript\ntype someVariant = One | Two | Three\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22SignatureHelp.res%22%2C0%2C0%5D)"}}, {"label": [75, 79], "documentation": {"kind": "markdown", "value": ""}}], - "documentation": {"kind": "markdown", "value": " Does stuff. "} - }], + "activeParameter": 1, "activeSignature": 0, - "activeParameter": 1 + "signatures": [ + { + "activeParameter": 1, + "documentation": { "kind": "markdown", "value": " Does stuff. " }, + "label": "(\n int,\n ~two: string=?,\n ~three: unit => unit,\n ~four: someVariant,\n unit,\n) => unit", + "parameters": [ + { + "documentation": { "kind": "markdown", "value": "" }, + "label": [ 0, 7 ] + }, + { + "documentation": { "kind": "markdown", "value": "" }, + "label": [ 11, 25 ] + }, + { + "documentation": { "kind": "markdown", "value": "" }, + "label": [ 29, 49 ] + }, + { + "documentation": { + "kind": "markdown", + "value": "```rescript\ntype someVariant = One | Two | Three\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22SignatureHelp.res%22%2C0%2C0%5D)" + }, + "label": [ 53, 71 ] + }, + { + "documentation": { "kind": "markdown", "value": "" }, + "label": [ 75, 79 ] + } + ] + } + ] } Signature help src/SignatureHelp.res 25:33 @@ -85,13 +166,40 @@ extracted params: [( int, ~two: string=?, ~three: unit => unit, ~four: someVariant, unit] { - "signatures": [{ - "label": "(\n int,\n ~two: string=?,\n ~three: unit => unit,\n ~four: someVariant,\n unit,\n) => unit", - "parameters": [{"label": [0, 7], "documentation": {"kind": "markdown", "value": ""}}, {"label": [11, 25], "documentation": {"kind": "markdown", "value": ""}}, {"label": [29, 49], "documentation": {"kind": "markdown", "value": ""}}, {"label": [53, 71], "documentation": {"kind": "markdown", "value": "```rescript\ntype someVariant = One | Two | Three\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22SignatureHelp.res%22%2C0%2C0%5D)"}}, {"label": [75, 79], "documentation": {"kind": "markdown", "value": ""}}], - "documentation": {"kind": "markdown", "value": " Does stuff. "} - }], + "activeParameter": 1, "activeSignature": 0, - "activeParameter": 1 + "signatures": [ + { + "activeParameter": 1, + "documentation": { "kind": "markdown", "value": " Does stuff. " }, + "label": "(\n int,\n ~two: string=?,\n ~three: unit => unit,\n ~four: someVariant,\n unit,\n) => unit", + "parameters": [ + { + "documentation": { "kind": "markdown", "value": "" }, + "label": [ 0, 7 ] + }, + { + "documentation": { "kind": "markdown", "value": "" }, + "label": [ 11, 25 ] + }, + { + "documentation": { "kind": "markdown", "value": "" }, + "label": [ 29, 49 ] + }, + { + "documentation": { + "kind": "markdown", + "value": "```rescript\ntype someVariant = One | Two | Three\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22SignatureHelp.res%22%2C0%2C0%5D)" + }, + "label": [ 53, 71 ] + }, + { + "documentation": { "kind": "markdown", "value": "" }, + "label": [ 75, 79 ] + } + ] + } + ] } Signature help src/SignatureHelp.res 28:38 @@ -109,13 +217,40 @@ extracted params: [( int, ~two: string=?, ~three: unit => unit, ~four: someVariant, unit] { - "signatures": [{ - "label": "(\n int,\n ~two: string=?,\n ~three: unit => unit,\n ~four: someVariant,\n unit,\n) => unit", - "parameters": [{"label": [0, 7], "documentation": {"kind": "markdown", "value": ""}}, {"label": [11, 25], "documentation": {"kind": "markdown", "value": ""}}, {"label": [29, 49], "documentation": {"kind": "markdown", "value": ""}}, {"label": [53, 71], "documentation": {"kind": "markdown", "value": "```rescript\ntype someVariant = One | Two | Three\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22SignatureHelp.res%22%2C0%2C0%5D)"}}, {"label": [75, 79], "documentation": {"kind": "markdown", "value": ""}}], - "documentation": {"kind": "markdown", "value": " Does stuff. "} - }], + "activeParameter": 3, "activeSignature": 0, - "activeParameter": 3 + "signatures": [ + { + "activeParameter": 3, + "documentation": { "kind": "markdown", "value": " Does stuff. " }, + "label": "(\n int,\n ~two: string=?,\n ~three: unit => unit,\n ~four: someVariant,\n unit,\n) => unit", + "parameters": [ + { + "documentation": { "kind": "markdown", "value": "" }, + "label": [ 0, 7 ] + }, + { + "documentation": { "kind": "markdown", "value": "" }, + "label": [ 11, 25 ] + }, + { + "documentation": { "kind": "markdown", "value": "" }, + "label": [ 29, 49 ] + }, + { + "documentation": { + "kind": "markdown", + "value": "```rescript\ntype someVariant = One | Two | Three\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22SignatureHelp.res%22%2C0%2C0%5D)" + }, + "label": [ 53, 71 ] + }, + { + "documentation": { "kind": "markdown", "value": "" }, + "label": [ 75, 79 ] + } + ] + } + ] } Signature help src/SignatureHelp.res 31:42 @@ -133,13 +268,40 @@ extracted params: [( int, ~two: string=?, ~three: unit => unit, ~four: someVariant, unit] { - "signatures": [{ - "label": "(\n int,\n ~two: string=?,\n ~three: unit => unit,\n ~four: someVariant,\n unit,\n) => unit", - "parameters": [{"label": [0, 7], "documentation": {"kind": "markdown", "value": ""}}, {"label": [11, 25], "documentation": {"kind": "markdown", "value": ""}}, {"label": [29, 49], "documentation": {"kind": "markdown", "value": ""}}, {"label": [53, 71], "documentation": {"kind": "markdown", "value": "```rescript\ntype someVariant = One | Two | Three\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22SignatureHelp.res%22%2C0%2C0%5D)"}}, {"label": [75, 79], "documentation": {"kind": "markdown", "value": ""}}], - "documentation": {"kind": "markdown", "value": " Does stuff. "} - }], + "activeParameter": 3, "activeSignature": 0, - "activeParameter": 3 + "signatures": [ + { + "activeParameter": 3, + "documentation": { "kind": "markdown", "value": " Does stuff. " }, + "label": "(\n int,\n ~two: string=?,\n ~three: unit => unit,\n ~four: someVariant,\n unit,\n) => unit", + "parameters": [ + { + "documentation": { "kind": "markdown", "value": "" }, + "label": [ 0, 7 ] + }, + { + "documentation": { "kind": "markdown", "value": "" }, + "label": [ 11, 25 ] + }, + { + "documentation": { "kind": "markdown", "value": "" }, + "label": [ 29, 49 ] + }, + { + "documentation": { + "kind": "markdown", + "value": "```rescript\ntype someVariant = One | Two | Three\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22SignatureHelp.res%22%2C0%2C0%5D)" + }, + "label": [ 53, 71 ] + }, + { + "documentation": { "kind": "markdown", "value": "" }, + "label": [ 75, 79 ] + } + ] + } + ] } Signature help src/SignatureHelp.res 34:21 @@ -156,12 +318,28 @@ argAtCursor: unlabelled<0> extracted params: [(string, int, float] { - "signatures": [{ - "label": "(string, int, float) => unit", - "parameters": [{"label": [0, 7], "documentation": {"kind": "markdown", "value": ""}}, {"label": [9, 12], "documentation": {"kind": "markdown", "value": ""}}, {"label": [14, 19], "documentation": {"kind": "markdown", "value": ""}}] - }], + "activeParameter": 0, "activeSignature": 0, - "activeParameter": 0 + "signatures": [ + { + "activeParameter": 0, + "label": "(string, int, float) => unit", + "parameters": [ + { + "documentation": { "kind": "markdown", "value": "" }, + "label": [ 0, 7 ] + }, + { + "documentation": { "kind": "markdown", "value": "" }, + "label": [ 9, 12 ] + }, + { + "documentation": { "kind": "markdown", "value": "" }, + "label": [ 14, 19 ] + } + ] + } + ] } Signature help src/SignatureHelp.res 37:24 @@ -178,12 +356,28 @@ argAtCursor: unlabelled<0> extracted params: [(string, int, float] { - "signatures": [{ - "label": "(string, int, float) => unit", - "parameters": [{"label": [0, 7], "documentation": {"kind": "markdown", "value": ""}}, {"label": [9, 12], "documentation": {"kind": "markdown", "value": ""}}, {"label": [14, 19], "documentation": {"kind": "markdown", "value": ""}}] - }], + "activeParameter": 0, "activeSignature": 0, - "activeParameter": 0 + "signatures": [ + { + "activeParameter": 0, + "label": "(string, int, float) => unit", + "parameters": [ + { + "documentation": { "kind": "markdown", "value": "" }, + "label": [ 0, 7 ] + }, + { + "documentation": { "kind": "markdown", "value": "" }, + "label": [ 9, 12 ] + }, + { + "documentation": { "kind": "markdown", "value": "" }, + "label": [ 14, 19 ] + } + ] + } + ] } Signature help src/SignatureHelp.res 40:35 @@ -200,12 +394,28 @@ argAtCursor: unlabelled<2> extracted params: [(string, int, float] { - "signatures": [{ - "label": "(string, int, float) => unit", - "parameters": [{"label": [0, 7], "documentation": {"kind": "markdown", "value": ""}}, {"label": [9, 12], "documentation": {"kind": "markdown", "value": ""}}, {"label": [14, 19], "documentation": {"kind": "markdown", "value": ""}}] - }], + "activeParameter": 2, "activeSignature": 0, - "activeParameter": 2 + "signatures": [ + { + "activeParameter": 2, + "label": "(string, int, float) => unit", + "parameters": [ + { + "documentation": { "kind": "markdown", "value": "" }, + "label": [ 0, 7 ] + }, + { + "documentation": { "kind": "markdown", "value": "" }, + "label": [ 9, 12 ] + }, + { + "documentation": { "kind": "markdown", "value": "" }, + "label": [ 14, 19 ] + } + ] + } + ] } Signature help src/SignatureHelp.res 43:33 @@ -222,12 +432,24 @@ argAtCursor: ~age extracted params: [(~age: int, ~name: string] { - "signatures": [{ - "label": "(~age: int, ~name: string) => string", - "parameters": [{"label": [0, 10], "documentation": {"kind": "markdown", "value": ""}}, {"label": [12, 25], "documentation": {"kind": "markdown", "value": ""}}] - }], + "activeParameter": 0, "activeSignature": 0, - "activeParameter": 0 + "signatures": [ + { + "activeParameter": 0, + "label": "(~age: int, ~name: string) => string", + "parameters": [ + { + "documentation": { "kind": "markdown", "value": "" }, + "label": [ 0, 10 ] + }, + { + "documentation": { "kind": "markdown", "value": "" }, + "label": [ 12, 25 ] + } + ] + } + ] } Signature help src/SignatureHelp.res 50:24 @@ -244,12 +466,20 @@ argAtCursor: unlabelled<0> extracted params: [string] { - "signatures": [{ - "label": "string => unit", - "parameters": [{"label": [0, 6], "documentation": {"kind": "markdown", "value": ""}}] - }], + "activeParameter": 0, "activeSignature": 0, - "activeParameter": 0 + "signatures": [ + { + "activeParameter": 0, + "label": "string => unit", + "parameters": [ + { + "documentation": { "kind": "markdown", "value": "" }, + "label": [ 0, 6 ] + } + ] + } + ] } Signature help src/SignatureHelp.res 53:31 @@ -267,12 +497,28 @@ argAtCursor: unlabelled<1> extracted params: [(string, int, float] { - "signatures": [{ - "label": "(string, int, float) => unit", - "parameters": [{"label": [0, 7], "documentation": {"kind": "markdown", "value": ""}}, {"label": [9, 12], "documentation": {"kind": "markdown", "value": ""}}, {"label": [14, 19], "documentation": {"kind": "markdown", "value": ""}}] - }], + "activeParameter": 1, "activeSignature": 0, - "activeParameter": 1 + "signatures": [ + { + "activeParameter": 1, + "label": "(string, int, float) => unit", + "parameters": [ + { + "documentation": { "kind": "markdown", "value": "" }, + "label": [ 0, 7 ] + }, + { + "documentation": { "kind": "markdown", "value": "" }, + "label": [ 9, 12 ] + }, + { + "documentation": { "kind": "markdown", "value": "" }, + "label": [ 14, 19 ] + } + ] + } + ] } Signature help src/SignatureHelp.res 62:17 @@ -289,12 +535,28 @@ argAtCursor: unlabelled<1> extracted params: [(int, string, int] { - "signatures": [{ - "label": "(int, string, int) => unit", - "parameters": [{"label": [0, 4], "documentation": {"kind": "markdown", "value": ""}}, {"label": [6, 12], "documentation": {"kind": "markdown", "value": ""}}, {"label": [14, 17], "documentation": {"kind": "markdown", "value": ""}}] - }], + "activeParameter": 1, "activeSignature": 0, - "activeParameter": 1 + "signatures": [ + { + "activeParameter": 1, + "label": "(int, string, int) => unit", + "parameters": [ + { + "documentation": { "kind": "markdown", "value": "" }, + "label": [ 0, 4 ] + }, + { + "documentation": { "kind": "markdown", "value": "" }, + "label": [ 6, 12 ] + }, + { + "documentation": { "kind": "markdown", "value": "" }, + "label": [ 14, 17 ] + } + ] + } + ] } Signature help src/SignatureHelp.res 65:17 @@ -311,12 +573,28 @@ argAtCursor: unlabelled<1> extracted params: [(int, string, int] { - "signatures": [{ - "label": "(int, string, int) => unit", - "parameters": [{"label": [0, 4], "documentation": {"kind": "markdown", "value": ""}}, {"label": [6, 12], "documentation": {"kind": "markdown", "value": ""}}, {"label": [14, 17], "documentation": {"kind": "markdown", "value": ""}}] - }], + "activeParameter": 1, "activeSignature": 0, - "activeParameter": 1 + "signatures": [ + { + "activeParameter": 1, + "label": "(int, string, int) => unit", + "parameters": [ + { + "documentation": { "kind": "markdown", "value": "" }, + "label": [ 0, 4 ] + }, + { + "documentation": { "kind": "markdown", "value": "" }, + "label": [ 6, 12 ] + }, + { + "documentation": { "kind": "markdown", "value": "" }, + "label": [ 14, 17 ] + } + ] + } + ] } Signature help src/SignatureHelp.res 68:26 @@ -333,12 +611,28 @@ argAtCursor: unlabelled<2> extracted params: [(int, string, int] { - "signatures": [{ - "label": "(int, string, int) => unit", - "parameters": [{"label": [0, 4], "documentation": {"kind": "markdown", "value": ""}}, {"label": [6, 12], "documentation": {"kind": "markdown", "value": ""}}, {"label": [14, 17], "documentation": {"kind": "markdown", "value": ""}}] - }], + "activeParameter": 2, "activeSignature": 0, - "activeParameter": 2 + "signatures": [ + { + "activeParameter": 2, + "label": "(int, string, int) => unit", + "parameters": [ + { + "documentation": { "kind": "markdown", "value": "" }, + "label": [ 0, 4 ] + }, + { + "documentation": { "kind": "markdown", "value": "" }, + "label": [ 6, 12 ] + }, + { + "documentation": { "kind": "markdown", "value": "" }, + "label": [ 14, 17 ] + } + ] + } + ] } Signature help src/SignatureHelp.res 71:29 @@ -357,12 +651,20 @@ argAtCursor: unlabelled<0> extracted params: [string] { - "signatures": [{ - "label": "string => unit", - "parameters": [{"label": [0, 6], "documentation": {"kind": "markdown", "value": ""}}] - }], + "activeParameter": 0, "activeSignature": 0, - "activeParameter": 0 + "signatures": [ + { + "activeParameter": 0, + "label": "string => unit", + "parameters": [ + { + "documentation": { "kind": "markdown", "value": "" }, + "label": [ 0, 6 ] + } + ] + } + ] } Signature help src/SignatureHelp.res 74:40 @@ -384,90 +686,238 @@ extracted params: [( int, ~two: string=?, ~three: unit => unit, ~four: someVariant, unit] { - "signatures": [{ - "label": "(\n int,\n ~two: string=?,\n ~three: unit => unit,\n ~four: someVariant,\n unit,\n) => unit", - "parameters": [{"label": [0, 7], "documentation": {"kind": "markdown", "value": ""}}, {"label": [11, 25], "documentation": {"kind": "markdown", "value": ""}}, {"label": [29, 49], "documentation": {"kind": "markdown", "value": ""}}, {"label": [53, 71], "documentation": {"kind": "markdown", "value": "```rescript\ntype someVariant = One | Two | Three\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22SignatureHelp.res%22%2C0%2C0%5D)"}}, {"label": [75, 79], "documentation": {"kind": "markdown", "value": ""}}], - "documentation": {"kind": "markdown", "value": " Does stuff. "} - }], + "activeParameter": 0, "activeSignature": 0, - "activeParameter": 0 + "signatures": [ + { + "activeParameter": 0, + "documentation": { "kind": "markdown", "value": " Does stuff. " }, + "label": "(\n int,\n ~two: string=?,\n ~three: unit => unit,\n ~four: someVariant,\n unit,\n) => unit", + "parameters": [ + { + "documentation": { "kind": "markdown", "value": "" }, + "label": [ 0, 7 ] + }, + { + "documentation": { "kind": "markdown", "value": "" }, + "label": [ 11, 25 ] + }, + { + "documentation": { "kind": "markdown", "value": "" }, + "label": [ 29, 49 ] + }, + { + "documentation": { + "kind": "markdown", + "value": "```rescript\ntype someVariant = One | Two | Three\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22SignatureHelp.res%22%2C0%2C0%5D)" + }, + "label": [ 53, 71 ] + }, + { + "documentation": { "kind": "markdown", "value": "" }, + "label": [ 75, 79 ] + } + ] + } + ] } Signature help src/SignatureHelp.res 85:16 { - "signatures": [{ - "label": "One({miss?: bool, hit?: bool, stuff?: string})", - "parameters": [{"label": [0, 0], "documentation": {"kind": "markdown", "value": ""}}, {"label": [5, 16], "documentation": {"kind": "markdown", "value": ""}}, {"label": [18, 28], "documentation": {"kind": "markdown", "value": ""}}, {"label": [30, 44], "documentation": {"kind": "markdown", "value": ""}}], - "documentation": {"kind": "markdown", "value": " One is cool. "} - }], + "activeParameter": -1, "activeSignature": 0, - "activeParameter": -1 + "signatures": [ + { + "activeParameter": -1, + "documentation": { "kind": "markdown", "value": " One is cool. " }, + "label": "One({miss?: bool, hit?: bool, stuff?: string})", + "parameters": [ + { + "documentation": { "kind": "markdown", "value": "" }, + "label": [ 0, 0 ] + }, + { + "documentation": { "kind": "markdown", "value": "" }, + "label": [ 5, 16 ] + }, + { + "documentation": { "kind": "markdown", "value": "" }, + "label": [ 18, 28 ] + }, + { + "documentation": { "kind": "markdown", "value": "" }, + "label": [ 30, 44 ] + } + ] + } + ] } Signature help src/SignatureHelp.res 88:18 { - "signatures": [{ - "label": "One({miss?: bool, hit?: bool, stuff?: string})", - "parameters": [{"label": [0, 0], "documentation": {"kind": "markdown", "value": ""}}, {"label": [5, 16], "documentation": {"kind": "markdown", "value": ""}}, {"label": [18, 28], "documentation": {"kind": "markdown", "value": ""}}, {"label": [30, 44], "documentation": {"kind": "markdown", "value": ""}}], - "documentation": {"kind": "markdown", "value": " One is cool. "} - }], + "activeParameter": 1, "activeSignature": 0, - "activeParameter": 1 + "signatures": [ + { + "activeParameter": 1, + "documentation": { "kind": "markdown", "value": " One is cool. " }, + "label": "One({miss?: bool, hit?: bool, stuff?: string})", + "parameters": [ + { + "documentation": { "kind": "markdown", "value": "" }, + "label": [ 0, 0 ] + }, + { + "documentation": { "kind": "markdown", "value": "" }, + "label": [ 5, 16 ] + }, + { + "documentation": { "kind": "markdown", "value": "" }, + "label": [ 18, 28 ] + }, + { + "documentation": { "kind": "markdown", "value": "" }, + "label": [ 30, 44 ] + } + ] + } + ] } Signature help src/SignatureHelp.res 91:23 { - "signatures": [{ - "label": "One({miss?: bool, hit?: bool, stuff?: string})", - "parameters": [{"label": [0, 0], "documentation": {"kind": "markdown", "value": ""}}, {"label": [5, 16], "documentation": {"kind": "markdown", "value": ""}}, {"label": [18, 28], "documentation": {"kind": "markdown", "value": ""}}, {"label": [30, 44], "documentation": {"kind": "markdown", "value": ""}}], - "documentation": {"kind": "markdown", "value": " One is cool. "} - }], + "activeParameter": 2, "activeSignature": 0, - "activeParameter": 2 + "signatures": [ + { + "activeParameter": 2, + "documentation": { "kind": "markdown", "value": " One is cool. " }, + "label": "One({miss?: bool, hit?: bool, stuff?: string})", + "parameters": [ + { + "documentation": { "kind": "markdown", "value": "" }, + "label": [ 0, 0 ] + }, + { + "documentation": { "kind": "markdown", "value": "" }, + "label": [ 5, 16 ] + }, + { + "documentation": { "kind": "markdown", "value": "" }, + "label": [ 18, 28 ] + }, + { + "documentation": { "kind": "markdown", "value": "" }, + "label": [ 30, 44 ] + } + ] + } + ] } Signature help src/SignatureHelp.res 94:15 { - "signatures": [{ - "label": "Two(mySpecialThing)", - "parameters": [{"label": [4, 18], "documentation": {"kind": "markdown", "value": "```rescript\ntype mySpecialThing = string\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22SignatureHelp.res%22%2C78%2C0%5D)"}}], - "documentation": {"kind": "markdown", "value": " Two is fun! "} - }], + "activeParameter": 0, "activeSignature": 0, - "activeParameter": 0 + "signatures": [ + { + "activeParameter": 0, + "documentation": { "kind": "markdown", "value": " Two is fun! " }, + "label": "Two(mySpecialThing)", + "parameters": [ + { + "documentation": { + "kind": "markdown", + "value": "```rescript\ntype mySpecialThing = string\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22SignatureHelp.res%22%2C78%2C0%5D)" + }, + "label": [ 4, 18 ] + } + ] + } + ] } Signature help src/SignatureHelp.res 97:19 { - "signatures": [{ - "label": "Three(mySpecialThing, array>)", - "parameters": [{"label": [6, 20], "documentation": {"kind": "markdown", "value": "```rescript\ntype mySpecialThing = string\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22SignatureHelp.res%22%2C78%2C0%5D)"}}, {"label": [22, 43], "documentation": {"kind": "markdown", "value": ""}}], - "documentation": {"kind": "markdown", "value": " Three is... three "} - }], + "activeParameter": 0, "activeSignature": 0, - "activeParameter": 0 + "signatures": [ + { + "activeParameter": 0, + "documentation": { "kind": "markdown", "value": " Three is... three " }, + "label": "Three(mySpecialThing, array>)", + "parameters": [ + { + "documentation": { + "kind": "markdown", + "value": "```rescript\ntype mySpecialThing = string\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22SignatureHelp.res%22%2C78%2C0%5D)" + }, + "label": [ 6, 20 ] + }, + { + "documentation": { "kind": "markdown", "value": "" }, + "label": [ 22, 43 ] + } + ] + } + ] } Signature help src/SignatureHelp.res 100:24 { - "signatures": [{ - "label": "Three(mySpecialThing, array>)", - "parameters": [{"label": [6, 20], "documentation": {"kind": "markdown", "value": "```rescript\ntype mySpecialThing = string\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22SignatureHelp.res%22%2C78%2C0%5D)"}}, {"label": [22, 43], "documentation": {"kind": "markdown", "value": ""}}], - "documentation": {"kind": "markdown", "value": " Three is... three "} - }], + "activeParameter": 1, "activeSignature": 0, - "activeParameter": 1 + "signatures": [ + { + "activeParameter": 1, + "documentation": { "kind": "markdown", "value": " Three is... three " }, + "label": "Three(mySpecialThing, array>)", + "parameters": [ + { + "documentation": { + "kind": "markdown", + "value": "```rescript\ntype mySpecialThing = string\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22SignatureHelp.res%22%2C78%2C0%5D)" + }, + "label": [ 6, 20 ] + }, + { + "documentation": { "kind": "markdown", "value": "" }, + "label": [ 22, 43 ] + } + ] + } + ] } Signature help src/SignatureHelp.res 105:9 { - "signatures": [{ - "label": "One({miss?: bool, hit?: bool, stuff?: string})", - "parameters": [{"label": [0, 0], "documentation": {"kind": "markdown", "value": ""}}, {"label": [5, 16], "documentation": {"kind": "markdown", "value": ""}}, {"label": [18, 28], "documentation": {"kind": "markdown", "value": ""}}, {"label": [30, 44], "documentation": {"kind": "markdown", "value": ""}}], - "documentation": {"kind": "markdown", "value": " One is cool. "} - }], + "activeParameter": -1, "activeSignature": 0, - "activeParameter": -1 + "signatures": [ + { + "activeParameter": -1, + "documentation": { "kind": "markdown", "value": " One is cool. " }, + "label": "One({miss?: bool, hit?: bool, stuff?: string})", + "parameters": [ + { + "documentation": { "kind": "markdown", "value": "" }, + "label": [ 0, 0 ] + }, + { + "documentation": { "kind": "markdown", "value": "" }, + "label": [ 5, 16 ] + }, + { + "documentation": { "kind": "markdown", "value": "" }, + "label": [ 18, 28 ] + }, + { + "documentation": { "kind": "markdown", "value": "" }, + "label": [ 30, 44 ] + } + ] + } + ] } Signature help src/SignatureHelp.res 113:42 @@ -475,13 +925,28 @@ argAtCursor: unlabelled<1> extracted params: [(array, int => int] { - "signatures": [{ - "label": "(array, int => int) => array", - "parameters": [{"label": [0, 11], "documentation": {"kind": "markdown", "value": ""}}, {"label": [13, 23], "documentation": {"kind": "markdown", "value": ""}}], - "documentation": {"kind": "markdown", "value": "\n`map(array, fn)` returns a new array with all elements from `array`, each element transformed using the provided `fn`.\n\nSee [`Array.map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map) on MDN.\n\n## Examples\n\n```rescript\nlet array = [\"Hello\", \"Hi\", \"Good bye\"]\nlet mappedArray = array->Array.map(greeting => greeting ++ \" to you\")\n\nmappedArray == [\"Hello to you\", \"Hi to you\", \"Good bye to you\"]\n```\n"} - }], + "activeParameter": 1, "activeSignature": 0, - "activeParameter": 1 + "signatures": [ + { + "activeParameter": 1, + "documentation": { + "kind": "markdown", + "value": "\n`map(array, fn)` returns a new array with all elements from `array`, each element transformed using the provided `fn`.\n\nSee [`Array.map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map) on MDN.\n\n## Examples\n\n```rescript\nlet array = [\"Hello\", \"Hi\", \"Good bye\"]\nlet mappedArray = array->Array.map(greeting => greeting ++ \" to you\")\n\nmappedArray == [\"Hello to you\", \"Hi to you\", \"Good bye to you\"]\n```\n" + }, + "label": "(array, int => int) => array", + "parameters": [ + { + "documentation": { "kind": "markdown", "value": "" }, + "label": [ 0, 11 ] + }, + { + "documentation": { "kind": "markdown", "value": "" }, + "label": [ 13, 23 ] + } + ] + } + ] } Signature help src/SignatureHelp.res 132:18 @@ -489,13 +954,31 @@ argAtCursor: unlabelled<0> extracted params: [(x, tt] { - "signatures": [{ - "label": "(x, tt) => string", - "parameters": [{"label": [0, 2], "documentation": {"kind": "markdown", "value": "```rescript\ntype x = {age?: int, name?: string}\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22SignatureHelp.res%22%2C117%2C0%5D)"}}, {"label": [4, 6], "documentation": {"kind": "markdown", "value": "```rescript\ntype tt = One\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22SignatureHelp.res%22%2C123%2C0%5D)"}}], - "documentation": {"kind": "markdown", "value": " Some stuff "} - }], + "activeParameter": 0, "activeSignature": 0, - "activeParameter": 0 + "signatures": [ + { + "activeParameter": 0, + "documentation": { "kind": "markdown", "value": " Some stuff " }, + "label": "(x, tt) => string", + "parameters": [ + { + "documentation": { + "kind": "markdown", + "value": "```rescript\ntype x = {age?: int, name?: string}\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22SignatureHelp.res%22%2C117%2C0%5D)" + }, + "label": [ 0, 2 ] + }, + { + "documentation": { + "kind": "markdown", + "value": "```rescript\ntype tt = One\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22SignatureHelp.res%22%2C123%2C0%5D)" + }, + "label": [ 4, 6 ] + } + ] + } + ] } Signature help src/SignatureHelp.res 135:22 @@ -503,100 +986,232 @@ argAtCursor: unlabelled<1> extracted params: [(x, tt] { - "signatures": [{ - "label": "(x, tt) => string", - "parameters": [{"label": [0, 2], "documentation": {"kind": "markdown", "value": "```rescript\ntype x = {age?: int, name?: string}\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22SignatureHelp.res%22%2C117%2C0%5D)"}}, {"label": [4, 6], "documentation": {"kind": "markdown", "value": "```rescript\ntype tt = One\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22SignatureHelp.res%22%2C123%2C0%5D)"}}], - "documentation": {"kind": "markdown", "value": " Some stuff "} - }], + "activeParameter": 1, "activeSignature": 0, - "activeParameter": 1 + "signatures": [ + { + "activeParameter": 1, + "documentation": { "kind": "markdown", "value": " Some stuff " }, + "label": "(x, tt) => string", + "parameters": [ + { + "documentation": { + "kind": "markdown", + "value": "```rescript\ntype x = {age?: int, name?: string}\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22SignatureHelp.res%22%2C117%2C0%5D)" + }, + "label": [ 0, 2 ] + }, + { + "documentation": { + "kind": "markdown", + "value": "```rescript\ntype tt = One\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22SignatureHelp.res%22%2C123%2C0%5D)" + }, + "label": [ 4, 6 ] + } + ] + } + ] } Signature help src/SignatureHelp.res 139:8 { - "signatures": [{ - "label": "One({miss?: bool, hit?: bool, stuff?: string})", - "parameters": [{"label": [0, 0], "documentation": {"kind": "markdown", "value": ""}}, {"label": [5, 16], "documentation": {"kind": "markdown", "value": ""}}, {"label": [18, 28], "documentation": {"kind": "markdown", "value": ""}}, {"label": [30, 44], "documentation": {"kind": "markdown", "value": ""}}], - "documentation": {"kind": "markdown", "value": " One is cool. "} - }], + "activeParameter": 2, "activeSignature": 0, - "activeParameter": 2 + "signatures": [ + { + "activeParameter": 2, + "documentation": { "kind": "markdown", "value": " One is cool. " }, + "label": "One({miss?: bool, hit?: bool, stuff?: string})", + "parameters": [ + { + "documentation": { "kind": "markdown", "value": "" }, + "label": [ 0, 0 ] + }, + { + "documentation": { "kind": "markdown", "value": "" }, + "label": [ 5, 16 ] + }, + { + "documentation": { "kind": "markdown", "value": "" }, + "label": [ 18, 28 ] + }, + { + "documentation": { "kind": "markdown", "value": "" }, + "label": [ 30, 44 ] + } + ] + } + ] } Signature help src/SignatureHelp.res 141:7 { - "signatures": [{ - "label": "One({miss?: bool, hit?: bool, stuff?: string})", - "parameters": [{"label": [0, 0], "documentation": {"kind": "markdown", "value": ""}}, {"label": [5, 16], "documentation": {"kind": "markdown", "value": ""}}, {"label": [18, 28], "documentation": {"kind": "markdown", "value": ""}}, {"label": [30, 44], "documentation": {"kind": "markdown", "value": ""}}], - "documentation": {"kind": "markdown", "value": " One is cool. "} - }], + "activeParameter": 0, "activeSignature": 0, - "activeParameter": 0 + "signatures": [ + { + "activeParameter": 0, + "documentation": { "kind": "markdown", "value": " One is cool. " }, + "label": "One({miss?: bool, hit?: bool, stuff?: string})", + "parameters": [ + { + "documentation": { "kind": "markdown", "value": "" }, + "label": [ 0, 0 ] + }, + { + "documentation": { "kind": "markdown", "value": "" }, + "label": [ 5, 16 ] + }, + { + "documentation": { "kind": "markdown", "value": "" }, + "label": [ 18, 28 ] + }, + { + "documentation": { "kind": "markdown", "value": "" }, + "label": [ 30, 44 ] + } + ] + } + ] } Signature help src/SignatureHelp.res 143:7 { - "signatures": [{ - "label": "Two(mySpecialThing)", - "parameters": [{"label": [4, 18], "documentation": {"kind": "markdown", "value": "```rescript\ntype mySpecialThing = string\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22SignatureHelp.res%22%2C78%2C0%5D)"}}], - "documentation": {"kind": "markdown", "value": " Two is fun! "} - }], + "activeParameter": 0, "activeSignature": 0, - "activeParameter": 0 + "signatures": [ + { + "activeParameter": 0, + "documentation": { "kind": "markdown", "value": " Two is fun! " }, + "label": "Two(mySpecialThing)", + "parameters": [ + { + "documentation": { + "kind": "markdown", + "value": "```rescript\ntype mySpecialThing = string\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22SignatureHelp.res%22%2C78%2C0%5D)" + }, + "label": [ 4, 18 ] + } + ] + } + ] } Signature help src/SignatureHelp.res 145:9 { - "signatures": [{ - "label": "Three(mySpecialThing, array>)", - "parameters": [{"label": [6, 20], "documentation": {"kind": "markdown", "value": "```rescript\ntype mySpecialThing = string\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22SignatureHelp.res%22%2C78%2C0%5D)"}}, {"label": [22, 43], "documentation": {"kind": "markdown", "value": ""}}], - "documentation": {"kind": "markdown", "value": " Three is... three "} - }], + "activeParameter": 0, "activeSignature": 0, - "activeParameter": 0 + "signatures": [ + { + "activeParameter": 0, + "documentation": { "kind": "markdown", "value": " Three is... three " }, + "label": "Three(mySpecialThing, array>)", + "parameters": [ + { + "documentation": { + "kind": "markdown", + "value": "```rescript\ntype mySpecialThing = string\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22SignatureHelp.res%22%2C78%2C0%5D)" + }, + "label": [ 6, 20 ] + }, + { + "documentation": { "kind": "markdown", "value": "" }, + "label": [ 22, 43 ] + } + ] + } + ] } Signature help src/SignatureHelp.res 147:12 { - "signatures": [{ - "label": "Three(mySpecialThing, array>)", - "parameters": [{"label": [6, 20], "documentation": {"kind": "markdown", "value": "```rescript\ntype mySpecialThing = string\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22SignatureHelp.res%22%2C78%2C0%5D)"}}, {"label": [22, 43], "documentation": {"kind": "markdown", "value": ""}}], - "documentation": {"kind": "markdown", "value": " Three is... three "} - }], + "activeParameter": 1, "activeSignature": 0, - "activeParameter": 1 + "signatures": [ + { + "activeParameter": 1, + "documentation": { "kind": "markdown", "value": " Three is... three " }, + "label": "Three(mySpecialThing, array>)", + "parameters": [ + { + "documentation": { + "kind": "markdown", + "value": "```rescript\ntype mySpecialThing = string\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22SignatureHelp.res%22%2C78%2C0%5D)" + }, + "label": [ 6, 20 ] + }, + { + "documentation": { "kind": "markdown", "value": "" }, + "label": [ 22, 43 ] + } + ] + } + ] } Signature help src/SignatureHelp.res 151:14 { - "signatures": [{ - "label": "Ok(bool)", - "parameters": [{"label": [3, 7], "documentation": {"kind": "markdown", "value": ""}}], - "documentation": {"kind": "markdown", "value": "```rescript\nresult\n```"} - }], + "activeParameter": 0, "activeSignature": 0, - "activeParameter": 0 + "signatures": [ + { + "activeParameter": 0, + "documentation": { + "kind": "markdown", + "value": "```rescript\nresult\n```" + }, + "label": "Ok(bool)", + "parameters": [ + { + "documentation": { "kind": "markdown", "value": "" }, + "label": [ 3, 7 ] + } + ] + } + ] } Signature help src/SignatureHelp.res 154:19 { - "signatures": [{ - "label": "Error(string)", - "parameters": [{"label": [6, 12], "documentation": {"kind": "markdown", "value": ""}}], - "documentation": {"kind": "markdown", "value": "```rescript\nresult<'a, string>\n```"} - }], + "activeParameter": 0, "activeSignature": 0, - "activeParameter": 0 + "signatures": [ + { + "activeParameter": 0, + "documentation": { + "kind": "markdown", + "value": "```rescript\nresult<'a, string>\n```" + }, + "label": "Error(string)", + "parameters": [ + { + "documentation": { "kind": "markdown", "value": "" }, + "label": [ 6, 12 ] + } + ] + } + ] } Signature help src/SignatureHelp.res 157:16 { - "signatures": [{ - "label": "Some(bool)", - "parameters": [{"label": [5, 9], "documentation": {"kind": "markdown", "value": ""}}], - "documentation": {"kind": "markdown", "value": "```rescript\noption\n```"} - }], + "activeParameter": 0, "activeSignature": 0, - "activeParameter": 0 + "signatures": [ + { + "activeParameter": 0, + "documentation": { + "kind": "markdown", + "value": "```rescript\noption\n```" + }, + "label": "Some(bool)", + "parameters": [ + { + "documentation": { "kind": "markdown", "value": "" }, + "label": [ 5, 9 ] + } + ] + } + ] } diff --git a/tests/analysis_tests/tests/src/expected/TypeArgCtx.res.txt b/tests/analysis_tests/tests/src/expected/TypeArgCtx.res.txt index be53ba25ba4..5b3659ae7ca 100644 --- a/tests/analysis_tests/tests/src/expected/TypeArgCtx.res.txt +++ b/tests/analysis_tests/tests/src/expected/TypeArgCtx.res.txt @@ -7,14 +7,19 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Value[catchResult] Path catchResult -[{ - "label": "{}", - "kind": 22, - "tags": [], +[ + { "detail": "someTyp", - "documentation": {"kind": "markdown", "value": "```rescript\ntype someTyp = {test: bool}\n```"}, - "sortText": "A", + "documentation": { + "kind": "markdown", + "value": "```rescript\ntype someTyp = {test: bool}\n```" + }, "insertText": "{$0}", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 22, + "label": "{}", + "sortText": "A", + "tags": [] + } +] diff --git a/tests/analysis_tests/tests/src/expected/TypeAtPosCompletion.res.txt b/tests/analysis_tests/tests/src/expected/TypeAtPosCompletion.res.txt index 499d5fa4b12..d79b5b50ed7 100644 --- a/tests/analysis_tests/tests/src/expected/TypeAtPosCompletion.res.txt +++ b/tests/analysis_tests/tests/src/expected/TypeAtPosCompletion.res.txt @@ -4,19 +4,28 @@ Completable: Cexpression CTypeAtPos()->recordBody Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath CTypeAtPos() -[{ - "label": "age", - "kind": 5, - "tags": [], +[ + { "detail": "int", - "documentation": {"kind": "markdown", "value": "```rescript\nage?: int\n```\n\n```rescript\ntype optRecord = {name: string, age: option, online: option}\n```"} - }, { - "label": "online", + "documentation": { + "kind": "markdown", + "value": "```rescript\nage?: int\n```\n\n```rescript\ntype optRecord = {name: string, age: option, online: option}\n```" + }, "kind": 5, - "tags": [], + "label": "age", + "tags": [] + }, + { "detail": "bool", - "documentation": {"kind": "markdown", "value": "```rescript\nonline?: bool\n```\n\n```rescript\ntype optRecord = {name: string, age: option, online: option}\n```"} - }] + "documentation": { + "kind": "markdown", + "value": "```rescript\nonline?: bool\n```\n\n```rescript\ntype optRecord = {name: string, age: option, online: option}\n```" + }, + "kind": 5, + "label": "online", + "tags": [] + } +] Complete src/TypeAtPosCompletion.res 16:18 posCursor:[16:18] posNoWhite:[16:16] Found expr:[13:8->19:1] @@ -26,19 +35,28 @@ Completable: Cexpression CTypeAtPos()->variantPayload::One($1), recordBody Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath CTypeAtPos() -[{ - "label": "age", - "kind": 5, - "tags": [], +[ + { "detail": "int", - "documentation": {"kind": "markdown", "value": "```rescript\nage?: int\n```\n\n```rescript\ntype optRecord = {name: string, age: option, online: option}\n```"} - }, { - "label": "online", + "documentation": { + "kind": "markdown", + "value": "```rescript\nage?: int\n```\n\n```rescript\ntype optRecord = {name: string, age: option, online: option}\n```" + }, "kind": 5, - "tags": [], + "label": "age", + "tags": [] + }, + { "detail": "bool", - "documentation": {"kind": "markdown", "value": "```rescript\nonline?: bool\n```\n\n```rescript\ntype optRecord = {name: string, age: option, online: option}\n```"} - }] + "documentation": { + "kind": "markdown", + "value": "```rescript\nonline?: bool\n```\n\n```rescript\ntype optRecord = {name: string, age: option, online: option}\n```" + }, + "kind": 5, + "label": "online", + "tags": [] + } +] Complete src/TypeAtPosCompletion.res 22:12 posCursor:[22:12] posNoWhite:[22:11] Found expr:[21:10->24:1] @@ -46,14 +64,19 @@ Completable: Cexpression CTypeAtPos()->array Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath CTypeAtPos() -[{ - "label": "{}", - "kind": 12, - "tags": [], +[ + { "detail": "optRecord", - "documentation": {"kind": "markdown", "value": "```rescript\ntype optRecord = {name: string, age: option, online: option}\n```"}, - "sortText": "A", + "documentation": { + "kind": "markdown", + "value": "```rescript\ntype optRecord = {name: string, age: option, online: option}\n```" + }, "insertText": "{$0}", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 12, + "label": "{}", + "sortText": "A", + "tags": [] + } +] diff --git a/tests/analysis_tests/tests/src/expected/TypeDefinition.res.txt b/tests/analysis_tests/tests/src/expected/TypeDefinition.res.txt index 46a968e8f35..4dfc5f23aa6 100644 --- a/tests/analysis_tests/tests/src/expected/TypeDefinition.res.txt +++ b/tests/analysis_tests/tests/src/expected/TypeDefinition.res.txt @@ -1,18 +1,54 @@ TypeDefinition src/TypeDefinition.res 2:9 -{"uri": "TypeDefinition.res", "range": {"start": {"line": 2, "character": 5}, "end": {"line": 2, "character": 11}}} +{ + "range": { + "end": { "character": 11, "line": 2 }, + "start": { "character": 5, "line": 2 } + }, + "uri": "file:///TypeDefinition.res" +} TypeDefinition src/TypeDefinition.res 5:4 -{"uri": "TypeDefinition.res", "range": {"start": {"line": 0, "character": 0}, "end": {"line": 0, "character": 24}}} +{ + "range": { + "end": { "character": 24, "line": 0 }, + "start": { "character": 0, "line": 0 } + }, + "uri": "file:///TypeDefinition.res" +} TypeDefinition src/TypeDefinition.res 8:4 -{"uri": "TypeDefinition.res", "range": {"start": {"line": 2, "character": 0}, "end": {"line": 2, "character": 28}}} +{ + "range": { + "end": { "character": 28, "line": 2 }, + "start": { "character": 0, "line": 2 } + }, + "uri": "file:///TypeDefinition.res" +} TypeDefinition src/TypeDefinition.res 13:4 -{"uri": "TypeDefinition.res", "range": {"start": {"line": 11, "character": 0}, "end": {"line": 11, "character": 26}}} +{ + "range": { + "end": { "character": 26, "line": 11 }, + "start": { "character": 0, "line": 11 } + }, + "uri": "file:///TypeDefinition.res" +} TypeDefinition src/TypeDefinition.res 16:13 -{"uri": "TypeDefinition.res", "range": {"start": {"line": 2, "character": 0}, "end": {"line": 2, "character": 28}}} +{ + "range": { + "end": { "character": 28, "line": 2 }, + "start": { "character": 0, "line": 2 } + }, + "uri": "file:///TypeDefinition.res" +} TypeDefinition src/TypeDefinition.res 20:9 -{"uri": "TypeDefinition.res", "range": {"start": {"line": 0, "character": 0}, "end": {"line": 0, "character": 24}}} +{ + "range": { + "end": { "character": 24, "line": 0 }, + "start": { "character": 0, "line": 0 } + }, + "uri": "file:///TypeDefinition.res" +} diff --git a/tests/analysis_tests/tests/src/expected/Xform.res.txt b/tests/analysis_tests/tests/src/expected/Xform.res.txt index 606adcdd07e..2d54099ce26 100644 --- a/tests/analysis_tests/tests/src/expected/Xform.res.txt +++ b/tests/analysis_tests/tests/src/expected/Xform.res.txt @@ -10,7 +10,10 @@ Resolved opens 1 Stdlib Hit: Replace with switch TextDocumentEdit: Xform.res -{"start": {"line": 6, "character": 0}, "end": {"line": 11, "character": 1}} +{ + "end": { "character": 1, "line": 11 }, + "start": { "character": 0, "line": 6 } +} newText: <--here switch kind { @@ -24,7 +27,10 @@ Xform src/Xform.res 13:15 Hit: Replace with switch TextDocumentEdit: Xform.res -{"start": {"line": 13, "character": 0}, "end": {"line": 13, "character": 79}} +{ + "end": { "character": 79, "line": 13 }, + "start": { "character": 0, "line": 13 } +} newText: <--here switch kind { @@ -36,14 +42,20 @@ Xform src/Xform.res 16:5 Hit: Add type annotation TextDocumentEdit: Xform.res -{"start": {"line": 16, "character": 8}, "end": {"line": 16, "character": 8}} +{ + "end": { "character": 8, "line": 16 }, + "start": { "character": 8, "line": 16 } +} newText: <--here : string Hit: Add Documentation template TextDocumentEdit: Xform.res -{"start": {"line": 16, "character": 0}, "end": {"line": 16, "character": 18}} +{ + "end": { "character": 18, "line": 16 }, + "start": { "character": 0, "line": 16 } +} newText: <--here /** @@ -55,7 +67,10 @@ Xform src/Xform.res 19:5 Hit: Add Documentation template TextDocumentEdit: Xform.res -{"start": {"line": 19, "character": 0}, "end": {"line": 19, "character": 23}} +{ + "end": { "character": 23, "line": 19 }, + "start": { "character": 0, "line": 19 } +} newText: <--here /** @@ -67,7 +82,10 @@ Xform src/Xform.res 26:10 Hit: Add type annotation TextDocumentEdit: Xform.res -{"start": {"line": 26, "character": 10}, "end": {"line": 26, "character": 11}} +{ + "end": { "character": 11, "line": 26 }, + "start": { "character": 10, "line": 26 } +} newText: <--here (x: option) @@ -76,7 +94,10 @@ Xform src/Xform.res 30:9 Hit: Add braces to function TextDocumentEdit: Xform.res -{"start": {"line": 26, "character": 0}, "end": {"line": 32, "character": 3}} +{ + "end": { "character": 3, "line": 32 }, + "start": { "character": 0, "line": 26 } +} newText: <--here let foo = x => { @@ -92,7 +113,10 @@ Xform src/Xform.res 34:21 Hit: Add type annotation TextDocumentEdit: Xform.res -{"start": {"line": 34, "character": 24}, "end": {"line": 34, "character": 24}} +{ + "end": { "character": 24, "line": 34 }, + "start": { "character": 24, "line": 34 } +} newText: <--here : int @@ -101,7 +125,10 @@ Xform src/Xform.res 38:5 Hit: Add Documentation template TextDocumentEdit: Xform.res -{"start": {"line": 37, "character": 0}, "end": {"line": 38, "character": 40}} +{ + "end": { "character": 40, "line": 38 }, + "start": { "character": 0, "line": 37 } +} newText: <--here /** @@ -114,7 +141,10 @@ Xform src/Xform.res 41:9 Hit: Add type annotation TextDocumentEdit: Xform.res -{"start": {"line": 41, "character": 11}, "end": {"line": 41, "character": 11}} +{ + "end": { "character": 11, "line": 41 }, + "start": { "character": 11, "line": 41 } +} newText: <--here : int @@ -131,7 +161,10 @@ Resolved opens 1 Stdlib Hit: Add braces to function TextDocumentEdit: Xform.res -{"start": {"line": 48, "character": 0}, "end": {"line": 48, "character": 25}} +{ + "end": { "character": 25, "line": 48 }, + "start": { "character": 0, "line": 48 } +} newText: <--here let noBraces = () => { @@ -142,7 +175,10 @@ Xform src/Xform.res 52:34 Hit: Add braces to function TextDocumentEdit: Xform.res -{"start": {"line": 51, "character": 0}, "end": {"line": 54, "character": 1}} +{ + "end": { "character": 1, "line": 54 }, + "start": { "character": 0, "line": 51 } +} newText: <--here let nested = () => { @@ -156,7 +192,10 @@ Xform src/Xform.res 62:6 Hit: Add braces to function TextDocumentEdit: Xform.res -{"start": {"line": 58, "character": 4}, "end": {"line": 62, "character": 7}} +{ + "end": { "character": 7, "line": 62 }, + "start": { "character": 4, "line": 58 } +} newText: <--here let foo = (_x, y, _z) => { @@ -172,7 +211,10 @@ Hit: Extract local module "ExtractableModule" to file "ExtractableModule.res" CreateFile: ExtractableModule.res TextDocumentEdit: ExtractableModule.res -{"start": {"line": 0, "character": 0}, "end": {"line": 0, "character": 0}} +{ + "end": { "character": 1, "line": 74 }, + "start": { "character": 0, "line": 68 } +} newText: <--here /** Doc comment. */ @@ -182,8 +224,11 @@ let doStuff = a => a + 1 // ^xfm -TextDocumentEdit: src/Xform.res -{"start": {"line": 68, "character": 0}, "end": {"line": 74, "character": 1}} +TextDocumentEdit: Xform.res +{ + "end": { "character": 1, "line": 74 }, + "start": { "character": 0, "line": 68 } +} newText: <--here @@ -200,7 +245,10 @@ Resolved opens 1 Stdlib Hit: Expand catch-all TextDocumentEdit: Xform.res -{"start": {"line": 80, "character": 2}, "end": {"line": 80, "character": 3}} +{ + "end": { "character": 3, "line": 80 }, + "start": { "character": 2, "line": 80 } +} newText: <--here Second | Third | Fourth(_) @@ -217,7 +265,10 @@ Resolved opens 1 Stdlib Hit: Expand catch-all TextDocumentEdit: Xform.res -{"start": {"line": 86, "character": 2}, "end": {"line": 86, "character": 3}} +{ + "end": { "character": 3, "line": 86 }, + "start": { "character": 2, "line": 86 } +} newText: <--here Third | Fourth(_) @@ -234,7 +285,10 @@ Resolved opens 1 Stdlib Hit: Expand catch-all TextDocumentEdit: Xform.res -{"start": {"line": 93, "character": 2}, "end": {"line": 93, "character": 3}} +{ + "end": { "character": 3, "line": 93 }, + "start": { "character": 2, "line": 93 } +} newText: <--here First | Third | Fourth(_) @@ -251,7 +305,10 @@ Resolved opens 1 Stdlib Hit: Expand catch-all TextDocumentEdit: Xform.res -{"start": {"line": 101, "character": 2}, "end": {"line": 101, "character": 3}} +{ + "end": { "character": 3, "line": 101 }, + "start": { "character": 2, "line": 101 } +} newText: <--here #second | #"illegal identifier" | #third(_) @@ -268,7 +325,10 @@ Resolved opens 1 Stdlib Hit: Expand catch-all TextDocumentEdit: Xform.res -{"start": {"line": 107, "character": 2}, "end": {"line": 107, "character": 3}} +{ + "end": { "character": 3, "line": 107 }, + "start": { "character": 2, "line": 107 } +} newText: <--here #"illegal identifier" | #third(_) @@ -285,7 +345,10 @@ Resolved opens 1 Stdlib Hit: Expand catch-all TextDocumentEdit: Xform.res -{"start": {"line": 115, "character": 2}, "end": {"line": 115, "character": 3}} +{ + "end": { "character": 3, "line": 115 }, + "start": { "character": 2, "line": 115 } +} newText: <--here Some(Second | Third | Fourth(_)) | None @@ -302,7 +365,10 @@ Resolved opens 1 Stdlib Hit: Expand catch-all TextDocumentEdit: Xform.res -{"start": {"line": 121, "character": 2}, "end": {"line": 121, "character": 3}} +{ + "end": { "character": 3, "line": 121 }, + "start": { "character": 2, "line": 121 } +} newText: <--here Some(Third | Fourth(_)) | None @@ -319,7 +385,10 @@ Resolved opens 1 Stdlib Hit: Expand catch-all TextDocumentEdit: Xform.res -{"start": {"line": 127, "character": 2}, "end": {"line": 127, "character": 3}} +{ + "end": { "character": 3, "line": 127 }, + "start": { "character": 2, "line": 127 } +} newText: <--here Some(Third | Fourth(_)) | None @@ -336,7 +405,10 @@ Resolved opens 1 Stdlib Hit: Expand catch-all TextDocumentEdit: Xform.res -{"start": {"line": 136, "character": 2}, "end": {"line": 136, "character": 3}} +{ + "end": { "character": 3, "line": 136 }, + "start": { "character": 2, "line": 136 } +} newText: <--here Some(#"illegal identifier" | #second | #third(_)) @@ -353,7 +425,10 @@ Resolved opens 1 Stdlib Hit: Expand catch-all TextDocumentEdit: Xform.res -{"start": {"line": 142, "character": 2}, "end": {"line": 142, "character": 3}} +{ + "end": { "character": 3, "line": 142 }, + "start": { "character": 2, "line": 142 } +} newText: <--here Some(#"illegal identifier" | #third(_)) | None diff --git a/tests/docstring_tests/DocTest.res b/tests/docstring_tests/DocTest.res index 779fa0cf8fc..f806d9d0176 100644 --- a/tests/docstring_tests/DocTest.res +++ b/tests/docstring_tests/DocTest.res @@ -71,14 +71,8 @@ let extractExamples = async () => { let examples = [] await docFiles->ArrayUtils.forEachAsyncInBatches(~batchSize, async f => { let doc = await extractDocFromFile(Path.join([runtimePath, f])) - switch doc { - | Ok(doc) => - // TODO: Should this be a flag in the actual command instead, to only include code blocks with tests? - examples->Array.pushMany(doc->Array.filter(d => d.code->String.includes("assertEqual("))) - | Error(e) => - Console.error(e) - JsError.panic(`Error extracting code blocks for ${f}`) - } + // TODO: Should this be a flag in the actual command instead, to only include code blocks with tests? + examples->Array.pushMany(doc->Array.filter(d => d.code->String.includes("assertEqual("))) }) examples->Array.sort((a, b) => String.compare(a.id, b.id)) diff --git a/tests/docstring_tests/DocTest.res.js b/tests/docstring_tests/DocTest.res.js index dbe11a97ee1..c372acd3dc5 100644 --- a/tests/docstring_tests/DocTest.res.js +++ b/tests/docstring_tests/DocTest.res.js @@ -77,12 +77,7 @@ async function extractExamples() { let examples = []; await ArrayUtils.forEachAsyncInBatches(docFiles, batchSize, async f => { let doc = await extractDocFromFile(Nodepath.join(runtimePath, f)); - if (doc.TAG === "Ok") { - examples.push(...doc._0.filter(d => d.code.includes("assertEqual("))); - return; - } - console.error(doc._0); - return Stdlib_JsError.panic(`Error extracting code blocks for ` + f); + examples.push(...doc.filter(d => d.code.includes("assertEqual("))); }); examples.sort((a, b) => Primitive_string.compare(a.id, b.id)); return examples; diff --git a/tests/ounit_tests/ounit_json_tests.ml b/tests/ounit_tests/ounit_json_tests.ml index e096bce0757..c33b4068e7e 100644 --- a/tests/ounit_tests/ounit_json_tests.ml +++ b/tests/ounit_tests/ounit_json_tests.ml @@ -4,11 +4,11 @@ let suites = __FILE__ >::: [ ( "escape 'hello'" >:: fun _ -> - let escaped = Json.escape "hello" in - let expected = "hello" in + let escaped = `String "hello" |> Yojson.Safe.to_string in + let expected = "\"hello\"" in OUnit.assert_equal escaped expected ); ( "escape \\x17" >:: fun _ -> - let escaped = Json.escape "\x17" in - let expected = "\\u0017" in + let escaped = `String "\x17" |> Yojson.Safe.to_string in + let expected = "\"\\u0017\"" in OUnit.assert_equal escaped expected ); ] diff --git a/tests/tools_tests/src/expected/DocExtraction2.res.json b/tests/tools_tests/src/expected/DocExtraction2.res.json index bd71cd75607..79eac3729cf 100644 --- a/tests/tools_tests/src/expected/DocExtraction2.res.json +++ b/tests/tools_tests/src/expected/DocExtraction2.res.json @@ -1,117 +1,104 @@ - { "name": "DocExtraction2", - "docstrings": ["Module level doc here."], - "source": { - "filepath": "src/DocExtraction2.resi", - "line": 1, - "col": 1 - }, + "docstrings": [ "Module level doc here." ], + "source": { "filepath": "src/DocExtraction2.resi", "line": 1, "col": 1 }, "items": [ - { - "id": "DocExtraction2.t", - "kind": "type", - "name": "t", - "signature": "type t", - "docstrings": ["Type t is pretty cool."], - "source": { - "filepath": "src/DocExtraction2.resi", - "line": 4, - "col": 1 - } - }, - { - "id": "DocExtraction2.make", - "kind": "value", - "name": "make", - "signature": "let make: unit => t", - "docstrings": ["Makerz of stuffz."], - "source": { - "filepath": "src/DocExtraction2.resi", - "line": 7, - "col": 1 - }, - "detail": - { - "kind": "signature", - "details": { - "parameters": [{ - "path": "unit" - }], - "returnType": { - "path": "t" - } - } - } - }, - { - "id": "DocExtraction2.InnerModule", - "name": "InnerModule", - "kind": "module", - "docstrings": [], - "source": { - "filepath": "src/DocExtraction2.resi", - "line": 9, - "col": 8 - }, - "items": [ { - "id": "DocExtraction2.InnerModule.t", + "id": "DocExtraction2.t", "kind": "type", "name": "t", "signature": "type t", - "docstrings": ["This type is also t."], + "docstrings": [ "Type t is pretty cool." ], "source": { "filepath": "src/DocExtraction2.resi", - "line": 13, - "col": 3 + "line": 4, + "col": 1 } - }, + }, { - "id": "DocExtraction2.InnerModule.make", + "id": "DocExtraction2.make", "kind": "value", "name": "make", "signature": "let make: unit => t", - "docstrings": ["Maker of tea."], + "docstrings": [ "Makerz of stuffz." ], "source": { "filepath": "src/DocExtraction2.resi", - "line": 15, - "col": 3 + "line": 7, + "col": 1 }, - "detail": - { + "detail": { "kind": "signature", "details": { - "parameters": [{ - "path": "unit" - }], - "returnType": { - "path": "t" + "parameters": [ { "path": "unit", "genericTypeParameters": [] } ], + "returnType": { "path": "t", "genericTypeParameters": [] } } } - } - }] - }, - { - "id": "DocExtraction2.log", - "kind": "value", - "name": "log", - "deprecated": "Use log instead", - "signature": "let log: 'a => unit", - "docstrings": [], - "source": { - "filepath": "src/DocExtraction2.resi", - "line": 25, - "col": 1 }, - "detail": { - "kind": "signature", - "details": { - "returnType": { - "path": "unit" + "id": "DocExtraction2.InnerModule", + "name": "InnerModule", + "kind": "module", + "docstrings": [], + "source": { + "filepath": "src/DocExtraction2.resi", + "line": 9, + "col": 8 + }, + "items": [ + { + "id": "DocExtraction2.InnerModule.t", + "kind": "type", + "name": "t", + "signature": "type t", + "docstrings": [ "This type is also t." ], + "source": { + "filepath": "src/DocExtraction2.resi", + "line": 13, + "col": 3 + } + }, + { + "id": "DocExtraction2.InnerModule.make", + "kind": "value", + "name": "make", + "signature": "let make: unit => t", + "docstrings": [ "Maker of tea." ], + "source": { + "filepath": "src/DocExtraction2.resi", + "line": 15, + "col": 3 + }, + "detail": { + "kind": "signature", + "details": { + "parameters": [ + { "path": "unit", "genericTypeParameters": [] } + ], + "returnType": { "path": "t", "genericTypeParameters": [] } + } + } + } + ] + }, + { + "id": "DocExtraction2.log", + "kind": "value", + "name": "log", + "signature": "let log: 'a => unit", + "docstrings": [], + "source": { + "filepath": "src/DocExtraction2.resi", + "line": 25, + "col": 1 + }, + "deprecated": "Use log instead", + "detail": { + "kind": "signature", + "details": { + "parameters": [], + "returnType": { "path": "unit", "genericTypeParameters": [] } + } } } - } - }] + ] } diff --git a/tests/tools_tests/src/expected/DocExtraction2.resi.json b/tests/tools_tests/src/expected/DocExtraction2.resi.json index bd71cd75607..79eac3729cf 100644 --- a/tests/tools_tests/src/expected/DocExtraction2.resi.json +++ b/tests/tools_tests/src/expected/DocExtraction2.resi.json @@ -1,117 +1,104 @@ - { "name": "DocExtraction2", - "docstrings": ["Module level doc here."], - "source": { - "filepath": "src/DocExtraction2.resi", - "line": 1, - "col": 1 - }, + "docstrings": [ "Module level doc here." ], + "source": { "filepath": "src/DocExtraction2.resi", "line": 1, "col": 1 }, "items": [ - { - "id": "DocExtraction2.t", - "kind": "type", - "name": "t", - "signature": "type t", - "docstrings": ["Type t is pretty cool."], - "source": { - "filepath": "src/DocExtraction2.resi", - "line": 4, - "col": 1 - } - }, - { - "id": "DocExtraction2.make", - "kind": "value", - "name": "make", - "signature": "let make: unit => t", - "docstrings": ["Makerz of stuffz."], - "source": { - "filepath": "src/DocExtraction2.resi", - "line": 7, - "col": 1 - }, - "detail": - { - "kind": "signature", - "details": { - "parameters": [{ - "path": "unit" - }], - "returnType": { - "path": "t" - } - } - } - }, - { - "id": "DocExtraction2.InnerModule", - "name": "InnerModule", - "kind": "module", - "docstrings": [], - "source": { - "filepath": "src/DocExtraction2.resi", - "line": 9, - "col": 8 - }, - "items": [ { - "id": "DocExtraction2.InnerModule.t", + "id": "DocExtraction2.t", "kind": "type", "name": "t", "signature": "type t", - "docstrings": ["This type is also t."], + "docstrings": [ "Type t is pretty cool." ], "source": { "filepath": "src/DocExtraction2.resi", - "line": 13, - "col": 3 + "line": 4, + "col": 1 } - }, + }, { - "id": "DocExtraction2.InnerModule.make", + "id": "DocExtraction2.make", "kind": "value", "name": "make", "signature": "let make: unit => t", - "docstrings": ["Maker of tea."], + "docstrings": [ "Makerz of stuffz." ], "source": { "filepath": "src/DocExtraction2.resi", - "line": 15, - "col": 3 + "line": 7, + "col": 1 }, - "detail": - { + "detail": { "kind": "signature", "details": { - "parameters": [{ - "path": "unit" - }], - "returnType": { - "path": "t" + "parameters": [ { "path": "unit", "genericTypeParameters": [] } ], + "returnType": { "path": "t", "genericTypeParameters": [] } } } - } - }] - }, - { - "id": "DocExtraction2.log", - "kind": "value", - "name": "log", - "deprecated": "Use log instead", - "signature": "let log: 'a => unit", - "docstrings": [], - "source": { - "filepath": "src/DocExtraction2.resi", - "line": 25, - "col": 1 }, - "detail": { - "kind": "signature", - "details": { - "returnType": { - "path": "unit" + "id": "DocExtraction2.InnerModule", + "name": "InnerModule", + "kind": "module", + "docstrings": [], + "source": { + "filepath": "src/DocExtraction2.resi", + "line": 9, + "col": 8 + }, + "items": [ + { + "id": "DocExtraction2.InnerModule.t", + "kind": "type", + "name": "t", + "signature": "type t", + "docstrings": [ "This type is also t." ], + "source": { + "filepath": "src/DocExtraction2.resi", + "line": 13, + "col": 3 + } + }, + { + "id": "DocExtraction2.InnerModule.make", + "kind": "value", + "name": "make", + "signature": "let make: unit => t", + "docstrings": [ "Maker of tea." ], + "source": { + "filepath": "src/DocExtraction2.resi", + "line": 15, + "col": 3 + }, + "detail": { + "kind": "signature", + "details": { + "parameters": [ + { "path": "unit", "genericTypeParameters": [] } + ], + "returnType": { "path": "t", "genericTypeParameters": [] } + } + } + } + ] + }, + { + "id": "DocExtraction2.log", + "kind": "value", + "name": "log", + "signature": "let log: 'a => unit", + "docstrings": [], + "source": { + "filepath": "src/DocExtraction2.resi", + "line": 25, + "col": 1 + }, + "deprecated": "Use log instead", + "detail": { + "kind": "signature", + "details": { + "parameters": [], + "returnType": { "path": "unit", "genericTypeParameters": [] } + } } } - } - }] + ] } diff --git a/tests/tools_tests/src/expected/DocExtractionRes.res.json b/tests/tools_tests/src/expected/DocExtractionRes.res.json index c2120b97989..5d3d3c2bdc2 100644 --- a/tests/tools_tests/src/expected/DocExtractionRes.res.json +++ b/tests/tools_tests/src/expected/DocExtractionRes.res.json @@ -1,513 +1,452 @@ - { "name": "DocExtractionRes", - "docstrings": ["Module level documentation goes here."], - "source": { - "filepath": "src/DocExtractionRes.res", - "line": 1, - "col": 1 - }, + "docstrings": [ "Module level documentation goes here." ], + "source": { "filepath": "src/DocExtractionRes.res", "line": 1, "col": 1 }, "items": [ - { - "id": "DocExtractionRes.t", - "kind": "type", - "name": "t", - "signature": "type t = {name: string, online: bool}", - "docstrings": ["This type represents stuff."], - "source": { - "filepath": "src/DocExtractionRes.res", - "line": 4, - "col": 1 - }, - "detail": - { - "kind": "record", - "items": [{ - "name": "name", - "optional": false, - "docstrings": ["The name of the stuff."], - "signature": "string" - }, { - "name": "online", - "optional": false, - "docstrings": ["Whether stuff is online."], - "signature": "bool" - }] - } - }, - { - "id": "DocExtractionRes.make", - "kind": "value", - "name": "make", - "signature": "let make: string => t", - "docstrings": ["Create stuff.\n\n```rescript example\nlet stuff = make(\"My name\")\n```"], - "source": { - "filepath": "src/DocExtractionRes.res", - "line": 17, - "col": 5 - }, - "detail": - { - "kind": "signature", - "details": { - "parameters": [{ - "path": "string" - }], - "returnType": { - "path": "t" - } - } - } - }, - { - "id": "DocExtractionRes.asOffline", - "kind": "value", - "name": "asOffline", - "signature": "let asOffline: t => t", - "docstrings": ["Stuff goes offline."], - "source": { - "filepath": "src/DocExtractionRes.res", - "line": 23, - "col": 5 - }, - "detail": - { - "kind": "signature", - "details": { - "parameters": [{ - "path": "t" - }], - "returnType": { - "path": "t" - } - } - } - }, - { - "id": "DocExtractionRes.SomeConstant", - "kind": "value", - "name": "SomeConstant", - "signature": "let SomeConstant: int", - "docstrings": ["exotic identifier"], - "source": { - "filepath": "src/DocExtractionRes.res", - "line": 26, - "col": 5 - }, - "detail": { - "kind": "signature", - "details": { - "returnType": { - "path": "int" - } - } - } - }, - { - "id": "DocExtractionRes.SomeInnerModule", - "name": "SomeInnerModule", - "kind": "module", - "docstrings": ["Another module level docstring here."], - "source": { - "filepath": "src/DocExtractionRes.res", - "line": 28, - "col": 8 - }, - "items": [ - { - "id": "DocExtractionRes.SomeInnerModule.status", + "id": "DocExtractionRes.t", "kind": "type", - "name": "status", - "signature": "type status = Started(t) | Stopped | Idle", - "docstrings": [], + "name": "t", + "signature": "type t = {name: string, online: bool}", + "docstrings": [ "This type represents stuff." ], "source": { "filepath": "src/DocExtractionRes.res", - "line": 30, - "col": 3 + "line": 4, + "col": 1 }, - "detail": - { - "kind": "variant", + "detail": { + "kind": "record", "items": [ - { - "name": "Started", - "docstrings": ["If this is started or not"], - "signature": "Started(t)" - }, - { - "name": "Stopped", - "docstrings": ["Stopped?"], - "signature": "Stopped" - }, - { - "name": "Idle", - "docstrings": ["Now idle."], - "signature": "Idle" - }] - } - }, - { - "id": "DocExtractionRes.SomeInnerModule.validInputs", - "kind": "type", - "name": "validInputs", - "signature": "type validInputs = [\n | #\"needs-escaping\"\n | #something\n | #status(status)\n | #withPayload(int)\n]", - "docstrings": ["These are all the valid inputs."], - "source": { - "filepath": "src/DocExtractionRes.res", - "line": 39, - "col": 3 - } - }, - { - "id": "DocExtractionRes.SomeInnerModule.callback", - "kind": "type", - "name": "callback", - "signature": "type callback = (t, ~status: status) => unit", - "docstrings": [], - "source": { - "filepath": "src/DocExtractionRes.res", - "line": 41, - "col": 3 + { + "name": "name", + "optional": false, + "docstrings": [ "The name of the stuff." ], + "signature": "string" + }, + { + "name": "online", + "optional": false, + "docstrings": [ "Whether stuff is online." ], + "signature": "bool" + } + ] } - }] - }, - { - "id": "DocExtractionRes.AnotherModule", - "name": "AnotherModule", - "kind": "module", - "docstrings": ["Mighty fine module here too!"], - "source": { - "filepath": "src/DocExtractionRes.res", - "line": 44, - "col": 8 }, - "items": [ - { - "id": "DocExtractionRes.LinkedModule", - "kind": "moduleAlias", - "name": "LinkedModule", - "docstrings": ["This links another module. Neat."], - "source": { - "filepath": "src/DocExtractionRes.res", - "line": 48, - "col": 10 - }, - "items": [] - }, - { - "id": "DocExtractionRes.AnotherModule.callback", - "kind": "type", - "name": "callback", - "signature": "type callback = SomeInnerModule.status => unit", - "docstrings": ["Testing what this looks like."], - "source": { - "filepath": "src/DocExtractionRes.res", - "line": 52, - "col": 3 - } - }, { - "id": "DocExtractionRes.AnotherModule.isGoodStatus", + "id": "DocExtractionRes.make", "kind": "value", - "name": "isGoodStatus", - "signature": "let isGoodStatus: SomeInnerModule.status => bool", - "docstrings": [], + "name": "make", + "signature": "let make: string => t", + "docstrings": [ + "Create stuff.\n\n```rescript example\nlet stuff = make(\"My name\")\n```" + ], "source": { "filepath": "src/DocExtractionRes.res", - "line": 54, - "col": 7 + "line": 17, + "col": 5 }, - "detail": - { + "detail": { "kind": "signature", "details": { - "parameters": [{ - "path": "SomeInnerModule.status" - }], - "returnType": { - "path": "bool" + "parameters": [ { "path": "string", "genericTypeParameters": [] } ], + "returnType": { "path": "t", "genericTypeParameters": [] } } } - } - }, + }, { - "id": "DocExtractionRes.AnotherModule.someVariantWithInlineRecords", - "kind": "type", - "name": "someVariantWithInlineRecords", - "signature": "type someVariantWithInlineRecords =\n | SomeStuff({offline: bool, online?: bool})", - "docstrings": ["Trying how it looks with an inline record in a variant."], + "id": "DocExtractionRes.asOffline", + "kind": "value", + "name": "asOffline", + "signature": "let asOffline: t => t", + "docstrings": [ "Stuff goes offline." ], "source": { "filepath": "src/DocExtractionRes.res", - "line": 57, - "col": 3 + "line": 23, + "col": 5 }, - "detail": - { - "kind": "variant", - "items": [ - { - "name": "SomeStuff", - "docstrings": ["This has inline records..."], - "signature": "SomeStuff({offline: bool, online?: bool})", - "payload": { - "kind": "inlineRecord", - "fields": [{ - "name": "offline", - "optional": false, - "docstrings": [], - "signature": "bool" - }, { - "name": "online", - "optional": true, - "docstrings": ["Is the user online?"], - "signature": "option" - }] - } - }] - } - }, - { - "id": "DocExtractionRes.AnotherModule.domRoot", - "kind": "type", - "name": "domRoot", - "signature": "type domRoot = unit => ReactDOM.Client.Root.t", - "docstrings": ["Callback to get the DOM root..."], - "source": { - "filepath": "src/DocExtractionRes.res", - "line": 68, - "col": 3 + "detail": { + "kind": "signature", + "details": { + "parameters": [ { "path": "t", "genericTypeParameters": [] } ], + "returnType": { "path": "t", "genericTypeParameters": [] } + } } - }] - }, - { - "id": "DocExtractionRes.ModuleWithThingsThatShouldNotBeExported", - "name": "ModuleWithThingsThatShouldNotBeExported", - "kind": "module", - "docstrings": [], - "source": { - "filepath": "src/DocExtractionRes.res", - "line": 1, - "col": 1 }, - "items": [ { - "id": "DocExtractionRes.ModuleWithThingsThatShouldNotBeExported.t", - "kind": "type", - "name": "t", - "signature": "type t", - "docstrings": ["The type t is stuff."], - "source": { - "filepath": "src/DocExtractionRes.res", - "line": 75, - "col": 3 - } - }, - { - "id": "DocExtractionRes.ModuleWithThingsThatShouldNotBeExported.make", + "id": "DocExtractionRes.SomeConstant", "kind": "value", - "name": "make", - "signature": "let make: unit => t", - "docstrings": ["The maker of stuff!"], + "name": "SomeConstant", + "signature": "let SomeConstant: int", + "docstrings": [ "exotic identifier" ], "source": { "filepath": "src/DocExtractionRes.res", - "line": 77, - "col": 3 + "line": 26, + "col": 5 }, - "detail": - { + "detail": { "kind": "signature", "details": { - "parameters": [{ - "path": "unit" - }], - "returnType": { - "path": "t" + "parameters": [], + "returnType": { "path": "int", "genericTypeParameters": [] } } } - } - }] - }, - { - "id": "DocExtractionRes.Example", - "name": "Example", - "kind": "moduleType", - "docstrings": [], - "source": { - "filepath": "src/DocExtractionRes.res", - "line": 105, - "col": 13 }, - "items": [ { - "id": "DocExtractionRes.Example.t", - "kind": "type", - "name": "t", - "signature": "type t", - "docstrings": ["main type of this module"], + "id": "DocExtractionRes.SomeInnerModule", + "name": "SomeInnerModule", + "kind": "module", + "docstrings": [ "Another module level docstring here." ], "source": { "filepath": "src/DocExtractionRes.res", - "line": 113, - "col": 3 - } - }, + "line": 28, + "col": 8 + }, + "items": [ + { + "id": "DocExtractionRes.SomeInnerModule.status", + "kind": "type", + "name": "status", + "signature": "type status = Started(t) | Stopped | Idle", + "docstrings": [], + "source": { + "filepath": "src/DocExtractionRes.res", + "line": 30, + "col": 3 + }, + "detail": { + "kind": "variant", + "items": [ + { + "name": "Started", + "docstrings": [ "If this is started or not" ], + "signature": "Started(t)" + }, + { + "name": "Stopped", + "docstrings": [ "Stopped?" ], + "signature": "Stopped" + }, + { + "name": "Idle", + "docstrings": [ "Now idle." ], + "signature": "Idle" + } + ] + } + }, + { + "id": "DocExtractionRes.SomeInnerModule.validInputs", + "kind": "type", + "name": "validInputs", + "signature": "type validInputs = [\n | #\"needs-escaping\"\n | #something\n | #status(status)\n | #withPayload(int)\n]", + "docstrings": [ "These are all the valid inputs." ], + "source": { + "filepath": "src/DocExtractionRes.res", + "line": 39, + "col": 3 + } + }, + { + "id": "DocExtractionRes.SomeInnerModule.callback", + "kind": "type", + "name": "callback", + "signature": "type callback = (t, ~status: status) => unit", + "docstrings": [], + "source": { + "filepath": "src/DocExtractionRes.res", + "line": 41, + "col": 3 + } + } + ] + }, { - "id": "DocExtractionRes.Example.f", - "kind": "value", - "name": "f", - "signature": "let f: t => t", - "docstrings": ["function from t to t"], + "id": "DocExtractionRes.AnotherModule", + "name": "AnotherModule", + "kind": "module", + "docstrings": [ "Mighty fine module here too!" ], "source": { "filepath": "src/DocExtractionRes.res", - "line": 115, - "col": 3 + "line": 44, + "col": 8 }, - "detail": - { - "kind": "signature", - "details": { - "parameters": [{ - "path": "t" - }], - "returnType": { - "path": "t" + "items": [ + { + "id": "DocExtractionRes.LinkedModule", + "kind": "moduleAlias", + "name": "LinkedModule", + "docstrings": [ "This links another module. Neat." ], + "source": { + "filepath": "src/DocExtractionRes.res", + "line": 48, + "col": 10 + }, + "items": [] + }, + { + "id": "DocExtractionRes.AnotherModule.callback", + "kind": "type", + "name": "callback", + "signature": "type callback = SomeInnerModule.status => unit", + "docstrings": [ "Testing what this looks like." ], + "source": { + "filepath": "src/DocExtractionRes.res", + "line": 52, + "col": 3 + } + }, + { + "id": "DocExtractionRes.AnotherModule.isGoodStatus", + "kind": "value", + "name": "isGoodStatus", + "signature": "let isGoodStatus: SomeInnerModule.status => bool", + "docstrings": [], + "source": { + "filepath": "src/DocExtractionRes.res", + "line": 54, + "col": 7 + }, + "detail": { + "kind": "signature", + "details": { + "parameters": [ + { + "path": "SomeInnerModule.status", + "genericTypeParameters": [] + } + ], + "returnType": { "path": "bool", "genericTypeParameters": [] } + } + } + }, + { + "id": "DocExtractionRes.AnotherModule.someVariantWithInlineRecords", + "kind": "type", + "name": "someVariantWithInlineRecords", + "signature": "type someVariantWithInlineRecords =\n | SomeStuff({offline: bool, online?: bool})", + "docstrings": [ + "Trying how it looks with an inline record in a variant." + ], + "source": { + "filepath": "src/DocExtractionRes.res", + "line": 57, + "col": 3 + }, + "detail": { + "kind": "variant", + "items": [ + { + "name": "SomeStuff", + "docstrings": [ "This has inline records..." ], + "signature": "SomeStuff({offline: bool, online?: bool})", + "payload": { + "kind": "inlineRecord", + "fields": [ + { + "name": "offline", + "optional": false, + "docstrings": [], + "signature": "bool" + }, + { + "name": "online", + "optional": true, + "docstrings": [ "Is the user online?" ], + "signature": "option" + } + ] + } + } + ] + } + }, + { + "id": "DocExtractionRes.AnotherModule.domRoot", + "kind": "type", + "name": "domRoot", + "signature": "type domRoot = unit => ReactDOM.Client.Root.t", + "docstrings": [ "Callback to get the DOM root..." ], + "source": { + "filepath": "src/DocExtractionRes.res", + "line": 68, + "col": 3 + } } - } - } - }] - }, - { - "id": "DocExtractionRes.M", - "name": "M", - "kind": "module", - "moduletypeid": "DocExtractionRes.Example", - "docstrings": ["implementation of Example module type"], - "source": { - "filepath": "src/DocExtractionRes.res", - "line": 1, - "col": 1 + ] }, - "items": [ { - "id": "DocExtractionRes.M.t", - "kind": "type", - "name": "t", - "signature": "type t = int", - "docstrings": ["main type"], + "id": "DocExtractionRes.ModuleWithThingsThatShouldNotBeExported", + "name": "ModuleWithThingsThatShouldNotBeExported", + "kind": "module", + "docstrings": [], "source": { "filepath": "src/DocExtractionRes.res", - "line": 129, - "col": 3 - } - }, + "line": 1, + "col": 1 + }, + "items": [ + { + "id": "DocExtractionRes.ModuleWithThingsThatShouldNotBeExported.t", + "kind": "type", + "name": "t", + "signature": "type t", + "docstrings": [ "The type t is stuff." ], + "source": { + "filepath": "src/DocExtractionRes.res", + "line": 75, + "col": 3 + } + }, + { + "id": "DocExtractionRes.ModuleWithThingsThatShouldNotBeExported.make", + "kind": "value", + "name": "make", + "signature": "let make: unit => t", + "docstrings": [ "The maker of stuff!" ], + "source": { + "filepath": "src/DocExtractionRes.res", + "line": 77, + "col": 3 + }, + "detail": { + "kind": "signature", + "details": { + "parameters": [ + { "path": "unit", "genericTypeParameters": [] } + ], + "returnType": { "path": "t", "genericTypeParameters": [] } + } + } + } + ] + }, { - "id": "DocExtractionRes.M.f", - "kind": "value", - "name": "f", - "signature": "let f: int => int", - "docstrings": ["identity function"], + "id": "DocExtractionRes.Example", + "name": "Example", + "kind": "moduleType", + "docstrings": [], "source": { "filepath": "src/DocExtractionRes.res", - "line": 134, - "col": 7 + "line": 105, + "col": 13 }, - "detail": - { - "kind": "signature", - "details": { - "parameters": [{ - "path": "int" - }], - "returnType": { - "path": "int" + "items": [ + { + "id": "DocExtractionRes.Example.t", + "kind": "type", + "name": "t", + "signature": "type t", + "docstrings": [ "main type of this module" ], + "source": { + "filepath": "src/DocExtractionRes.res", + "line": 113, + "col": 3 + } + }, + { + "id": "DocExtractionRes.Example.f", + "kind": "value", + "name": "f", + "signature": "let f: t => t", + "docstrings": [ "function from t to t" ], + "source": { + "filepath": "src/DocExtractionRes.res", + "line": 115, + "col": 3 + }, + "detail": { + "kind": "signature", + "details": { + "parameters": [ { "path": "t", "genericTypeParameters": [] } ], + "returnType": { "path": "t", "genericTypeParameters": [] } + } + } } - } - } - }] - }, - { - "id": "DocExtractionRes.MT", - "name": "MT", - "kind": "moduleType", - "docstrings": [], - "source": { - "filepath": "src/DocExtractionRes.res", - "line": 137, - "col": 13 + ] }, - "items": [ { - "id": "DocExtractionRes.MT.x", - "kind": "value", - "name": "x", - "signature": "let x: int", - "docstrings": [], + "id": "DocExtractionRes.M", + "name": "M", + "kind": "module", + "docstrings": [ "implementation of Example module type" ], "source": { "filepath": "src/DocExtractionRes.res", - "line": 138, - "col": 3 + "line": 1, + "col": 1 }, - "detail": - { - "kind": "signature", - "details": { - "returnType": { - "path": "int" + "items": [ + { + "id": "DocExtractionRes.M.t", + "kind": "type", + "name": "t", + "signature": "type t = int", + "docstrings": [ "main type" ], + "source": { + "filepath": "src/DocExtractionRes.res", + "line": 129, + "col": 3 + } + }, + { + "id": "DocExtractionRes.M.f", + "kind": "value", + "name": "f", + "signature": "let f: int => int", + "docstrings": [ "identity function" ], + "source": { + "filepath": "src/DocExtractionRes.res", + "line": 134, + "col": 7 + }, + "detail": { + "kind": "signature", + "details": { + "parameters": [ + { "path": "int", "genericTypeParameters": [] } + ], + "returnType": { "path": "int", "genericTypeParameters": [] } + } + } } - } - } - }] - }, - { - "id": "DocExtractionRes.A", - "name": "A", - "kind": "module", - "moduletypeid": "DocExtractionRes.MT", - "docstrings": [], - "source": { - "filepath": "src/DocExtractionRes.res", - "line": 1, - "col": 1 + ], + "moduletypeid": "DocExtractionRes.Example" }, - "items": [ { - "id": "DocExtractionRes.A.x", - "kind": "value", - "name": "x", - "signature": "let x: int", + "id": "DocExtractionRes.MT", + "name": "MT", + "kind": "moduleType", "docstrings": [], "source": { "filepath": "src/DocExtractionRes.res", - "line": 142, - "col": 7 + "line": 137, + "col": 13 }, - "detail": - { - "kind": "signature", - "details": { - "returnType": { - "path": "int" + "items": [ + { + "id": "DocExtractionRes.MT.x", + "kind": "value", + "name": "x", + "signature": "let x: int", + "docstrings": [], + "source": { + "filepath": "src/DocExtractionRes.res", + "line": 138, + "col": 3 + }, + "detail": { + "kind": "signature", + "details": { + "parameters": [], + "returnType": { "path": "int", "genericTypeParameters": [] } + } + } } - } - } - }] - }, - { - "id": "DocExtractionRes.C", - "name": "C", - "kind": "module", - "docstrings": [], - "source": { - "filepath": "src/DocExtractionRes.res", - "line": 145, - "col": 8 + ] }, - "items": [ { - "id": "DocExtractionRes.C.D", - "name": "D", + "id": "DocExtractionRes.A", + "name": "A", "kind": "module", - "moduletypeid": "DocExtractionRes.MT", "docstrings": [], "source": { "filepath": "src/DocExtractionRes.res", @@ -515,27 +454,76 @@ "col": 1 }, "items": [ - { - "id": "DocExtractionRes.C.D.x", - "kind": "value", - "name": "x", - "signature": "let x: int", - "docstrings": [], - "source": { - "filepath": "src/DocExtractionRes.res", - "line": 147, - "col": 9 - }, - "detail": { - "kind": "signature", - "details": { - "returnType": { - "path": "int" + "id": "DocExtractionRes.A.x", + "kind": "value", + "name": "x", + "signature": "let x: int", + "docstrings": [], + "source": { + "filepath": "src/DocExtractionRes.res", + "line": 142, + "col": 7 + }, + "detail": { + "kind": "signature", + "details": { + "parameters": [], + "returnType": { "path": "int", "genericTypeParameters": [] } + } } } + ], + "moduletypeid": "DocExtractionRes.MT" + }, + { + "id": "DocExtractionRes.C", + "name": "C", + "kind": "module", + "docstrings": [], + "source": { + "filepath": "src/DocExtractionRes.res", + "line": 145, + "col": 8 + }, + "items": [ + { + "id": "DocExtractionRes.C.D", + "name": "D", + "kind": "module", + "docstrings": [], + "source": { + "filepath": "src/DocExtractionRes.res", + "line": 1, + "col": 1 + }, + "items": [ + { + "id": "DocExtractionRes.C.D.x", + "kind": "value", + "name": "x", + "signature": "let x: int", + "docstrings": [], + "source": { + "filepath": "src/DocExtractionRes.res", + "line": 147, + "col": 9 + }, + "detail": { + "kind": "signature", + "details": { + "parameters": [], + "returnType": { + "path": "int", + "genericTypeParameters": [] + } + } + } + } + ], + "moduletypeid": "DocExtractionRes.MT" } - }] - }] - }] + ] + } + ] } diff --git a/tests/tools_tests/src/expected/ExtractCodeBlocksTest.res.extracted.json.expected b/tests/tools_tests/src/expected/ExtractCodeBlocksTest.res.extracted.json.expected index aa06f3882d2..ef1767b89a9 100644 --- a/tests/tools_tests/src/expected/ExtractCodeBlocksTest.res.extracted.json.expected +++ b/tests/tools_tests/src/expected/ExtractCodeBlocksTest.res.extracted.json.expected @@ -1,8 +1,7 @@ -{ - "TAG": "Ok", - "_0": [{ +[ + { "id": "ExtractCodeBlocksTest.testFunction1", "name": "testFunction1", "code": "let x = 12\nlet y = 12->Array.filter(x => x == 12)\nassertEqual(x, 12)" - }] } +] diff --git a/tests/tools_tests/src/expected/FormatDocstringsTest1.res.extracted.json.expected b/tests/tools_tests/src/expected/FormatDocstringsTest1.res.extracted.json.expected index 5fee63a034c..bc25518b269 100644 --- a/tests/tools_tests/src/expected/FormatDocstringsTest1.res.extracted.json.expected +++ b/tests/tools_tests/src/expected/FormatDocstringsTest1.res.extracted.json.expected @@ -1,20 +1,22 @@ -{ - "TAG": "Ok", - "_0": [{ +[ + { "id": "FormatDocstringsTest1.testFunction3", "name": "testFunction3", "code": "let processUsers = (users: array) => {\n users\n ->Array.map(user => {...user, active: false})\n ->Array.filter(u => u.age > 21)\n}\n\ntype status = Loading | Success(string) | Error(option)" - }, { + }, + { "id": "FormatDocstringsTest1.Nested.testFunction2", "name": "testFunction2", "code": "module UserService = {\n let validate = user => user.age >= 18 && user.name !== \"\"\n let getName = user => user.name\n}" - }, { + }, + { "id": "FormatDocstringsTest1.testFunction1-2", "name": "testFunction1", "code": "type user = {name: string, age: int, active: bool}\nlet createUser = (name, age) => {name, age, active: true}" - }, { + }, + { "id": "FormatDocstringsTest1.testFunction1-1", "name": "testFunction1", "code": "let badly_formatted = (x, y) => {\n let result = x + y\n if result > 0 {\n Console.log(\"positive\")\n } else {\n Console.log(\"negative\")\n }\n result\n}" - }] } +] diff --git a/tests/tools_tests/src/expected/FormatDocstringsTest1.resi.extracted.json.expected b/tests/tools_tests/src/expected/FormatDocstringsTest1.resi.extracted.json.expected index 5fee63a034c..bc25518b269 100644 --- a/tests/tools_tests/src/expected/FormatDocstringsTest1.resi.extracted.json.expected +++ b/tests/tools_tests/src/expected/FormatDocstringsTest1.resi.extracted.json.expected @@ -1,20 +1,22 @@ -{ - "TAG": "Ok", - "_0": [{ +[ + { "id": "FormatDocstringsTest1.testFunction3", "name": "testFunction3", "code": "let processUsers = (users: array) => {\n users\n ->Array.map(user => {...user, active: false})\n ->Array.filter(u => u.age > 21)\n}\n\ntype status = Loading | Success(string) | Error(option)" - }, { + }, + { "id": "FormatDocstringsTest1.Nested.testFunction2", "name": "testFunction2", "code": "module UserService = {\n let validate = user => user.age >= 18 && user.name !== \"\"\n let getName = user => user.name\n}" - }, { + }, + { "id": "FormatDocstringsTest1.testFunction1-2", "name": "testFunction1", "code": "type user = {name: string, age: int, active: bool}\nlet createUser = (name, age) => {name, age, active: true}" - }, { + }, + { "id": "FormatDocstringsTest1.testFunction1-1", "name": "testFunction1", "code": "let badly_formatted = (x, y) => {\n let result = x + y\n if result > 0 {\n Console.log(\"positive\")\n } else {\n Console.log(\"negative\")\n }\n result\n}" - }] } +] diff --git a/tests/tools_tests/src/expected/FormatDocstringsTest2.res.extracted.json.expected b/tests/tools_tests/src/expected/FormatDocstringsTest2.res.extracted.json.expected index 1619063e79a..04113ab46b3 100644 --- a/tests/tools_tests/src/expected/FormatDocstringsTest2.res.extracted.json.expected +++ b/tests/tools_tests/src/expected/FormatDocstringsTest2.res.extracted.json.expected @@ -1,20 +1,22 @@ -{ - "TAG": "Ok", - "_0": [{ +[ + { "id": "FormatDocstringsTest2.testResi", "name": "testResi", "code": "type x = int\nlet x: int => string\nmodule M: {\n let ff: string => int\n}" - }, { + }, + { "id": "FormatDocstringsTest2.testPipes", "name": "testPipes", "code": "let processData = (data: array) => {\n data\n ->Array.filter(x => x > 0)\n ->Array.map(x => x * 2)\n ->Array.reduce(0, (acc, x) => acc + x)\n}\n\nlet asyncExample = async () => {\n let data = await fetchData()\n let processed = await processData(data)\n Console.log(processed)\n}" - }, { + }, + { "id": "FormatDocstringsTest2.testJsx-2", "name": "testJsx", "code": "let handleResult = (result: result) => {\n switch result {\n | Ok(value) => Console.log(`Success: ${value}`)\n | Error(error) => Console.error(`Error: ${error}`)\n }\n}" - }, { + }, + { "id": "FormatDocstringsTest2.testJsx-1", "name": "testJsx", "code": "let component = () => {\n
        \n

        {\"Title\"->React.string}

        \n \n
        \n}" - }] } +] diff --git a/tests/tools_tests/src/expected/FormatDocstringsTestError.res.extracted.json.expected b/tests/tools_tests/src/expected/FormatDocstringsTestError.res.extracted.json.expected index 9f24eec8251..e69de29bb2d 100644 --- a/tests/tools_tests/src/expected/FormatDocstringsTestError.res.extracted.json.expected +++ b/tests/tools_tests/src/expected/FormatDocstringsTestError.res.extracted.json.expected @@ -1,4 +0,0 @@ -{ - "TAG": "Error", - "_0": "\n Syntax error in code block in docstring\n FormatDocstringsTestError.res:5:10-6:3\n\n 3 │ \n 4 │ \n 5 │ let name= \n 6 │ let x=12\n\n This let-binding misses an expression\n\n" - } diff --git a/tests/tools_tests/src/expected/FormatRescriptBlocks.md.extracted.json.expected b/tests/tools_tests/src/expected/FormatRescriptBlocks.md.extracted.json.expected index dabca83343d..0f87bc8d91a 100644 --- a/tests/tools_tests/src/expected/FormatRescriptBlocks.md.extracted.json.expected +++ b/tests/tools_tests/src/expected/FormatRescriptBlocks.md.extracted.json.expected @@ -1,12 +1,12 @@ -{ - "TAG": "Ok", - "_0": [{ +[ + { "id": "codeblock-1", "name": "codeblock-1", "code": "type user = {name: string, age: int, active: bool}\nlet createUser = (name, age) => {name, age, active: true}" - }, { + }, + { "id": "codeblock-2", "name": "codeblock-2", "code": "let badly_formatted = (x, y) => {\n let result = x + y\n if result > 0 {\n Console.log(\"positive\")\n } else {\n Console.log(\"negative\")\n }\n result\n}" - }] } +] diff --git a/tests/tools_tests/src/expected/ModC.res.json b/tests/tools_tests/src/expected/ModC.res.json index f90a09755fc..cc4cce09bba 100644 --- a/tests/tools_tests/src/expected/ModC.res.json +++ b/tests/tools_tests/src/expected/ModC.res.json @@ -1,44 +1,31 @@ - { "name": "ModC", "docstrings": [], - "source": { - "filepath": "src/ModC.resi", - "line": 1, - "col": 1 - }, + "source": { "filepath": "src/ModC.resi", "line": 1, "col": 1 }, "items": [ - { - "id": "ModC.User", - "name": "User", - "kind": "module", - "docstrings": ["User Module from interface file"], - "source": { - "filepath": "src/ModC.resi", - "line": 4, - "col": 8 - }, - "items": [ { - "id": "ModC.User.name", - "kind": "value", - "name": "name", - "signature": "let name: string", - "docstrings": [], - "source": { - "filepath": "src/ModC.resi", - "line": 5, - "col": 3 - }, - "detail": - { - "kind": "signature", - "details": { - "returnType": { - "path": "string" + "id": "ModC.User", + "name": "User", + "kind": "module", + "docstrings": [ "User Module from interface file" ], + "source": { "filepath": "src/ModC.resi", "line": 4, "col": 8 }, + "items": [ + { + "id": "ModC.User.name", + "kind": "value", + "name": "name", + "signature": "let name: string", + "docstrings": [], + "source": { "filepath": "src/ModC.resi", "line": 5, "col": 3 }, + "detail": { + "kind": "signature", + "details": { + "parameters": [], + "returnType": { "path": "string", "genericTypeParameters": [] } + } + } } - } - } - }] - }] + ] + } + ] } diff --git a/tests/tools_tests/src/expected/ModC.resi.json b/tests/tools_tests/src/expected/ModC.resi.json index f90a09755fc..cc4cce09bba 100644 --- a/tests/tools_tests/src/expected/ModC.resi.json +++ b/tests/tools_tests/src/expected/ModC.resi.json @@ -1,44 +1,31 @@ - { "name": "ModC", "docstrings": [], - "source": { - "filepath": "src/ModC.resi", - "line": 1, - "col": 1 - }, + "source": { "filepath": "src/ModC.resi", "line": 1, "col": 1 }, "items": [ - { - "id": "ModC.User", - "name": "User", - "kind": "module", - "docstrings": ["User Module from interface file"], - "source": { - "filepath": "src/ModC.resi", - "line": 4, - "col": 8 - }, - "items": [ { - "id": "ModC.User.name", - "kind": "value", - "name": "name", - "signature": "let name: string", - "docstrings": [], - "source": { - "filepath": "src/ModC.resi", - "line": 5, - "col": 3 - }, - "detail": - { - "kind": "signature", - "details": { - "returnType": { - "path": "string" + "id": "ModC.User", + "name": "User", + "kind": "module", + "docstrings": [ "User Module from interface file" ], + "source": { "filepath": "src/ModC.resi", "line": 4, "col": 8 }, + "items": [ + { + "id": "ModC.User.name", + "kind": "value", + "name": "name", + "signature": "let name: string", + "docstrings": [], + "source": { "filepath": "src/ModC.resi", "line": 5, "col": 3 }, + "detail": { + "kind": "signature", + "details": { + "parameters": [], + "returnType": { "path": "string", "genericTypeParameters": [] } + } + } } - } - } - }] - }] + ] + } + ] } diff --git a/tools.opam b/tools.opam index bfcabac6a9f..e70c57f28f6 100644 --- a/tools.opam +++ b/tools.opam @@ -12,6 +12,7 @@ depends: [ "cmarkit" {>= "0.3.0"} "cppo" {= "1.8.0"} "analysis" + "yojson" {= "2.2.2"} "odoc" {with-doc} ] build: [ diff --git a/tools/bin/main.ml b/tools/bin/main.ml index 130ce24ac74..dcc1a3b71bf 100644 --- a/tools/bin/main.ml +++ b/tools/bin/main.ml @@ -155,21 +155,14 @@ let main () = | "extract-codeblocks" :: rest -> ( match rest with | ["-h"] | ["--help"] -> logAndExit (Ok extractCodeblocksHelp) - | path :: args -> ( + | path :: args -> let transformAssertEqual = List.mem "--transform-assert-equal" args in Clflags.color := Some Misc.Color.Never; (* TODO: Add result/JSON mode *) - match - Tools.ExtractCodeblocks.extractCodeblocksFromFile ~transformAssertEqual - ~entryPointFile:path - with - | Ok _ as r -> - print_endline (Analysis.Protocol.stringifyResult r); - exit 0 - | Error _ as r -> - print_endline (Analysis.Protocol.stringifyResult r); - exit 1) + Tools.ExtractCodeblocks.extractCodeblocksFromFile ~transformAssertEqual + ~entryPointFile:path + |> logAndExit | _ -> logAndExit (Error extractCodeblocksHelp)) | "reanalyze" :: _ -> if Sys.getenv_opt "RESCRIPT_REANALYZE_NO_SERVER" = Some "1" then ( diff --git a/tools/src/dune b/tools/src/dune index 765cece335f..33a51af1da5 100644 --- a/tools/src/dune +++ b/tools/src/dune @@ -4,4 +4,4 @@ (backend bisect_ppx)) (flags (-w "+6+26+27+32+33+39")) - (libraries analysis cmarkit)) + (libraries analysis cmarkit yojson)) diff --git a/tools/src/tools.ml b/tools/src/tools.ml index eb591aa9123..21cf5eea177 100644 --- a/tools/src/tools.ml +++ b/tools/src/tools.ml @@ -77,245 +77,196 @@ and docsForModule = { } let stringifyDocstrings docstrings = - let open Protocol in - docstrings - |> List.map (fun docstring -> docstring |> String.trim |> wrapInQuotes) - |> array + `List + (docstrings + |> List.map (fun docstring -> `String (docstring |> String.trim))) -let stringifyFieldDoc ~indentation (fieldDoc : fieldDoc) = - let open Protocol in - stringifyObject ~indentation:(indentation + 1) - [ - ("name", Some (wrapInQuotes fieldDoc.fieldName)); - ( "deprecated", - match fieldDoc.deprecated with - | Some d -> Some (wrapInQuotes d) - | None -> None ); - ("optional", Some (string_of_bool fieldDoc.optional)); - ("docstrings", Some (stringifyDocstrings fieldDoc.docstrings)); - ("signature", Some (wrapInQuotes fieldDoc.signature)); - ] +let stringifyFieldDoc (fieldDoc : fieldDoc) = + `Assoc + ([ + ("name", `String fieldDoc.fieldName); + ("optional", `Bool fieldDoc.optional); + ("docstrings", stringifyDocstrings fieldDoc.docstrings); + ("signature", `String fieldDoc.signature); + ] + @ + match fieldDoc.deprecated with + | Some d -> [("deprecated", `String d)] + | None -> []) -let stringifyConstructorPayload ~indentation - (constructorPayload : constructorPayload) = - let open Protocol in +let stringifyConstructorPayload (constructorPayload : constructorPayload) = match constructorPayload with | InlineRecord {fieldDocs} -> - stringifyObject ~indentation:(indentation + 1) + `Assoc [ - ("kind", Some (wrapInQuotes "inlineRecord")); - ( "fields", - Some - (fieldDocs - |> List.map (stringifyFieldDoc ~indentation:(indentation + 1)) - |> array) ); + ("kind", `String "inlineRecord"); + ("fields", `List (fieldDocs |> List.map stringifyFieldDoc)); ] -let rec stringifyTypeDoc ~indentation (td : typeDoc) : string = - let open Protocol in +let rec stringifyTypeDoc (td : typeDoc) = let ps = match td.genericParameters with - | [] -> None - | ts -> - ts |> List.map (stringifyTypeDoc ~indentation:(indentation + 1)) - |> fun ts -> Some (array ts) + | [] -> `List [] + | ts -> ts |> List.map stringifyTypeDoc |> fun ts -> `List ts in + `Assoc [("path", `String td.path); ("genericTypeParameters", ps)] - stringifyObject ~indentation:(indentation + 1) - [("path", Some (wrapInQuotes td.path)); ("genericTypeParameters", ps)] - -let stringifyDetail ?(indentation = 0) (detail : docItemDetail) = - let open Protocol in +let stringifyDetail (detail : docItemDetail) = match detail with | Record {fieldDocs} -> - stringifyObject ~startOnNewline:true ~indentation + `Assoc [ - ("kind", Some (wrapInQuotes "record")); - ( "items", - Some (fieldDocs |> List.map (stringifyFieldDoc ~indentation) |> array) - ); + ("kind", `String "record"); + ("items", `List (fieldDocs |> List.map stringifyFieldDoc)); ] | Variant {constructorDocs} -> - stringifyObject ~startOnNewline:true ~indentation + `Assoc [ - ("kind", Some (wrapInQuotes "variant")); + ("kind", `String "variant"); ( "items", - Some + `List (constructorDocs |> List.map (fun constructorDoc -> - stringifyObject ~startOnNewline:true - ~indentation:(indentation + 1) - [ - ( "name", - Some (wrapInQuotes constructorDoc.constructorName) ); - ( "deprecated", - match constructorDoc.deprecated with - | Some d -> Some (wrapInQuotes d) - | None -> None ); - ( "docstrings", - Some (stringifyDocstrings constructorDoc.docstrings) ); - ( "signature", - Some (wrapInQuotes constructorDoc.signature) ); - ( "payload", - match constructorDoc.items with - | None -> None - | Some constructorPayload -> - Some - (stringifyConstructorPayload - ~indentation:(indentation + 1) - constructorPayload) ); - ]) - |> array) ); + `Assoc + ([ + ("name", `String constructorDoc.constructorName); + ( "docstrings", + stringifyDocstrings constructorDoc.docstrings ); + ("signature", `String constructorDoc.signature); + ] + @ (match constructorDoc.deprecated with + | Some d -> [("deprecated", `String d)] + | None -> []) + @ + match constructorDoc.items with + | Some constructorPayload -> + [ + ( "payload", + stringifyConstructorPayload constructorPayload ); + ] + | None -> []))) ); ] | Signature {parameters; returnType} -> let ps = match parameters with - | [] -> None - | ps -> - ps |> List.map (stringifyTypeDoc ~indentation:(indentation + 1)) - |> fun ps -> Some (array ps) + | [] -> `List [] + | ps -> ps |> List.map stringifyTypeDoc |> fun ps -> `List ps in - stringifyObject ~startOnNewline:true ~indentation + `Assoc [ - ("kind", Some (wrapInQuotes "signature")); + ("kind", `String "signature"); ( "details", - Some - (stringifyObject ~startOnNewline:false ~indentation - [ - ("parameters", ps); - ("returnType", Some (stringifyTypeDoc ~indentation returnType)); - ]) ); + `Assoc + [("parameters", ps); ("returnType", stringifyTypeDoc returnType)] ); ] -let stringifySource ~indentation source = - let open Protocol in - stringifyObject ~startOnNewline:false ~indentation +let stringifySource source = + `Assoc [ - ("filepath", Some (source.filepath |> wrapInQuotes)); - ("line", Some (source.line |> string_of_int)); - ("col", Some (source.col |> string_of_int)); + ("filepath", `String source.filepath); + ("line", `Int source.line); + ("col", `Int source.col); ] -let rec stringifyDocItem ?(indentation = 0) ~originalEnv (item : docItem) = - let open Protocol in +let rec stringifyDocItem ~originalEnv (item : docItem) = match item with | Value {id; docstring; signature; name; deprecated; source; detail} -> - stringifyObject ~startOnNewline:true ~indentation - [ - ("id", Some (wrapInQuotes id)); - ("kind", Some (wrapInQuotes "value")); - ("name", Some (name |> wrapInQuotes)); - ( "deprecated", - match deprecated with - | Some d -> Some (wrapInQuotes d) - | None -> None ); - ("signature", Some (signature |> String.trim |> wrapInQuotes)); - ("docstrings", Some (stringifyDocstrings docstring)); - ("source", Some (stringifySource ~indentation:(indentation + 1) source)); - ( "detail", - match detail with - | None -> None - | Some detail -> - Some (stringifyDetail ~indentation:(indentation + 1) detail) ); - ] + `Assoc + ([ + ("id", `String id); + ("kind", `String "value"); + ("name", `String name); + ("signature", `String (signature |> String.trim)); + ("docstrings", stringifyDocstrings docstring); + ("source", stringifySource source); + ] + @ (match deprecated with + | Some d -> [("deprecated", `String d)] + | None -> []) + @ + match detail with + | Some detail -> [("detail", stringifyDetail detail)] + | None -> []) | Type {id; docstring; signature; name; deprecated; detail; source} -> - stringifyObject ~startOnNewline:true ~indentation - [ - ("id", Some (wrapInQuotes id)); - ("kind", Some (wrapInQuotes "type")); - ("name", Some (name |> wrapInQuotes)); - ( "deprecated", - match deprecated with - | Some d -> Some (wrapInQuotes d) - | None -> None ); - ("signature", Some (signature |> wrapInQuotes)); - ("docstrings", Some (stringifyDocstrings docstring)); - ("source", Some (stringifySource ~indentation:(indentation + 1) source)); - ( "detail", - match detail with - | None -> None - | Some detail -> - Some (stringifyDetail ~indentation:(indentation + 1) detail) ); - ] + `Assoc + ([ + ("id", `String id); + ("kind", `String "type"); + ("name", `String name); + ("signature", `String signature); + ("docstrings", stringifyDocstrings docstring); + ("source", stringifySource source); + ] + @ (match deprecated with + | Some d -> [("deprecated", `String d)] + | None -> []) + @ + match detail with + | Some detail -> [("detail", stringifyDetail detail)] + | None -> []) | Module m -> - stringifyObject ~startOnNewline:true ~indentation - [ - ("id", Some (wrapInQuotes m.id)); - ("name", Some (wrapInQuotes m.name)); - ("kind", Some (wrapInQuotes "module")); - ( "deprecated", - match m.deprecated with - | Some d -> Some (wrapInQuotes d) - | None -> None ); - ( "moduletypeid", - match m.moduletypeid with - | Some path -> Some (wrapInQuotes path) - | None -> None ); - ("docstrings", Some (stringifyDocstrings m.docstring)); - ( "source", - Some (stringifySource ~indentation:(indentation + 1) m.source) ); - ( "items", - Some - (m.items - |> List.map - (stringifyDocItem ~originalEnv ~indentation:(indentation + 1)) - |> array) ); - ] + `Assoc + ([ + ("id", `String m.id); + ("name", `String m.name); + ("kind", `String "module"); + ("docstrings", stringifyDocstrings m.docstring); + ("source", stringifySource m.source); + ( "items", + `List + (m.items + |> List.map (fun item -> stringifyDocItem ~originalEnv item)) ); + ] + @ (match m.deprecated with + | Some d -> [("deprecated", `String d)] + | None -> []) + @ + match m.moduletypeid with + | Some path -> [("moduletypeid", `String path)] + | None -> []) | ModuleType m -> - stringifyObject ~startOnNewline:true ~indentation - [ - ("id", Some (wrapInQuotes m.id)); - ("name", Some (wrapInQuotes m.name)); - ("kind", Some (wrapInQuotes "moduleType")); - ( "deprecated", - match m.deprecated with - | Some d -> Some (wrapInQuotes d) - | None -> None ); - ("docstrings", Some (stringifyDocstrings m.docstring)); - ( "source", - Some (stringifySource ~indentation:(indentation + 1) m.source) ); - ( "items", - Some - (m.items - |> List.map - (stringifyDocItem ~originalEnv ~indentation:(indentation + 1)) - |> array) ); - ] + `Assoc + ([ + ("id", `String m.id); + ("name", `String m.name); + ("kind", `String "moduleType"); + ("docstrings", stringifyDocstrings m.docstring); + ("source", stringifySource m.source); + ( "items", + `List + (m.items + |> List.map (fun item -> stringifyDocItem ~originalEnv item)) ); + ] + @ + match m.deprecated with + | Some d -> [("deprecated", `String d)] + | None -> []) | ModuleAlias m -> - stringifyObject ~startOnNewline:true ~indentation + `Assoc [ - ("id", Some (wrapInQuotes m.id)); - ("kind", Some (wrapInQuotes "moduleAlias")); - ("name", Some (wrapInQuotes m.name)); - ("docstrings", Some (stringifyDocstrings m.docstring)); - ( "source", - Some (stringifySource ~indentation:(indentation + 1) m.source) ); - ( "items", - Some - (m.items - |> List.map - (stringifyDocItem ~originalEnv ~indentation:(indentation + 1)) - |> array) ); + ("id", `String m.id); + ("kind", `String "moduleAlias"); + ("name", `String m.name); + ("docstrings", stringifyDocstrings m.docstring); + ("source", stringifySource m.source); + ("items", `List (m.items |> List.map (stringifyDocItem ~originalEnv))); ] -and stringifyDocsForModule ?(indentation = 0) ~originalEnv (d : docsForModule) = - let open Protocol in - stringifyObject ~startOnNewline:true ~indentation - [ - ("name", Some (wrapInQuotes d.name)); - ( "deprecated", - match d.deprecated with - | Some d -> Some (wrapInQuotes d) - | None -> None ); - ("docstrings", Some (stringifyDocstrings d.docstring)); - ("source", Some (stringifySource ~indentation:(indentation + 1) d.source)); - ( "items", - Some - (d.items - |> List.map - (stringifyDocItem ~originalEnv ~indentation:(indentation + 1)) - |> array) ); - ] +and stringifyDocsForModule ~originalEnv (d : docsForModule) = + `Assoc + ([ + ("name", `String d.name); + ("docstrings", stringifyDocstrings d.docstring); + ("source", stringifySource d.source); + ( "items", + `List + (d.items |> List.map (fun item -> stringifyDocItem ~originalEnv item)) + ); + ] + @ + match d.deprecated with + | Some d -> [("deprecated", `String d)] + | None -> []) let fieldToFieldDoc (field : SharedTypes.field) : fieldDoc = { @@ -629,7 +580,9 @@ let extractDocs ~entryPointFile ~debug = } in let docs = extractDocsForModule structure in - Ok (stringifyDocsForModule ~originalEnv:env docs)) + Ok + (stringifyDocsForModule ~originalEnv:env docs + |> Yojson.Safe.pretty_to_string)) | true -> Error (Printf.sprintf @@ -666,16 +619,20 @@ let extractEmbedded ~extensionPoints ~filename = in let iterator = {Ast_iterator.default_iterator with extension} in iterator.structure iterator structure; - let open Analysis.Protocol in - !content - |> List.map (fun (loc, extensionName, contents) -> - stringifyObject - [ - ("extensionName", Some (wrapInQuotes extensionName)); - ("contents", Some (wrapInQuotes contents)); - ("loc", Some (Analysis.Utils.cmtLocToRange loc |> stringifyRange)); - ]) - |> List.rev |> array + let result = + !content + |> List.map (fun (loc, extensionName, contents) -> + `Assoc + [ + ("extensionName", `String extensionName); + ("contents", `String contents); + ( "loc", + Analysis.Utils.cmtLocToRange loc |> Lsp.Types.Range.yojson_of_t + ); + ]) + |> List.rev + in + Yojson.Safe.pretty_to_string (`List result) let readFile path = let ic = open_in path in @@ -1276,21 +1233,20 @@ module ExtractCodeblocks = struct | Ok codeBlocks -> let errors = !errors in if List.length errors > 0 then - let errors = - errors |> List.rev |> String.concat "\n" |> Protocol.wrapInQuotes - in + let errors = errors |> List.rev |> String.concat "\n" in Error errors else Ok - (codeBlocks - |> List.map (fun codeBlock -> - Protocol.stringifyObject - [ - ("id", Some (Protocol.wrapInQuotes codeBlock.id)); - ("name", Some (Protocol.wrapInQuotes codeBlock.name)); - ("code", Some (Protocol.wrapInQuotes codeBlock.code)); - ]) - |> Protocol.array) + (Yojson.Safe.pretty_to_string ~std:true + (`List + (codeBlocks + |> List.map (fun codeBlock -> + `Assoc + [ + ("id", `String codeBlock.id); + ("name", `String codeBlock.name); + ("code", `String codeBlock.code); + ])))) end module Migrate = Migrate