diff --git a/CHANGELOG.md b/CHANGELOG.md index 6f336381b97..9d42ca81578 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -33,6 +33,7 @@ - Resolve workspace dependencies in editor analysis. https://github.com/rescript-lang/rescript/pull/8392 - Build system: Add OpenTelemetry tracing support for cli commands. https://github.com/rescript-lang/rescript/pull/8370 - 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 #### :house: Internal diff --git a/analysis/src/ProcessAttributes.ml b/analysis/src/ProcessAttributes.ml index 10e43d51126..31d994d5e03 100644 --- a/analysis/src/ProcessAttributes.ml +++ b/analysis/src/ProcessAttributes.ml @@ -22,15 +22,25 @@ let rec findDeprecatedAttribute attributes = match attributes with | [] -> None | ( {Asttypes.txt = "deprecated"}, - PStr - [ - { - pstr_desc = - Pstr_eval ({pexp_desc = Pexp_constant (Pconst_string (msg, _))}, _); - }; - ] ) - :: _ -> - Some msg + PStr [{pstr_desc = Pstr_eval ({pexp_desc = expr}, _)}] ) + :: _ -> ( + match expr with + (* Simple deprecated attr @deprecated("message") *) + | Pexp_constant (Pconst_string (_msg, _)) -> Some _msg + (* deprecated attr with record *) + | Pexp_record (fields, _) -> + let reason = ref "" in + + fields + |> List.iter (fun {lid = {txt}; x} -> + match (txt, x) with + | ( Lident "reason", + {pexp_desc = Pexp_constant (Pconst_string (msg, _))} ) -> + reason := msg + | _ -> ()); + + Some !reason + | _ -> None) | ({Asttypes.txt = "deprecated"}, _) :: _ -> Some "" | _ :: rest -> findDeprecatedAttribute rest @@ -41,7 +51,7 @@ let newDeclared ~item ~extent ~name ~stamp ~modulePath isExported attributes = extentLoc = extent; isExported; modulePath; - deprecated = findDeprecatedAttribute attributes; + deprecated = findDeprecatedAttribute (List.rev attributes); docstring = (match findDocAttribute attributes with | None -> [] diff --git a/tests/analysis_tests/tests/src/expected/Completion.res.txt b/tests/analysis_tests/tests/src/expected/Completion.res.txt index 09eae6fe7ad..33a37cf95bf 100644 --- a/tests/analysis_tests/tests/src/expected/Completion.res.txt +++ b/tests/analysis_tests/tests/src/expected/Completion.res.txt @@ -99,13 +99,13 @@ Path Array. "kind": 12, "tags": [1], "detail": "(array, string) => string", - "documentation": {"kind": "markdown", "value": "Deprecated: \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"} + "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", "kind": 12, "tags": [1], "detail": "(array<'a>, string) => string", - "documentation": {"kind": "markdown", "value": "Deprecated: \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"} + "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", "kind": 12, @@ -189,7 +189,7 @@ Path Array. "kind": 12, "tags": [1], "detail": "(array<'a>, 'a, ~start: int) => unit", - "documentation": {"kind": "markdown", "value": "Deprecated: \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"} + "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", "kind": 12, @@ -225,7 +225,7 @@ Path Array. "kind": 12, "tags": [1], "detail": "(array<'a>, 'a, int) => int", - "documentation": {"kind": "markdown", "value": "Deprecated: \n\n"} + "documentation": {"kind": "markdown", "value": "Deprecated: Use `lastIndexOf` instead\n\n"} }, { "label": "toLocaleString", "kind": 12, @@ -441,7 +441,7 @@ Path Array. "kind": 12, "tags": [1], "detail": "(array<'a>, ~start: int) => array<'a>", - "documentation": {"kind": "markdown", "value": "Deprecated: \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"} + "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", "kind": 12, @@ -453,7 +453,7 @@ Path Array. "kind": 12, "tags": [1], "detail": "(array<'a>, 'a) => unit", - "documentation": {"kind": "markdown", "value": "Deprecated: \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"} + "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", "kind": 12, @@ -519,7 +519,7 @@ Path Array. "kind": 12, "tags": [1], "detail": "(array<'a>, ~target: int, ~start: int) => array<'a>", - "documentation": {"kind": "markdown", "value": "Deprecated: \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"} + "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", "kind": 12, @@ -561,7 +561,7 @@ Path Array. "kind": 12, "tags": [1], "detail": "(array<'a>, int) => 'a", - "documentation": {"kind": "markdown", "value": "Deprecated: \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"} + "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", "kind": 12, @@ -573,7 +573,7 @@ Path Array. "kind": 12, "tags": [1], "detail": "(array<'a>, ~target: int) => array<'a>", - "documentation": {"kind": "markdown", "value": "Deprecated: \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"} + "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", "kind": 12, @@ -651,7 +651,7 @@ Path Array. "kind": 12, "tags": [1], "detail": "(array<'a>, 'a, int) => int", - "documentation": {"kind": "markdown", "value": "Deprecated: \n\n"} + "documentation": {"kind": "markdown", "value": "Deprecated: Use `indexOf` instead\n\n"} }] Complete src/Completion.res 5:10 @@ -2548,25 +2548,25 @@ Path t "kind": 12, "tags": [1], "detail": "(int, ~radix: int) => string", - "documentation": {"kind": "markdown", "value": "Deprecated: \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"} + "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", "kind": 12, "tags": [1], "detail": "(int, ~digits: int) => string", - "documentation": {"kind": "markdown", "value": "Deprecated: \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"} + "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", "kind": 12, "tags": [1], "detail": "(int, ~digits: int) => string", - "documentation": {"kind": "markdown", "value": "Deprecated: \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"} + "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", "kind": 12, "tags": [1], "detail": "(int, ~digits: int) => string", - "documentation": {"kind": "markdown", "value": "Deprecated: \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"} + "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", "kind": 12, @@ -2620,13 +2620,13 @@ Path t "kind": 12, "tags": [1], "detail": "(float, ~radix: int) => string", - "documentation": {"kind": "markdown", "value": "Deprecated: \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"} + "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", "kind": 12, "tags": [1], "detail": "(float, ~digits: int) => string", - "documentation": {"kind": "markdown", "value": "Deprecated: \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"} + "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", "kind": 12, @@ -2638,13 +2638,13 @@ Path t "kind": 12, "tags": [1], "detail": "(float, ~digits: int) => string", - "documentation": {"kind": "markdown", "value": "Deprecated: \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"} + "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", "kind": 12, "tags": [1], "detail": "(float, ~digits: int) => string", - "documentation": {"kind": "markdown", "value": "Deprecated: \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"} + "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", "kind": 12, @@ -2693,7 +2693,7 @@ Path g "kind": 12, "tags": [1], "detail": "(result<'a, 'b>, ~message: string=?) => 'a", - "documentation": {"kind": "markdown", "value": "Deprecated: \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"} + "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", "kind": 12, @@ -2711,7 +2711,7 @@ Path g "kind": 12, "tags": [1], "detail": "(result<'a, 'b>, 'a) => 'a", - "documentation": {"kind": "markdown", "value": "Deprecated: \n\n"} + "documentation": {"kind": "markdown", "value": "Deprecated: Use getOr instead\n\n"} }] Complete src/Completion.res 445:15 @@ -2795,7 +2795,7 @@ Path toS "kind": 12, "tags": [1], "detail": "(int, ~radix: int) => string", - "documentation": {"kind": "markdown", "value": "Deprecated: \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"} + "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", "kind": 12, diff --git a/tests/analysis_tests/tests/src/expected/CompletionInferValues.res.txt b/tests/analysis_tests/tests/src/expected/CompletionInferValues.res.txt index a8840ab77ea..5d72fc9174d 100644 --- a/tests/analysis_tests/tests/src/expected/CompletionInferValues.res.txt +++ b/tests/analysis_tests/tests/src/expected/CompletionInferValues.res.txt @@ -16,25 +16,25 @@ Path t "kind": 12, "tags": [1], "detail": "(int, ~radix: int) => string", - "documentation": {"kind": "markdown", "value": "Deprecated: \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"} + "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", "kind": 12, "tags": [1], "detail": "(int, ~digits: int) => string", - "documentation": {"kind": "markdown", "value": "Deprecated: \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"} + "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", "kind": 12, "tags": [1], "detail": "(int, ~digits: int) => string", - "documentation": {"kind": "markdown", "value": "Deprecated: \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"} + "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", "kind": 12, "tags": [1], "detail": "(int, ~digits: int) => string", - "documentation": {"kind": "markdown", "value": "Deprecated: \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"} + "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", "kind": 12, @@ -334,25 +334,25 @@ Path t "kind": 12, "tags": [1], "detail": "(int, ~radix: int) => string", - "documentation": {"kind": "markdown", "value": "Deprecated: \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"} + "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", "kind": 12, "tags": [1], "detail": "(int, ~digits: int) => string", - "documentation": {"kind": "markdown", "value": "Deprecated: \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"} + "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", "kind": 12, "tags": [1], "detail": "(int, ~digits: int) => string", - "documentation": {"kind": "markdown", "value": "Deprecated: \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"} + "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", "kind": 12, "tags": [1], "detail": "(int, ~digits: int) => string", - "documentation": {"kind": "markdown", "value": "Deprecated: \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"} + "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", "kind": 12, @@ -577,7 +577,7 @@ Path slic "kind": 12, "tags": [1], "detail": "(string, ~start: int) => string", - "documentation": {"kind": "markdown", "value": "Deprecated: \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"} }] Complete src/CompletionInferValues.res 91:82 @@ -600,7 +600,7 @@ Path toS "kind": 12, "tags": [1], "detail": "(int, ~radix: int) => string", - "documentation": {"kind": "markdown", "value": "Deprecated: \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"} + "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", "kind": 12, @@ -632,7 +632,7 @@ Path toS "kind": 12, "tags": [1], "detail": "(int, ~radix: int) => string", - "documentation": {"kind": "markdown", "value": "Deprecated: \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"} + "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", "kind": 12, @@ -665,7 +665,7 @@ Path toS "kind": 12, "tags": [1], "detail": "(int, ~radix: int) => string", - "documentation": {"kind": "markdown", "value": "Deprecated: \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"} + "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", "kind": 12, @@ -700,7 +700,7 @@ Path slic "kind": 12, "tags": [1], "detail": "(string, ~start: int) => string", - "documentation": {"kind": "markdown", "value": "Deprecated: \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"} }] Complete src/CompletionInferValues.res 107:89 @@ -729,7 +729,7 @@ Path slic "kind": 12, "tags": [1], "detail": "(string, ~start: int) => string", - "documentation": {"kind": "markdown", "value": "Deprecated: \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"} }] Complete src/CompletionInferValues.res 111:80 @@ -758,7 +758,7 @@ Path slic "kind": 12, "tags": [1], "detail": "(string, ~start: int) => string", - "documentation": {"kind": "markdown", "value": "Deprecated: \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"} }] Complete src/CompletionInferValues.res 115:53 @@ -779,7 +779,7 @@ Path toSt "kind": 12, "tags": [1], "detail": "(int, ~radix: int) => string", - "documentation": {"kind": "markdown", "value": "Deprecated: \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"} + "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", "kind": 12, diff --git a/tests/analysis_tests/tests/src/expected/CompletionJsx.res.txt b/tests/analysis_tests/tests/src/expected/CompletionJsx.res.txt index 5fd5b129993..a866ce1ee3e 100644 --- a/tests/analysis_tests/tests/src/expected/CompletionJsx.res.txt +++ b/tests/analysis_tests/tests/src/expected/CompletionJsx.res.txt @@ -213,13 +213,13 @@ Path "kind": 12, "tags": [1], "detail": "(int, ~radix: int) => string", - "documentation": {"kind": "markdown", "value": "Deprecated: \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"} + "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", "kind": 12, "tags": [1], "detail": "(int, ~digits: int) => string", - "documentation": {"kind": "markdown", "value": "Deprecated: \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"} + "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", "kind": 12, @@ -237,13 +237,13 @@ Path "kind": 12, "tags": [1], "detail": "(int, ~digits: int) => string", - "documentation": {"kind": "markdown", "value": "Deprecated: \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"} + "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", "kind": 12, "tags": [1], "detail": "(int, ~digits: int) => string", - "documentation": {"kind": "markdown", "value": "Deprecated: \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"} + "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", "kind": 12, @@ -315,7 +315,7 @@ Path "kind": 12, "tags": [1], "detail": "(int, int, rangeOptions) => array", - "documentation": {"kind": "markdown", "value": "Deprecated: \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"} + "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", "kind": 12, @@ -383,13 +383,13 @@ Path "kind": 12, "tags": [1], "detail": "(int, ~radix: int) => string", - "documentation": {"kind": "markdown", "value": "Deprecated: \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"} + "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", "kind": 12, "tags": [1], "detail": "(int, ~digits: int) => string", - "documentation": {"kind": "markdown", "value": "Deprecated: \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"} + "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", "kind": 12, @@ -407,13 +407,13 @@ Path "kind": 12, "tags": [1], "detail": "(int, ~digits: int) => string", - "documentation": {"kind": "markdown", "value": "Deprecated: \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"} + "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", "kind": 12, "tags": [1], "detail": "(int, ~digits: int) => string", - "documentation": {"kind": "markdown", "value": "Deprecated: \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"} + "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", "kind": 12, @@ -485,7 +485,7 @@ Path "kind": 12, "tags": [1], "detail": "(int, int, rangeOptions) => array", - "documentation": {"kind": "markdown", "value": "Deprecated: \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"} + "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", "kind": 12, @@ -832,7 +832,7 @@ Path s "kind": 12, "tags": [1], "detail": "(string, ~start: int) => string", - "documentation": {"kind": "markdown", "value": "Deprecated: \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"}, + "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", "insertText": "->String.substringToEnd", "additionalTextEdits": [{ @@ -868,7 +868,7 @@ Path s "kind": 12, "tags": [1], "detail": "(string, ~start: int) => string", - "documentation": {"kind": "markdown", "value": "Deprecated: \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"}, "sortText": "sliceToEnd", "insertText": "->String.sliceToEnd", "additionalTextEdits": [{ diff --git a/tests/analysis_tests/tests/src/expected/CompletionNullNullable.res.txt b/tests/analysis_tests/tests/src/expected/CompletionNullNullable.res.txt index 7c3aba3e25f..8903a5ef5a3 100644 --- a/tests/analysis_tests/tests/src/expected/CompletionNullNullable.res.txt +++ b/tests/analysis_tests/tests/src/expected/CompletionNullNullable.res.txt @@ -53,7 +53,7 @@ Path "kind": 12, "tags": [1], "detail": "t<'a> => 'a", - "documentation": {"kind": "markdown", "value": "Deprecated: \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"}, + "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", "insertText": "->Null.getExn", "additionalTextEdits": [{ @@ -137,7 +137,7 @@ Path "kind": 12, "tags": [1], "detail": "(t<'a>, 'b, 'a => 'b) => 'b", - "documentation": {"kind": "markdown", "value": "Deprecated: \n\n"}, + "documentation": {"kind": "markdown", "value": "Deprecated: Use mapOr instead\n\n"}, "sortText": "mapWithDefault", "insertText": "->Null.mapWithDefault", "additionalTextEdits": [{ @@ -149,7 +149,7 @@ Path "kind": 12, "tags": [1], "detail": "(t<'a>, 'a) => 'a", - "documentation": {"kind": "markdown", "value": "Deprecated: \n\n"}, + "documentation": {"kind": "markdown", "value": "Deprecated: Use getOr instead\n\n"}, "sortText": "getWithDefault", "insertText": "->Null.getWithDefault", "additionalTextEdits": [{ @@ -249,7 +249,7 @@ Path "kind": 12, "tags": [1], "detail": "t<'a> => 'a", - "documentation": {"kind": "markdown", "value": "Deprecated: \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"}, + "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", "insertText": "->Nullable.getExn", "additionalTextEdits": [{ @@ -333,7 +333,7 @@ Path "kind": 12, "tags": [1], "detail": "(t<'a>, 'b, 'a => 'b) => 'b", - "documentation": {"kind": "markdown", "value": "Deprecated: \n\n"}, + "documentation": {"kind": "markdown", "value": "Deprecated: Use mapOr instead\n\n"}, "sortText": "mapWithDefault", "insertText": "->Nullable.mapWithDefault", "additionalTextEdits": [{ @@ -345,7 +345,7 @@ Path "kind": 12, "tags": [1], "detail": "(t<'a>, 'a) => 'a", - "documentation": {"kind": "markdown", "value": "Deprecated: \n\n"}, + "documentation": {"kind": "markdown", "value": "Deprecated: Use getOr instead\n\n"}, "sortText": "getWithDefault", "insertText": "->Nullable.getWithDefault", "additionalTextEdits": [{ diff --git a/tests/analysis_tests/tests/src/expected/CompletionPipeChain.res.txt b/tests/analysis_tests/tests/src/expected/CompletionPipeChain.res.txt index 0ab9d756c09..1519636e45b 100644 --- a/tests/analysis_tests/tests/src/expected/CompletionPipeChain.res.txt +++ b/tests/analysis_tests/tests/src/expected/CompletionPipeChain.res.txt @@ -329,25 +329,25 @@ Path t "kind": 12, "tags": [1], "detail": "(int, ~radix: int) => string", - "documentation": {"kind": "markdown", "value": "Deprecated: \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"} + "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", "kind": 12, "tags": [1], "detail": "(int, ~digits: int) => string", - "documentation": {"kind": "markdown", "value": "Deprecated: \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"} + "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", "kind": 12, "tags": [1], "detail": "(int, ~digits: int) => string", - "documentation": {"kind": "markdown", "value": "Deprecated: \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"} + "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", "kind": 12, "tags": [1], "detail": "(int, ~digits: int) => string", - "documentation": {"kind": "markdown", "value": "Deprecated: \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"} + "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", "kind": 12, diff --git a/tests/analysis_tests/tests/src/expected/CompletionTypedArrays.res.txt b/tests/analysis_tests/tests/src/expected/CompletionTypedArrays.res.txt index 7c9f6d5593a..ee9e5f9972d 100644 --- a/tests/analysis_tests/tests/src/expected/CompletionTypedArrays.res.txt +++ b/tests/analysis_tests/tests/src/expected/CompletionTypedArrays.res.txt @@ -223,7 +223,7 @@ Path "kind": 12, "tags": [1], "detail": "(t<'a>, ~start: int) => t<'a>", - "documentation": {"kind": "markdown", "value": "Deprecated: \n\n\n`sliceToEnd(typedArray, ~start)` returns the elements from `start` through the end in a new typed array.\n"}, + "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", "insertText": "->TypedArray.sliceToEnd", "additionalTextEdits": [{ @@ -271,7 +271,7 @@ Path "kind": 12, "tags": [1], "detail": "(t<'a>, 'a, ~start: int) => t<'a>", - "documentation": {"kind": "markdown", "value": "Deprecated: \n\n\n`fillToEnd(typedArray, value, ~start)` fills from `start` through the end with `value`.\n\nBeware this will *mutate* the typed array.\n"}, + "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", "insertText": "->TypedArray.fillToEnd", "additionalTextEdits": [{ @@ -307,7 +307,7 @@ Path "kind": 12, "tags": [1], "detail": "(t<'a>, ~start: int) => t<'a>", - "documentation": {"kind": "markdown", "value": "Deprecated: \n\n\n`subarrayToEnd(typedArray, ~start)` returns a new view from `start` to the end of the buffer.\n"}, + "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", "insertText": "->TypedArray.subarrayToEnd", "additionalTextEdits": [{ @@ -439,7 +439,7 @@ Path "kind": 12, "tags": [1], "detail": "(t<'a>, ~target: int, ~start: int) => array<'a>", - "documentation": {"kind": "markdown", "value": "Deprecated: \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"}, + "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", "insertText": "->TypedArray.copyWithinToEnd", "additionalTextEdits": [{ @@ -913,7 +913,7 @@ Path "kind": 12, "tags": [1], "detail": "(t<'a>, ~start: int) => t<'a>", - "documentation": {"kind": "markdown", "value": "Deprecated: \n\n\n`sliceToEnd(typedArray, ~start)` returns the elements from `start` through the end in a new typed array.\n"}, + "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", "insertText": "->TypedArray.sliceToEnd", "additionalTextEdits": [{ @@ -961,7 +961,7 @@ Path "kind": 12, "tags": [1], "detail": "(t<'a>, 'a, ~start: int) => t<'a>", - "documentation": {"kind": "markdown", "value": "Deprecated: \n\n\n`fillToEnd(typedArray, value, ~start)` fills from `start` through the end with `value`.\n\nBeware this will *mutate* the typed array.\n"}, + "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", "insertText": "->TypedArray.fillToEnd", "additionalTextEdits": [{ @@ -997,7 +997,7 @@ Path "kind": 12, "tags": [1], "detail": "(t<'a>, ~start: int) => t<'a>", - "documentation": {"kind": "markdown", "value": "Deprecated: \n\n\n`subarrayToEnd(typedArray, ~start)` returns a new view from `start` to the end of the buffer.\n"}, + "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", "insertText": "->TypedArray.subarrayToEnd", "additionalTextEdits": [{ @@ -1129,7 +1129,7 @@ Path "kind": 12, "tags": [1], "detail": "(t<'a>, ~target: int, ~start: int) => array<'a>", - "documentation": {"kind": "markdown", "value": "Deprecated: \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"}, + "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", "insertText": "->TypedArray.copyWithinToEnd", "additionalTextEdits": [{ @@ -1603,7 +1603,7 @@ Path "kind": 12, "tags": [1], "detail": "(t<'a>, ~start: int) => t<'a>", - "documentation": {"kind": "markdown", "value": "Deprecated: \n\n\n`sliceToEnd(typedArray, ~start)` returns the elements from `start` through the end in a new typed array.\n"}, + "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", "insertText": "->TypedArray.sliceToEnd", "additionalTextEdits": [{ @@ -1651,7 +1651,7 @@ Path "kind": 12, "tags": [1], "detail": "(t<'a>, 'a, ~start: int) => t<'a>", - "documentation": {"kind": "markdown", "value": "Deprecated: \n\n\n`fillToEnd(typedArray, value, ~start)` fills from `start` through the end with `value`.\n\nBeware this will *mutate* the typed array.\n"}, + "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", "insertText": "->TypedArray.fillToEnd", "additionalTextEdits": [{ @@ -1687,7 +1687,7 @@ Path "kind": 12, "tags": [1], "detail": "(t<'a>, ~start: int) => t<'a>", - "documentation": {"kind": "markdown", "value": "Deprecated: \n\n\n`subarrayToEnd(typedArray, ~start)` returns a new view from `start` to the end of the buffer.\n"}, + "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", "insertText": "->TypedArray.subarrayToEnd", "additionalTextEdits": [{ @@ -1819,7 +1819,7 @@ Path "kind": 12, "tags": [1], "detail": "(t<'a>, ~target: int, ~start: int) => array<'a>", - "documentation": {"kind": "markdown", "value": "Deprecated: \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"}, + "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", "insertText": "->TypedArray.copyWithinToEnd", "additionalTextEdits": [{ @@ -2293,7 +2293,7 @@ Path "kind": 12, "tags": [1], "detail": "(t<'a>, ~start: int) => t<'a>", - "documentation": {"kind": "markdown", "value": "Deprecated: \n\n\n`sliceToEnd(typedArray, ~start)` returns the elements from `start` through the end in a new typed array.\n"}, + "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", "insertText": "->TypedArray.sliceToEnd", "additionalTextEdits": [{ @@ -2341,7 +2341,7 @@ Path "kind": 12, "tags": [1], "detail": "(t<'a>, 'a, ~start: int) => t<'a>", - "documentation": {"kind": "markdown", "value": "Deprecated: \n\n\n`fillToEnd(typedArray, value, ~start)` fills from `start` through the end with `value`.\n\nBeware this will *mutate* the typed array.\n"}, + "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", "insertText": "->TypedArray.fillToEnd", "additionalTextEdits": [{ @@ -2377,7 +2377,7 @@ Path "kind": 12, "tags": [1], "detail": "(t<'a>, ~start: int) => t<'a>", - "documentation": {"kind": "markdown", "value": "Deprecated: \n\n\n`subarrayToEnd(typedArray, ~start)` returns a new view from `start` to the end of the buffer.\n"}, + "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", "insertText": "->TypedArray.subarrayToEnd", "additionalTextEdits": [{ @@ -2509,7 +2509,7 @@ Path "kind": 12, "tags": [1], "detail": "(t<'a>, ~target: int, ~start: int) => array<'a>", - "documentation": {"kind": "markdown", "value": "Deprecated: \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"}, + "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", "insertText": "->TypedArray.copyWithinToEnd", "additionalTextEdits": [{ @@ -2983,7 +2983,7 @@ Path "kind": 12, "tags": [1], "detail": "(t<'a>, ~start: int) => t<'a>", - "documentation": {"kind": "markdown", "value": "Deprecated: \n\n\n`sliceToEnd(typedArray, ~start)` returns the elements from `start` through the end in a new typed array.\n"}, + "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", "insertText": "->TypedArray.sliceToEnd", "additionalTextEdits": [{ @@ -3031,7 +3031,7 @@ Path "kind": 12, "tags": [1], "detail": "(t<'a>, 'a, ~start: int) => t<'a>", - "documentation": {"kind": "markdown", "value": "Deprecated: \n\n\n`fillToEnd(typedArray, value, ~start)` fills from `start` through the end with `value`.\n\nBeware this will *mutate* the typed array.\n"}, + "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", "insertText": "->TypedArray.fillToEnd", "additionalTextEdits": [{ @@ -3067,7 +3067,7 @@ Path "kind": 12, "tags": [1], "detail": "(t<'a>, ~start: int) => t<'a>", - "documentation": {"kind": "markdown", "value": "Deprecated: \n\n\n`subarrayToEnd(typedArray, ~start)` returns a new view from `start` to the end of the buffer.\n"}, + "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", "insertText": "->TypedArray.subarrayToEnd", "additionalTextEdits": [{ @@ -3199,7 +3199,7 @@ Path "kind": 12, "tags": [1], "detail": "(t<'a>, ~target: int, ~start: int) => array<'a>", - "documentation": {"kind": "markdown", "value": "Deprecated: \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"}, + "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", "insertText": "->TypedArray.copyWithinToEnd", "additionalTextEdits": [{ @@ -3673,7 +3673,7 @@ Path "kind": 12, "tags": [1], "detail": "(t<'a>, ~start: int) => t<'a>", - "documentation": {"kind": "markdown", "value": "Deprecated: \n\n\n`sliceToEnd(typedArray, ~start)` returns the elements from `start` through the end in a new typed array.\n"}, + "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", "insertText": "->TypedArray.sliceToEnd", "additionalTextEdits": [{ @@ -3721,7 +3721,7 @@ Path "kind": 12, "tags": [1], "detail": "(t<'a>, 'a, ~start: int) => t<'a>", - "documentation": {"kind": "markdown", "value": "Deprecated: \n\n\n`fillToEnd(typedArray, value, ~start)` fills from `start` through the end with `value`.\n\nBeware this will *mutate* the typed array.\n"}, + "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", "insertText": "->TypedArray.fillToEnd", "additionalTextEdits": [{ @@ -3757,7 +3757,7 @@ Path "kind": 12, "tags": [1], "detail": "(t<'a>, ~start: int) => t<'a>", - "documentation": {"kind": "markdown", "value": "Deprecated: \n\n\n`subarrayToEnd(typedArray, ~start)` returns a new view from `start` to the end of the buffer.\n"}, + "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", "insertText": "->TypedArray.subarrayToEnd", "additionalTextEdits": [{ @@ -3889,7 +3889,7 @@ Path "kind": 12, "tags": [1], "detail": "(t<'a>, ~target: int, ~start: int) => array<'a>", - "documentation": {"kind": "markdown", "value": "Deprecated: \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"}, + "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", "insertText": "->TypedArray.copyWithinToEnd", "additionalTextEdits": [{ @@ -4363,7 +4363,7 @@ Path "kind": 12, "tags": [1], "detail": "(t<'a>, ~start: int) => t<'a>", - "documentation": {"kind": "markdown", "value": "Deprecated: \n\n\n`sliceToEnd(typedArray, ~start)` returns the elements from `start` through the end in a new typed array.\n"}, + "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", "insertText": "->TypedArray.sliceToEnd", "additionalTextEdits": [{ @@ -4411,7 +4411,7 @@ Path "kind": 12, "tags": [1], "detail": "(t<'a>, 'a, ~start: int) => t<'a>", - "documentation": {"kind": "markdown", "value": "Deprecated: \n\n\n`fillToEnd(typedArray, value, ~start)` fills from `start` through the end with `value`.\n\nBeware this will *mutate* the typed array.\n"}, + "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", "insertText": "->TypedArray.fillToEnd", "additionalTextEdits": [{ @@ -4447,7 +4447,7 @@ Path "kind": 12, "tags": [1], "detail": "(t<'a>, ~start: int) => t<'a>", - "documentation": {"kind": "markdown", "value": "Deprecated: \n\n\n`subarrayToEnd(typedArray, ~start)` returns a new view from `start` to the end of the buffer.\n"}, + "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", "insertText": "->TypedArray.subarrayToEnd", "additionalTextEdits": [{ @@ -4579,7 +4579,7 @@ Path "kind": 12, "tags": [1], "detail": "(t<'a>, ~target: int, ~start: int) => array<'a>", - "documentation": {"kind": "markdown", "value": "Deprecated: \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"}, + "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", "insertText": "->TypedArray.copyWithinToEnd", "additionalTextEdits": [{ @@ -5053,7 +5053,7 @@ Path "kind": 12, "tags": [1], "detail": "(t<'a>, ~start: int) => t<'a>", - "documentation": {"kind": "markdown", "value": "Deprecated: \n\n\n`sliceToEnd(typedArray, ~start)` returns the elements from `start` through the end in a new typed array.\n"}, + "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", "insertText": "->TypedArray.sliceToEnd", "additionalTextEdits": [{ @@ -5101,7 +5101,7 @@ Path "kind": 12, "tags": [1], "detail": "(t<'a>, 'a, ~start: int) => t<'a>", - "documentation": {"kind": "markdown", "value": "Deprecated: \n\n\n`fillToEnd(typedArray, value, ~start)` fills from `start` through the end with `value`.\n\nBeware this will *mutate* the typed array.\n"}, + "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", "insertText": "->TypedArray.fillToEnd", "additionalTextEdits": [{ @@ -5137,7 +5137,7 @@ Path "kind": 12, "tags": [1], "detail": "(t<'a>, ~start: int) => t<'a>", - "documentation": {"kind": "markdown", "value": "Deprecated: \n\n\n`subarrayToEnd(typedArray, ~start)` returns a new view from `start` to the end of the buffer.\n"}, + "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", "insertText": "->TypedArray.subarrayToEnd", "additionalTextEdits": [{ @@ -5269,7 +5269,7 @@ Path "kind": 12, "tags": [1], "detail": "(t<'a>, ~target: int, ~start: int) => array<'a>", - "documentation": {"kind": "markdown", "value": "Deprecated: \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"}, + "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", "insertText": "->TypedArray.copyWithinToEnd", "additionalTextEdits": [{ @@ -5743,7 +5743,7 @@ Path "kind": 12, "tags": [1], "detail": "(t<'a>, ~start: int) => t<'a>", - "documentation": {"kind": "markdown", "value": "Deprecated: \n\n\n`sliceToEnd(typedArray, ~start)` returns the elements from `start` through the end in a new typed array.\n"}, + "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", "insertText": "->TypedArray.sliceToEnd", "additionalTextEdits": [{ @@ -5791,7 +5791,7 @@ Path "kind": 12, "tags": [1], "detail": "(t<'a>, 'a, ~start: int) => t<'a>", - "documentation": {"kind": "markdown", "value": "Deprecated: \n\n\n`fillToEnd(typedArray, value, ~start)` fills from `start` through the end with `value`.\n\nBeware this will *mutate* the typed array.\n"}, + "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", "insertText": "->TypedArray.fillToEnd", "additionalTextEdits": [{ @@ -5827,7 +5827,7 @@ Path "kind": 12, "tags": [1], "detail": "(t<'a>, ~start: int) => t<'a>", - "documentation": {"kind": "markdown", "value": "Deprecated: \n\n\n`subarrayToEnd(typedArray, ~start)` returns a new view from `start` to the end of the buffer.\n"}, + "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", "insertText": "->TypedArray.subarrayToEnd", "additionalTextEdits": [{ @@ -5959,7 +5959,7 @@ Path "kind": 12, "tags": [1], "detail": "(t<'a>, ~target: int, ~start: int) => array<'a>", - "documentation": {"kind": "markdown", "value": "Deprecated: \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"}, + "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", "insertText": "->TypedArray.copyWithinToEnd", "additionalTextEdits": [{ @@ -6433,7 +6433,7 @@ Path "kind": 12, "tags": [1], "detail": "(t<'a>, ~start: int) => t<'a>", - "documentation": {"kind": "markdown", "value": "Deprecated: \n\n\n`sliceToEnd(typedArray, ~start)` returns the elements from `start` through the end in a new typed array.\n"}, + "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", "insertText": "->TypedArray.sliceToEnd", "additionalTextEdits": [{ @@ -6481,7 +6481,7 @@ Path "kind": 12, "tags": [1], "detail": "(t<'a>, 'a, ~start: int) => t<'a>", - "documentation": {"kind": "markdown", "value": "Deprecated: \n\n\n`fillToEnd(typedArray, value, ~start)` fills from `start` through the end with `value`.\n\nBeware this will *mutate* the typed array.\n"}, + "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", "insertText": "->TypedArray.fillToEnd", "additionalTextEdits": [{ @@ -6517,7 +6517,7 @@ Path "kind": 12, "tags": [1], "detail": "(t<'a>, ~start: int) => t<'a>", - "documentation": {"kind": "markdown", "value": "Deprecated: \n\n\n`subarrayToEnd(typedArray, ~start)` returns a new view from `start` to the end of the buffer.\n"}, + "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", "insertText": "->TypedArray.subarrayToEnd", "additionalTextEdits": [{ @@ -6649,7 +6649,7 @@ Path "kind": 12, "tags": [1], "detail": "(t<'a>, ~target: int, ~start: int) => array<'a>", - "documentation": {"kind": "markdown", "value": "Deprecated: \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"}, + "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", "insertText": "->TypedArray.copyWithinToEnd", "additionalTextEdits": [{ @@ -7123,7 +7123,7 @@ Path "kind": 12, "tags": [1], "detail": "(t<'a>, ~start: int) => t<'a>", - "documentation": {"kind": "markdown", "value": "Deprecated: \n\n\n`sliceToEnd(typedArray, ~start)` returns the elements from `start` through the end in a new typed array.\n"}, + "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", "insertText": "->TypedArray.sliceToEnd", "additionalTextEdits": [{ @@ -7171,7 +7171,7 @@ Path "kind": 12, "tags": [1], "detail": "(t<'a>, 'a, ~start: int) => t<'a>", - "documentation": {"kind": "markdown", "value": "Deprecated: \n\n\n`fillToEnd(typedArray, value, ~start)` fills from `start` through the end with `value`.\n\nBeware this will *mutate* the typed array.\n"}, + "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", "insertText": "->TypedArray.fillToEnd", "additionalTextEdits": [{ @@ -7207,7 +7207,7 @@ Path "kind": 12, "tags": [1], "detail": "(t<'a>, ~start: int) => t<'a>", - "documentation": {"kind": "markdown", "value": "Deprecated: \n\n\n`subarrayToEnd(typedArray, ~start)` returns a new view from `start` to the end of the buffer.\n"}, + "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", "insertText": "->TypedArray.subarrayToEnd", "additionalTextEdits": [{ @@ -7339,7 +7339,7 @@ Path "kind": 12, "tags": [1], "detail": "(t<'a>, ~target: int, ~start: int) => array<'a>", - "documentation": {"kind": "markdown", "value": "Deprecated: \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"}, + "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", "insertText": "->TypedArray.copyWithinToEnd", "additionalTextEdits": [{ diff --git a/tests/analysis_tests/tests/src/expected/Debug.res.txt b/tests/analysis_tests/tests/src/expected/Debug.res.txt index aa61765e932..3c94d138aaa 100644 --- a/tests/analysis_tests/tests/src/expected/Debug.res.txt +++ b/tests/analysis_tests/tests/src/expected/Debug.res.txt @@ -15,13 +15,13 @@ Path eqN "kind": 12, "tags": [1], "detail": "('a, nullable<'a>) => bool", - "documentation": {"kind": "markdown", "value": "Deprecated: \n\n"} + "documentation": {"kind": "markdown", "value": "Deprecated: Use `eqNullable` directly instead.\n\n"} }, { "label": "eqNull", "kind": 12, "tags": [1], "detail": "('a, null<'a>) => bool", - "documentation": {"kind": "markdown", "value": "Deprecated: \n\n"} + "documentation": {"kind": "markdown", "value": "Deprecated: Use `eqNull` directly instead.\n\n"} }] diff --git a/tests/analysis_tests/tests/src/expected/DotPipeCompletionSpec.res.txt b/tests/analysis_tests/tests/src/expected/DotPipeCompletionSpec.res.txt index d8ab393512e..c4f755efbc3 100644 --- a/tests/analysis_tests/tests/src/expected/DotPipeCompletionSpec.res.txt +++ b/tests/analysis_tests/tests/src/expected/DotPipeCompletionSpec.res.txt @@ -263,7 +263,7 @@ Path u "kind": 12, "tags": [1], "detail": "(array<'a>, int) => 'a", - "documentation": {"kind": "markdown", "value": "Deprecated: \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"}, + "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", "insertText": "->Array.unsafe_get", "additionalTextEdits": [{ diff --git a/tests/tools_tests/src/DocExtraction2.res b/tests/tools_tests/src/DocExtraction2.res index 3733153e0bc..3c60e9adcfe 100644 --- a/tests/tools_tests/src/DocExtraction2.res +++ b/tests/tools_tests/src/DocExtraction2.res @@ -10,3 +10,5 @@ module InnerModule = { } // ^dex + +let log = msg => Js.log(msg) diff --git a/tests/tools_tests/src/DocExtraction2.resi b/tests/tools_tests/src/DocExtraction2.resi index b653bdcabd6..bd8696e92ec 100644 --- a/tests/tools_tests/src/DocExtraction2.resi +++ b/tests/tools_tests/src/DocExtraction2.resi @@ -17,3 +17,9 @@ module InnerModule: { } // ^dex + +@deprecated({ + reason: "Use log instead", + migrate: Console.log(), +}) +let log: 'a => unit diff --git a/tests/tools_tests/src/expected/DocExtraction2.res.json b/tests/tools_tests/src/expected/DocExtraction2.res.json index 6b252b05486..bd71cd75607 100644 --- a/tests/tools_tests/src/expected/DocExtraction2.res.json +++ b/tests/tools_tests/src/expected/DocExtraction2.res.json @@ -91,5 +91,27 @@ } } }] + }, + { + "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" + } + } + } }] } diff --git a/tests/tools_tests/src/expected/DocExtraction2.resi.json b/tests/tools_tests/src/expected/DocExtraction2.resi.json index 6b252b05486..bd71cd75607 100644 --- a/tests/tools_tests/src/expected/DocExtraction2.resi.json +++ b/tests/tools_tests/src/expected/DocExtraction2.resi.json @@ -91,5 +91,27 @@ } } }] + }, + { + "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" + } + } + } }] }